Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I'm working on a one-page website and I'd like to split the page into several sections in the COUCH backend. The page contains many editable regions and I'm concerned my client will be overwhelmed if he sees them all at once. Is there a way to set my template(s) up in a way that they show up as seperate pages in the backend but really are just one page, frontend-wise?

I guess what it boils down to is, how can I acccess variables from another non-clonable template?
Is that even possible? If only today started to play around with COUCH and I couldn't figure that one out.

Thanks for your help!
Hi,

One way of doing so would be -
1. Use a separate template (non-clonable, non-executable) for each section with its own editable regions.
2. Use index.php template (non-clonable) as the only accessible template of your site and display within it the values fetched from the other templates mentioned above.

It is very easy in Couch to show values of any template on any other template by using the 'masterpage' parameter.
In our case, if suppose the helper templates were 'section-1.php' and 'section-2.php', the values from both can be shown on index.php by using the following code -
Code: Select all
<cms:pages masterpage='section-1.php' >
   <!-- Values of all editable regions defined in 'section-1.php' are available here -->
   <cms:show region_of_section_1 />
</cms:pages>

<cms:pages masterpage='section-2.php' >
   <!-- Values of all editable regions defined in 'section-2.php' are available here -->
   <cms:show region_of_section_2 />
</cms:pages>

Hope this helps.
Thanks a lot! Works great ... and isn't actually all that hard :-)
3 posts Page 1 of 1
cron