by
KK » Mon Jan 29, 2024 4:32 pm
Thanks.
As you would know, there are two aspects in dealing with editable regions in Couch -
1. Define the region (this makes the region show up in the admin-panel, ready for input)
2. Display the value inputted in that region on the front-end
There are two ways of doing that -
1. Place <cms:editable> tag inline with the HTML on the frontend (as you are doing). This handles both the above-mentioned aspects for most editable regions.
2. Place <cms:editable> as a separate entity (within a <cms:template> block placed somewhere at the top of the template) - this fulfills only the 'defining' part. To fulfill the 'displaying' part, we than use <cms:show> at the exact place within the HTML where we wish to show the inputted value.
Problem with repeatable regions is that it not a normal editable region (i.e. not defined using <cms:editable>).
So using the first method mentioned above (i.e. using the definition for display also) will not work with it.
You'll have to use the second method instead.
So, if your template already has a <cms:template> block, please put the definition in there (if not, please create a <cms:template block>).
Your code should now look something like this -
- Code: Select all
<cms:template>
<cms:repeatable name='my_multiple_images' >
<cms:editable type='image' name='my_image' label='Photo' />
</cms:repeatable>
</cms:template>
Now you may display the values inputted within the repeatable-regions by placing the following wherever you desire to show the output
- Code: Select all
<cms:show_repeatable 'my_multiple_images' >
<img src="<cms:show my_image />" /> <br/>
</cms:show_repeatable>
Please adjust the names above to match your code.
Hope this helps.