[TYPO3-templavoila] How to include a IE stylesheet in TV?

Uschi Renziehausen typo3news at otherone.de
Thu Jun 7 09:23:54 CEST 2007


Hi Daniel

> And that's where my problem started: How can I do that with more as one 
> template in use.
> In other words, is there a (kind of) condition to detect wich template 
> is used for a particular page? Only in that way, I think, it's possible 
> to connect the right explorer-stylesheet to the right webpage/TV-template.

I had the same problem and solved it with a nested CASE construct.
First you have to disable all css-styles in the TV header parts, because 
they are alway put out directly before the closing </head> tag.

Then I created a little lib for each of my page templates:

lib.loadCSS_frontpage = HTML
lib.loadCSS_frontpage {
    <link href="/fileadmin/templates/themes/default/index.css" 
rel="stylesheet" type="text/css" media="screen, projection" />
}

lib.loadCSS_portalstart = HTML
lib.loadCSS_portalstart {
    <link href="/fileadmin/templates/themes/default/portalstart.css" 
rel="stylesheet" type="text/css" media="screen, projection" />
}

lib.loadCSS_contentpage = HTML
lib.loadCSS_contentpage {
    <link href="/fileadmin/templates/themes/default/contentpage.css" 
rel="stylesheet" type="text/css" media="screen, projection" />
}


The nested CASE object looks like this

page.headerData.10 = CASE
page.headerData.10 {
	key.field = tx_templavoila_to
	
	default = CASE
	default {
		key.data = levelfield : -1 , tx_templavoila_next_to, slide
		2 < lib.loadCSS_frontpage
		10 < lib.loadCSS_portalstart
		11 < lib.loadCSS_contentpage
	}

	2 < lib.loadCSS_frontpage
	10 < lib.loadCSS_portalstart
	11 < lib.loadCSS_contentpage
	
}

Some explanation: Which TO is used by a page is stored in table pages, 
either in column tx_templavoila_to of the current page, or, if that 
field is empty, in column tx_templavoila_next_to of a page some way up 
in rootline.

So the key field of the outer CASE object is tx_templavoila_to and the 
default for the outer CASE object is that this field is empty and 
therefore we make it a CASE object again.
The key.data we find out by sliding up the rootline, until we find a 
page where the tx_templavoila_next_to is not empty.

2 is the uid of my TO for the frontpage
10 is the uid of my TO for a portalstart page
11 is the uid of my TO for a normal content page

Hope this helps, Uschi
Therefore we make we slide up the rootline until we


More information about the TYPO3-project-templavoila mailing list