Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Hello!
:D
I do not know if I am pushing the boundaries of Couch, but I am trying to make a snippet that is present on many pages, that can be updated just once in global settings. Ideally the region would also be repeatable.

I looked at the global values documentation, but that appears to be only for text and not regions of code? Thanks for your help for how I can create an editable region, where my client can update the images/text once and they will automatically update onto all the pages where the snippet lies!

Here is the code I have so far for my snippet that uses repeatable regions. I seem to be missing the step on how to turn an entire Snippet into Global Values. Thanks for your help!!

<?php require_once( 'couch/cms.php' ); ?>

<cms:template title='Global Settings' executable='0'>
<cms:editable name='tabs' label='tabs' desc='right hand tabs' type='group'/>

<cms:repeatable name='tab_popular' label=' Popular Tabs' group="tabs">
<cms:editable name='post_image'
label='Post Image'
show_preview='1'
preview_width='100'
input_width='100'
type='image'
/>
<cms:editable name='post_caption' label='Post Caption' type='textarea' />
<cms:editable name='post_date' label='Post Date' type='textarea' />
<cms:editable name='post_title' label='Post Title' type='nicedit' />
<cms:editable name='post_link' label="Post Link" type='text' ><cms:link 'http://tastefulhealth.com/food_posts/food_posts.html' page='put_page_name_here' /></cms:editable>
</cms:repeatable>

<cms:repeatable name='tab_recent' label='Recent Tabs' group="tabs">
<cms:editable name='post_image'
label='Post Image'
show_preview='1'
preview_width='100'
input_width='100'
type='image'
/>
<cms:editable name='post_caption' label='Slide Caption' type='textarea' />
<cms:editable name='post_title' label='Slide Title' type='nicedit' />
<cms:editable name='post_link' label="Slide Link" type='text' ><cms:link 'http://tastefulhealth.com/food_posts/food_posts.html' page='put_page_name_here' /></cms:editable>
<cms:editable name='post_date' label='Post Date' type='textarea' />
</cms:repeatable>

<cms:repeatable name='tab_tags' label='Tab Tags' group="tabs">

<cms:editable name='tab_tagblank' label='tags' desc='SEO Tags' type='text' input_width='70' col_width='100'/>

</cms:repeatable>
</cms:template>

<?php COUCH::invoke(); ?>
You could use the <cms:pages> tag to extract any editable regions (including repeatable regions) from one page (e.g globals.php) onto another.

<cms:pages masterpage='globals.php'>
<cms:show_repeatable 'tab_tags' >
</cms:show_repeatable>
</cms:pages>

The show_repeatable is just an example; any snippet can be included on any page using this technique.
2 posts Page 1 of 1