[Typo3] Add css with ts on a single page

Vlatko Šurlan vlatko at RMVCAPSnet.hr
Fri Dec 2 12:04:31 CET 2005


Mathias Schreiber [wmdb] wrote:
> Check conditions.
> You can do numerous cool things with them.
> 
> Example:
> [globalVar = TSFE:id = 10]
> page.includeCSS = fileadmin/templates/myOtherCssFile.css
> [end]
> 
> This works, but only on your page with the ID 10.
> If an editor changes the UID (by deleting and re-creating the page) your 
> condition wil (of course) not work.
> 
> So you could use something like this:
> [globalVar = TSFE:page|layout = 1]
> page.includeCSS = fileadmin/templates/myOtherCssFile.css
> [end]
> 
> This would make the CSS load whenever the layout switch in the page 
> header is set to "Layout 1".
> 
> What if you have used the layout switch already?
> Build an extension with the kickstarter that adds a new field to the 
> table "pages" and make it of the type "checkbox".
> 
> In the pageheader you will have a checkbox then (sounds clear, I guess).
> Then modify your condition:
> [globalVar = TSFE:page|tx_myExtension_fieldname = 1]
> page.includeCSS = fileadmin/templates/myOtherCssFile.css
> [end]

This all works but is not appropriate for my case. I need to add a 
<style>little css</stile> in the header of a single page. I think there 
is a more suitable way to do this than create an entire css file and 
modify the root template. Is there a way to do it with an extension 
template or page header template?



More information about the TYPO3-english mailing list