[TYPO3-english] SOLUTION for dynamic virtual css file - Re: remove page.headerData to virtual/real file

Katja Lampela katja.lampela at lieska.net
Sun Jan 20 08:03:02 CET 2013


Hi and again thank you very much Philipp!

It is times like these I really appreciate - besides your help - ts and its power, it is amazing what you can do with it :)


This is the ts combination I use:


CONSTANTS:

# cat=texttypes//b; type=options[Andale Mono,Trebuchet MS,Verdana,Tahoma,Arial,Arial Black,Arial Narrow,Impact,Times,Courier,Georgia,Comic Sans MS,Fantasy,Wingdings,serif,sans-serif]; label=H1-font: Arial,Times,Courier,serif,sans-serif etc. Web-safe fonts
h1_font = Arial
# cat=texttypes//b; type=string; label=H1 size:
h1_fontsize = 28px
# cat=texttypes//b; type=color; label=H1 color:
h1_color = #000000
# cat=texttypes//b; type=options[bold,normal]; label=H1 weight:
h1_fontweight = normal
# cat=texttypes//b; type=string; label=H1 margin:
h1_margin = 0px 0px 10px 0px
# cat=texttypes//b; type=string; label=H1 extra properties:
h1_x =


SETUP:

css = PAGE
css {
    typeNum = 22
    config {
       additionalHeaders = Content-type: text/css
       disableAllHeaderCode = 1
    }
    10 = TEXT
    10.value (
       @charset "utf-8";
       /* CSS Document */
           /*basic*/
           h1, h1 a {font-family:"{$h1_font}";font-size:{$h1_fontsize};color:{$h1_color};font-weight:{$h1_fontweight};margin:{$h1_margin};{$h1_x};}
    )
}

and into main page object

page {
    headerData {
       16 = TEXT
       16.dataWrap = <link rel="stylesheet" type="text/css" href="index.php?id={field:uid}&type=22" />
    }
}


20.1.2013 6:47, Katja Lampela kirjoitti:
> Hi Philipp,
>
> 19.1.2013 19:48, Philipp Gampe kirjoitti:
>
>> You can create a new page type, disable all output (disableHeaderData = 2)
>> and just print a CSS file.
>> You can then include the link to the page type like any CSS file and you can
>> use the full power of TypoScript to generate the CSS.
>
> Great, thank you!!
>
>


-- 
With kind regards

Katja Lampela
*Lieska-tuotanto*
www.lieska.net



More information about the TYPO3-english mailing list