Die TYPO3 Mailingliste - nicht fragen: lesen!
This is a discussion on [TYPO3] custom css styles per page within the typo3-english@lists.netfielders.de forums, part of the TYPO3-Mailinglists: ENGLISH category; I have a html template that has <div class="foo">bar</div>. It's ...
|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
I have a html template that has <div class="foo">bar</div>. It's loaded
with plugin.tx_automaketemplate_pi1. Since every page has some specific two color theme - I would like to set a custom background-color on every page for class foo in constants and have those constants generate page specific inline style. I would not like to add a raw html content to every page. How can I do that with typo3? _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#2
|
|||
|
|||
|
Luka Mrovlje wrote:
> I have a html template that has <div class="foo">bar</div>. It's loaded > with plugin.tx_automaketemplate_pi1. > Since every page has some specific two color theme - I would like to set > a custom background-color on every page for class foo in constants and > have those constants generate page specific inline style. I would not > like to add a raw html content to every page. How can I do that with typo3? > Hi Luka, You can go to the Template module, create an extension template on each page. (Note - read on before typing.) In the "setup" field, you can add more information to the <head> section like this: page.headerData.42 = TEXT page.headerData.42.value = <link rel="stylesheet" type="text/css" href="foo1.css" /> Or if you want to just define a style: page.headerData.42.value = <style type="text/css"> .foo { background-color: #FF1FAA; } </style> (The 42 is fairly random - it works like a line number in old style BASIC programming. If you used it twice in one template, the second one overwrites the first.) To expand on that - since you mentioned "constants" in your post, you could put a single copy of the following into your root template (or other ancestor template) (so it inherits to all pages ![]() page.headerData.42 = TEXT page.headerData.42.value = <style type="text/css"> .foo { background-color: #{$fooBackgroundColor}; } </style> Then in the "constants" section on extension templates for each page, define the color: fooBackgroundColor = FF1FAA Two thoughts: 1. You probably need to define a default fooBackgroundColor in your root template (to not break the style syntax) 2. I am aware that style tags in headers often include comment delimiters like this: <style type="text/css"> <!-- .foo { background-color: #FF1FAA; } --> </style> I am not sure why, but I think that might be to keep some older browsers from breaking, or for accessibility. So you could use parenthesis to set a multiple line value, like this: page.headerData.42.value ( <style type="text/css"> <!-- .foo { background-color: #{$fooBackgroundColor}; } --> </style> ) Hope that helps, Curt _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#3
|
|||
|
|||
|
Hi Luka,
Check the ext /css_select, very nice and easy to use. - Katja / Luka Mrovlje kirjoitti: > I have a html template that has <div class="foo">bar</div>. It's > loaded with plugin.tx_automaketemplate_pi1. > Since every page has some specific two color theme - I would like to > set a custom background-color on every page for class foo in constants > and have those constants generate page specific inline style. I would > not like to add a raw html content to every page. How can I do that > with typo3? > > > _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
| Themen-Optionen | Thema durchsuchen |
| Ansicht | Thema bewerten |
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [TYPO3] Using something like custom markers to include a page whenusing TemplaVoila | Anders Axelsson | typo3-english@lists.netfielders.de | 0 | 21.09.2007 17:37 |
| [TYPO3] TT_NEWS categorytitles in different styles with | Søren Vedel | typo3-english@lists.netfielders.de | 3 | 01.04.2007 00:04 |
| [TYPO3] how to add custom frames to page content | John Kavanagh | typo3-english@lists.netfielders.de | 1 | 15.02.2007 11:28 |
| [TYPO3-shop] CSS Styles | Peter Chodyra | typo3-project-tt-products@lists.netfielders.de | 0 | 14.12.2006 21:27 |
| Re: [TYPO3] RTE custom styles | Andrew Davis | typo3-english@lists.netfielders.de | 1 | 12.12.2006 08:08 |