TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv

Die TYPO3 Mailingliste - nicht fragen: lesen!

[TYPO3] custom css styles per page

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 ...


Zurück   TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv > TYPO3-Mailinglists: ENGLISH > typo3-english@lists.netfielders.de

Registrieren Hilfe Benutzerliste Kalender Suchen Heutige Beiträge Alle Foren als gelesen markieren
  #1  
Alt 10.03.2008, 21:39
Luka Mrovlje
Gast
 
Beiträge: n/a
Standard [TYPO3] custom css styles per page

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #2  
Alt 10.03.2008, 22:43
Curt Grimley
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] custom css styles per page

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #3  
Alt 11.03.2008, 08:20
Katja Lampela
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] custom css styles per page

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ähnliche Themen

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


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:04 Uhr.


Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39