[TYPO3] Parsing CSS files - is it possible?

ben van 't ende [netcreators] ben at netcreators.nl
Tue May 23 22:22:40 CEST 2006


JoH wrote:
>> Is it possible to parse a CSS file and replace some parts of it like
>> with a template file?
>> I mean, I'm trying to attach a CSS file for an extension, but inside
>> the file there is a background-image declaration and the image path
>> should be changed depends on where the extension is installed
>> (relatively to the site path).
>> Is it possible?
> 
> As a preview of the upcoming TYPO3 cookbook you might want to try this ;-)

Hey JoH,

Fantastic solution, but isn't the book supposed to be called TYPOdrei
kuchbuch ;-) Will have to brush up my german. Didn't read any since
"Also sprach Zarathustra"

grusse

ben

> page.headerData.100 = COA
> page.headerData.100 {
>     wrap = <style>|</style>
>     10 = TEMPLATE
>     10 {
>         template = FILE
>         template.file = /path/to/your/cssfile.css
>         marks {
>             BACKGROUNDIMAGE = IMG_RESROURCE
>             BACKGROUNDIMAGE {
>                 # your image definition here
>             }
>         }
>     }
> }
> 
> You just have to insert the marker ###BACKGROUNDIMAGE### into your css file.
> 
> It is even possible to include the CSS file by using another typeNum for the
> generation, but you should only use the dynamic parts in this one while
> keeping the rest in a static file, since those dynamic sheets have to be
> generated for each page separately.
> 
> page.headerData.100 = TEXT
> page.headerData.100 {
>       dataWrap = <link rel="stylesheet" type="text/css"
> href="index.php?id={TSFE:id}&amp;type=123" />
> }
> 
> myDynamicCSS = PAGE
> myDynamicCSS {
>     typeNum = 123
>     config {
>         disableAllHeaderCode = 1
>         additionalHeaders = Content-type: text/css
>         admPanel = 0
>     }
>     #Your Stylesheet setup here
> }
> 
> Joey
> 


-- 
netcreators::creation and innovation
www.netcreators.com -  www.typo3.nl





More information about the TYPO3-english mailing list