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

Here's a question to the experienced Couch users among you:

Do I get it right that there are (at least) *2* ways of setting up a template for a single page :?:

The tutorial about creating the About Us page shows *one* way of setting up the template for this single page, i.e., enclosing a larger chunk of content with a pair of editable tags, refreshing the page and then going to the admin panel to find the content now editable in CKEditor.

It may have been obvious to most of you, but it only occurred to me after seeing a code snippet in KK's posting in the recent XSS thread, that there seems to be (at least) a *second* way of setting up the template for a single page - making the overview and changes of the template much easier:

That is, by putting several self-enclosing editable tags within the template tag at the start of the page, then - contrary to method 1 - deleting all the editable regions in the existing static page and replacing them with the respective show:tags, like, e.g., so:

Code: Select all
<cms:template title='template_name'>
   <cms:editable name='name_1' type='richtext' />
   <cms:editable name='name_2' label='Photo' desc='photo description' type='image' />
   <cms:editable name='name_3' type='richtext' />
   <cms:editable name='name_4' type='richtext' />
</cms:template>


<cms:show name_1 />

<cms:show name_2 />

<cms:do_shortcodes>
<cms:show name_3 />
</cms:do_shortcodes>

<cms:show name_4 />


Now all the editable content of the static page can be cut and pasted into the empty editable regions of the CKEditor.

I tested it and liked the clean template resulting from this second method.

Is that indeed a feasable method for CouchCMS, and what method do you personally use?

Looking forward to your input!

Solaris
Hi Solaris,

Once you move to the latter parts of the tutorial, you'll find that the 'blog' and 'portfolio' sections have been built using the second way you mentioned.

Actually, both the ways are valid for both non-clonable (single page template, as you put) as well as clonable templates.
Defining the editable regions right where their output is shown, is easier but with more complex templates (typically clonable because they involve various views) it becomes more manageable to define all regions at a single place and use the 'show' tag at the right places to output the contents of the regions.

Eventually, it is your decision to choose whichever way suits you.
KK wrote: Eventually, it is your decision to choose whichever way suits you.

Hi KK,

thanks a lot for clarifying! :)
I really like CouchCMS and its possibilities.

Cheers
Solaris
3 posts Page 1 of 1
cron