[TYPO3] TSConfig and assigning custom CSS

Christopher bedlamhotel at gmail.com
Sat Jan 28 23:11:12 CET 2006


Hi,

On 1/28/06, Michael Nardell <miken at inetworld.net> wrote:
> Greetings :: I have a site I am developing that uses T3 v.4 and
> TemplaVoila. So far everything is working well, however I have not found
>   an elegant solution to the following problem:
>
> I have certain pages that have a distinctive "color story" (background
> graphics, and text colors are set in a CSS which overides the color
> settings in my site-wide css.) I have done some experiments by using the
>   TypoScript Settings field in the template:
>
> page.stylesheet = red_custom_colors.css
>
> And then I get an additional link element in my HTML
> <link rel="stylesheet" type="text/css"
> href="uploads/tf/red_custom_colors.css" />
>
> Which seems to work ok. However there are some things that I do not like
> about this approach:
>
> 1) I will need to set-up a page template for each page that is to
> receive a color customization.
>
> 2) It seems like I need to reference the css file in the Template's
> Resouce field for this to work. I would rather only have to specify the
> the css referenc in one place.
>
> I would like to be able to add additional style sheet links to pagees
> using the TSConfig field (or using some other page property field),
> without having to set up a whole new template for each page that is to
> receive a custom css. I am reading through alot of the germain
> documentation TSRef, etc. However I have not found a solution to this
> particular problem that seems right. Any pointers would be appriciated.
>

The title of the thread alone tells me that you've more got reading
still to do :-)

The TSconfig field is used for setting up the BE, and doesn't have
anything very much to do with page rendering. In any case, you're
wrong about both of your options, but rather than explain that or type
out a bunch of solutions--there are numerous possibilities--I'm going
to ask you something first: how would you do it without Typo3?

In other words, how would you _prefer_ to do this task in terms of
html/css? Do you want to use multiple stylesheets or one? Do you want
a different stylesheet called in the head of the differently-styled
pages? Do you want to use an id attribute in the body element to
distinguish the different pages? Do you want to be able to edit the
stylesheet(s) from the template module? Do you intend to call your
stylesheets from inside a TemplaVoila page template or from a
Typoscript template?

Whichever method you prefer will be pretty easy to accomplish, but
since you can do it ten ways with html/css, you can approach it 20
ways from inside Typo3...


-Christopher



More information about the TYPO3-english mailing list