Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hello,

I just just wondering, i'm currently running includes within the website. The main reason for this is simplex editing. However i want to be able to edit the includes page within couch. Which would save me editing things in code format. Is this possible ?

Thanks for you're support again. Sii
Hi Simon,

Yes you can manage the includes from within Couch (using global editable regions of type 'textarea' and 'no_xss_check' parameter set to '1').

However you said -
..Which would save me editing things in code format.

If by that you mean you'd like to edit the includes in HTML (richtext editor) format, that would be problematic.
The reason being that the includes, usually, are incomplete sections of HTML code. They make sense only after being combined with the rest of the page and the other includes. If you try and use the wysiwyg editor with incomplete HTML portions, it will try to set the HTML right by adding the missing closing tags. This, of course, will mess up your page.

Hope I was able to make myself clear.
Thanks.
KK wrote: Hi Simon,

Yes you can manage the includes from within Couch (using global editable regions of type 'textarea' and 'no_xss_check' parameter set to '1').

However you said -
..Which would save me editing things in code format.

If by that you mean you'd like to edit the includes in HTML (richtext editor) format, that would be problematic.
The reason being that the includes, usually, are incomplete sections of HTML code. They make sense only after being combined with the rest of the page and the other includes. If you try and use the wysiwyg editor with incomplete HTML portions, it will try to set the HTML right by adding the missing closing tags. This, of course, will mess up your page.

Hope I was able to make myself clear.
Thanks.


Thats Perfect KK,
I had a suspicion that you could only edit in Text Area format as code, rather than the richtext format.

Thanks again for you're support
Hi,

Would this also fit my use case? I want to display a section on every page such as "Voted Best Hairdress in England 2011". Hopefully, they will win again in 2012, or win a new award, and so will want to be able to edit that section.

In that case, would I create a second PHP fragment with just a text area on it, and include it on every page? What would I need as a minimum on the fragment?

Many thanks,

Mark
@MarkG

For your case, I propose you make use of a separate template (say named 'globals.php'). No need to make it clonable. Just define within it regions (richtext will do here) that will hold contents that are common to all the pages of your website e.g. 'footer_message', 'site_slogan' etc.

You can now output the contents of these area in all other templates by using
<cms:get_custom_field 'footer_message' masterpage='globals.php' />

Please see http://www.couchcms.com/docs/tutorials/ ... -ends.html (section 'Global Values') for fuller details about this technique.
5 posts Page 1 of 1
cron