Forum

Thread tagged as: Question, Configuration

changing the url when selecting /perch/resources

Hi

Is there a way in both runway and perch that you can change the url when you have uploaded an image or pdf file and it adds it to /perch/resources

so lets say you have an annual report called 2014-2015 annual report

and you add it by a template

    <div class="downLoadsBox<perch:content id="perch_item_index" type="hidden" />">

<perch:blocks scope-parent="true" >

    <perch:block label="File Download" type="file">
        <perch:template path="content/blocks/file_downloads_publications.html"/>
    </perch:block>
    <perch:block label="Link" type="text">
        <perch:template path="content/blocks/url-links.html"/>
    </perch:block>
</perch:blocks>
</div><!--end .downLoadsBox-->

so it ends up on the website as

sitename/perch/resources/2014-2015 annual report.pdf. can i add a url rewrite to make it

sitename//2014-2015 annual report.pdf.

regards,

Brett

Brett Warne

Brett Warne 0 points

  • 6 years ago

I am having trouble with changing the content type id=file path.

you can add a slug in your template and normally you would have a listing template that you would have the path that you wanted and add that to the url pattern in the page options.

but i can not find out how to change the file download path

Regards,

Brett

Drew McLellan

Drew McLellan 2638 points
Perch Support

You'd need to create a page to deliver the file, and then have that page handle the request.

Runway provides routing to pages, not arbitrary files.

Hi Drew

I may be missing something..

When i use the type=file perch will upload the item to /perch/resources/name-of-file

in the same template if i add a

<perch:content id="slug" for="file" type="slug" suppress="true" />

the slug it is creating is not the name of the file being uploaded- its is ra-d41d-cd98, makes no difference what file i upload.

so when i add the url pattern to the page it ends up as /page/ra-d41d-cd98 not page/name-of-file

can you tell me what i am doing wrong. why is the slug mot the file name

Regards,

Brett

Drew McLellan

Drew McLellan 2638 points
Perch Support

You're trying to make a slug of a file, not a file name. Why not use the file name?

Or if you want to upload to a different location, you can set up a resource bucket.