Make body tag editable
Permalink
Hi, I wanted to know if it is ok to make the body tag an editable area so that I can apply different body styles using on unique template?
Many thanks
Many thanks
Thanks for the reply ... What i basically want to do is apply a different background color to pages that use the same page template ...
If you are building your own theme, you'd then just use those classes to specifically target the wrapping div on those pages.
If you are using Elemental or another pre-built theme, you can use the custom CSS input when customising a theme and put the rule in there.
The fiddly bit here is that in this case it would be tidier to target body tag to apply the background, otherwise on pages with shorter page contents you might have white sticking out at the bottom... I'd still try to avoid that - you might be able to work around that with some min-heights.
If you are using Elemental or another pre-built theme, you can use the custom CSS input when customising a theme and put the rule in there.
The fiddly bit here is that in this case it would be tidier to target body tag to apply the background, otherwise on pages with shorter page contents you might have white sticking out at the bottom... I'd still try to avoid that - you might be able to work around that with some min-heights.
The top of a header file where the body tag is normally looks like this in templates:
The getPageWrapper function handily spits out a class representing both your page type and your page template. So it does stuff like this (in the case of a news page type and a full page template):
That then gives you lots of control over specific page types and layouts, while not targeting anything that isn't your actual page content. You'd use those classes to target the styling as necessary.
In fact, this is pretty much a requirement of 5.7 themes as it's needed to make the slide in panels work correctly, as per:http://www.concrete5.org/documentation/developers/5.7/designing-for...
I get a sense though that you might be referring to something else though..?