Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hey everybody,

I've been using CouchCMS for a little bit now, and it's absolutely fantastic. I've just started using the type = 'file' editable region and noticed when I've uploaded a file it shows the url to that file. Is there a way to hide this url?

Thank you all,

Riley5.
Hello and welcome Riley :)

The URL you see displayed in the editable region actually shows *exactly* what you'd get while using cms:show on the front-end to output the region's data.

This behaviour is by design, so, I am afraid, there is no way to turn it off.
Thanks KK!

So there is no work around to hide the url?
I'm confused; what do you mean by "hide the url" and why do you want to do this?
Code: Select all
        <cms:editable 
  name='become_a_shareholder'
  label='Shareholder PDF'
  desc='Upload the file here'
  type='file'/>

        <p><a href="<cms:show become_a_shareholder />" class="_links" >Download PDF</a></p>

Here the code I'm currently using. When I view it online however (after uploading the file), it comes up as:

http://websiteaddress.com/couch/uploads/file/shareholder.pdf
Download PDF

I want to be able to hide direct url (the bold bit) to the file and just have the hyperlink to it. Does that make sense?
Yes, that clears up the matter.

There are two ways we can define editable regions: in-place or within the 'cms:template' tag. When doing this in-place we not only define the editable region, but also output the content. This is why you have the URL displayed where the editable region is defined before the 'Download PDF' link. You can either add hidden='1' to the editable region to prevent this behavior, or move your editable regions to within the 'cms:template' tag. I suggest moving all of the editable regions as it makes maintaining and editing your code much easier when everything is defined in a central location:
Code: Select all
<cms:template>
            <cms:editable
   name='become_a_shareholder'
   label='Shareholder PDF'
   desc='Upload the file here'
   type='file'/>
   <!-- other editable regions -->
</cms:template>

<p><a href="<cms:show become_a_shareholder />" class="_links">Download PDF</a></p>
Perfect! Thank you very much, CheesyPoof, much appreciated.
Good catch, @cheesypoof :)
I misunderstood the question completely.
cheesypoof wrote: Yes, that clears up the matter.

There are two ways we can define editable regions: in-place or within the 'cms:template' tag. When doing this in-place we not only define the editable region, but also output the content. This is why you have the URL displayed where the editable region is defined before the 'Download PDF' link. You can either add hidden='1' to the editable region to prevent this behavior, or move your editable regions to within the 'cms:template' tag. I suggest moving all of the editable regions as it makes maintaining and editing your code much easier when everything is defined in a central location:


Thanks for the tips. I'm another new user of CouchCMS and this was what I was looking for. Cheers for that.
9 posts Page 1 of 1