Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
How can I reuse editables? I have tested following approaches, but none of it worked.

Approach 1
Code: Select all
<cms:set mona="example" />
<cms:embed 'mosaic.html' />

File: mosaic.html
Code: Select all
<cms:mosaic name="<cms:get mona />">
    <cms:tile name='headline' label='Headline' >
        <cms:editable name='headline' label='Überschrift' type="text" />
    </cms:tile >
</cms:mosaic >


Approach 2
Code: Select all
<cms:mosaic name="example">
<cms:embed 'mosaic.html' />
</cms:mosaic>

File: mosaic.html
Code: Select all
    <cms:tile name='headline' label='Headline' >
        <cms:editable name='headline' label='Überschrift' type="text" />
    </cms:tile >
The second approach will not work with 'mosiac' as tag <cms:mosaic> supports only <cms:tile> tags as its children.
The first approach, however, is valid for all types of editable regions.

As to then why it is not working? - that is because in your snippet you are using <cms:get> in an incorrect manner. The tag expects a string (i.e. enclosed by quotes) while you are providing it with a straight variable name.

You should use the following (please notice the use of quotes around 'mona') -
Code: Select all
<cms:mosaic name="<cms:get 'mona' />">

Alternatively, you could have simply used <cms:show> that does expect a variable e.g.
Code: Select all
<cms:mosaic name="<cms:show mona />">

or even
Code: Select all
<cms:mosaic name=mona>

Hope this helps.
Yes, this helped. Thank you.
3 posts Page 1 of 1