How to change CSS with page attributes
Permalink
Hi,
Been searching and searching ant there are solutions to change some elements (for example the background images) by using page attributes.
But that is not quite what I am looking for.
I've been constructing site for one of our clients. The site structure includes three different main sections (three different themes) and several templates (in two finished themes/sections) already.
The last part of the site is killing me. It looks like that the number of templates is about be so huge it won't be a happy solution for anyone.
1) All we need is basically ONE page layout (all the elements are in the same place on every page)
2) however, different (sub)pages must be displayed in different color (menus, header images, mouse hovers, links etc). Previously I solved this by creating template and css for every color. VERY frustrating and expensive to maintain.
So, that is really not an option. With Concrete 5, I'd like solve this by using page attributes: I'd have only that one template but many CSS files. With Custom Attribute selection, I'd choose which CSS to use. How do I proceed?
I've:
- Created a new theme and installed required template(s)
- Added Custom Attribute field to this template. Let's say that the options are "red", "green" and "blue"
3) Created three different css files: "red.css", "green.css" and "blue.css"
Been searching and searching ant there are solutions to change some elements (for example the background images) by using page attributes.
But that is not quite what I am looking for.
I've been constructing site for one of our clients. The site structure includes three different main sections (three different themes) and several templates (in two finished themes/sections) already.
The last part of the site is killing me. It looks like that the number of templates is about be so huge it won't be a happy solution for anyone.
1) All we need is basically ONE page layout (all the elements are in the same place on every page)
2) however, different (sub)pages must be displayed in different color (menus, header images, mouse hovers, links etc). Previously I solved this by creating template and css for every color. VERY frustrating and expensive to maintain.
So, that is really not an option. With Concrete 5, I'd like solve this by using page attributes: I'd have only that one template but many CSS files. With Custom Attribute selection, I'd choose which CSS to use. How do I proceed?
I've:
- Created a new theme and installed required template(s)
- Added Custom Attribute field to this template. Let's say that the options are "red", "green" and "blue"
3) Created three different css files: "red.css", "green.css" and "blue.css"
Where colourscheme is the name of your page attribute. You'd just put in 'red', 'green', etc as the options, which matches the names of your extra stylesheets (no .css)
I may have a typo in the above as I just typed it directly in without testing it, but the idea should be sound I believe.