Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hi

I tried to make the includes/header.php editable as is a paragraph of text that I would like to make editable but when I tried putting the couch cms tags in and named the editable content area header_side_content, on the admin side of couch cms, it messed up the Home tab and added header_side_content into the Home tab

so was seeing if there a way to make includes/header.php separate from the Home tab within the admin side of couch cms and make it editable, hope that makes sense?
Hi,

Yes, I think I understand where you are coming from.
The issue is as follows. Since your 'home.php' template use PHP to 'include' (or 'require') 'includes/header.php' within it, for all practical purposes the contents of 'includes/header.php' become one with home.php.

That means, any <cms:editable> region you tried to define in header.php will now seem as if being declared within home.php.
Hence you see the 'header_side_content' region showing up in home.php. In fact it will appear in *every* template you include that header in.

OK, so now for the solution -
Please use a separate template (say named 'globals.php') and define all the regions you need to use in header (also footer, sidebar if needed) within it (please see the docs http://docs.couchcms.com/tutorials/port ... bal-values if you need help with globals).

Now in your includes/headers.php, use this to fetch the values from the global template -
Code: Select all
<cms:get_custom_field 'header_side_content' masterpage='globals.php' /> 

Hope it helps.
2 posts Page 1 of 1

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 4 guests