[TYPO3-templavoila] override HTML Header Parts in Templavoila
Ron Hall
ron at busynoggin.com
Fri Jul 6 14:24:52 CEST 2007
On Jul 3, 2007, at 11:36 PM, David Toshack wrote:
> I have done that, but I would like to override some styles of the
> template in only certain parts of the pagetree without duplicating the
> template. I prefer to insert the base template through the TV "Select
> HTML Header Parts" so that templates can be switched from the page
> properties by non-admin users without any TS modifications.
Including the stylesheet through TS should not at all hinder the non-
admin users from changing the templates easily. They change them as
they always have and do not have to touch the TS code. The admin user
can change the stylesheet for an entire section via TS but this is
transparent to the non-admin user when changing the templates.
Now, the technique presupposes that you use a common stylesheet for
all your templates. If you do not then you need to map through TV
header parts.
I am normally able to use a common css file because, as Georg
mentioned in an earlier post, I also assign a unique body id to each
template. I then map the body tag (and body tag only) through TV.
Having that body id allows me to target css for specific elements
within specific templates.
For instance, if you have two templates with body ids of "alt-1" and
"alt-1" and then css of:
#mainContent { color: black; }
#alt-1 #mainContent { color: red; }
#alt-1 #mainContent { color: blue; }
Then the text color in the div with an id of "mainContent" would be
red in the alt-1 template, blue in the alt-2 template, and black in
all other templates.
Ron Hall
Dallas, Texas
blog: "Adventures in TYPO3" at www.busynoggin.com/blog
web: www.busynoggin.com
More information about the TYPO3-project-templavoila
mailing list