All times are UTC + 5:30 hours




Post new topic Reply to topic  [ 5 posts ] 
  Print view

How to make includes Editable ?
Author Message
PostPosted: Wed Feb 01, 2012 7:15 pm 
Registered User
Offline

Joined: Wed Jan 05, 2011 12:08 am
Posts: 144
Location: Uk, England
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


Top
 Profile  
 

Re: How to make includes Editable ?
PostPosted: Wed Feb 01, 2012 8:06 pm 
Moderator
Offline

Joined: Wed Dec 01, 2010 5:35 pm
Posts: 1378
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 -
Quote:
..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.


Top
 Profile  
 

Re: How to make includes Editable ?
PostPosted: Thu Feb 16, 2012 6:50 am 
Registered User
Offline

Joined: Wed Jan 05, 2011 12:08 am
Posts: 144
Location: Uk, England
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 -
Quote:
..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


Top
 Profile  
 

Re: How to make includes Editable ?
PostPosted: Wed Feb 22, 2012 9:34 pm 
Registered User
Offline

Joined: Thu Dec 29, 2011 2:13 am
Posts: 20
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


Top
 Profile  
 

Re: How to make includes Editable ?
PostPosted: Wed Feb 22, 2012 11:16 pm 
Moderator
Offline

Joined: Wed Dec 01, 2010 5:35 pm
Posts: 1378
@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
Quote:
<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.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 5:30 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© 2001-2010 SYS-Solutions All Rights Reserved