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

I have recently started to use Couch CMS and have today come across an error.

My front end code is as follows:

<div class="grid-100 title_image">
<cms:editable name='butling_image' label='Image' desc='Upload image here' type='image'>
<img src="<cms:show butling_image />" />
</cms:editable>
</div>

Upon a refresh it displays an editable region where I can upload an image but not select the image. The editable region appears broken. See below:

Image

May be missing something simple.

Thanks in advance,

Chris
Hi Chris,

Welcome to our forums :)

The problem that you reported is due to a slight mistake in the way you are using the cms:editable tag (to be precise - the 'image' type does not accept nested contents).

There are two ways we can define an editable regions -
1. In-place (i.e. we use the value entered within the region at the same place where we define it). If we use this method, your code should now become as follows.
Code: Select all
<img src="<cms:editable name='butling_image' label='Image' desc='Upload image here' type='image' />" />

2. Within the 'cms:template' tag.
In this method the locations where we define the tag and that where we use the value of it are different.
Usually we define all editable regions at the same location (usually somewhere at the top of the page) nested within a cms:template tag block. The values contained within the regions become available through cms:show tag. Using this method, your code becomes -
Code: Select all
<cms:template>
    <cms:editable name='butling_image' label='Image' desc='Upload image here' type='image' />
    ..
    .. definitions of other editable regions can go here ..
    ..
</cms:template>
..
..
<img src="<cms:show butling_image />" />

Please amend your code to use either of the two acceptable methods and that should rectify the problem.

Hope this helps. Do let us know.
Thanks.
Thanks ever so much for your reply. I have since been getting along fine with Couch and will be purchasing licence(s).

Great stuff.
Glad to be of any help, Chris :)
4 posts Page 1 of 1