Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I'm having a problem with the image upload part of couch CMS.
I followed the first step of the tutorial documentation to set up the CMS and started to replace my images with editable regions.

Code: Select all
<cms:editable  name='intro_image' type='image'>
    <img src="<cms:show intro_image />" alt=""/>
</cms:editable>


Is the above code correct?

Attachments

Hello and welcome, samverdyck.

The code you are using is slightly incorrect.

Basically while defining an editable region we have a choice between -
1. defining it 'in place' (i.e. right where the output of the region will be shown) or
2. defining it within a cms:template block.

So, if you choose the first method, your code would become
Code: Select all
<img src="<cms:editable  name='intro_image' type='image' />" alt=""/>


If you choose the second method, define a cms:template block somewhere at the top of the template (below the PHP include statement) and put the definition of the region(s) within it as follows -
Code: Select all
<cms:template>
    <cms:editable  name='intro_image' type='image' />
</cms:template>

Now your code for showing the image will become -
Code: Select all
<img src="<cms:show intro_image />" alt=""/>  

Hope this helps.
thanks!
I'm just a beginner in working with couch, thanks for the quick support!
3 posts Page 1 of 1