Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi,

I'm just wondering how to achieve this..

I have a line of code like this inside a cloneable template:

Code: Select all
<a href="<cms:show portfolio_address />" class="featured-box pop-out" style="background-image: url(http://lorempixel.com/350/222/);"></a>


I wan't to add a possibility to upload an image as the background-image of the link. I've already added the possibility to upload the image but I can't figure out how to get the url of the selected image so that I could do like this:

Code: Select all
<a href="<cms:show portfolio_address />" class="featured-box pop-out" style="background-image: url(<cms:show image_url />"></a>


Any help is appreciated. I tried googling a bit for this but couldn't find anything relevant enough.
For all editable regions, you can output their information by using the 'show' tag along with their respective name. So in the same way you did <cms:show portfolio_address />, you would do:
Code: Select all
<a href="<cms:show portfolio_address />" class="featured-box pop-out" style="background-image: url(<cms:show image_name />)"></a>

Your best resource is going to be the documentation (http://www.couchcms.com/docs/), it is very well written. Feel free to ask any questions though if you are unsure of anything. ;)
This solved my problem, thanks!

I had somehow thought that using the <cms:show my_image /> would insert a whole img tag in the code and not just the URL. My bad, but again thanks for help!
3 posts Page 1 of 1