Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
I was wondering, if it is possible somehow to make CSS files editable by the client? For example, when I create websites I tend to use background-image property a lot(even more now with RWD, so I can just change bg with MQs).

Example:
Now it is possible to create full-screen galleries with just CSS3, and if it is using background-image property, would it be somehow possible to create editable regions for that in the CSS file?
Hi,

We can easily convert the .css file into a bonafide Couch managed template (and hence be able to define and use within it all the editable regions that you might require).

For example, if your site has a stylesheet named styles.css, rename it to styles.php, place the require_once and invoke statements to turn it into a regular Couch managed template.

Make sure to place the following statement just below the require_once
<cms:content_type 'text/css' />

You can now link all files to styles.php instead of styles.css. e.g.
<link rel="stylesheet" href="http://www.yoursite.com/css/styles.php" type="text/css" />

Hope this helps.
I was hoping for an answer like this. Great, thanks KK!
That's great :D
I ask - what should be done for Editable JS ?
Thank You
@orbital, the same technique would apply to JS files also with two changes -
1. use the proper 'content-type' -
Code: Select all
<cms:content_type 'text/javascript' />

2. use only type 'textarea' editable regions with no_xss_check='1' (please search the forum for this attribute if you are not sure what it does).

Hope it helps.
What if you're using SASS? Would you put it in the CSS file or the SCSS file?
6 posts Page 1 of 1

Who is online

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

Users browsing this forum: No registered users and 3 guests