[TYPO3] Parsing CSS files - is it possible?
Johannes Reichardt
typo3 at gramba.de
Wed May 24 00:26:42 CEST 2006
Hi JoH,
as a contrary comment on this: I don´t like that solution. It may work
but its quite complex and a good example of that kind of code that
prevents many gifted programmers (i sadly know) and designers from
learning/using typo3 because its not intuitive and no way direct. But
thanx for showing the power of typoscript ;)
- Johannes
> 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}&type=123" />
>> }
>>
>> myDynamicCSS = PAGE
>> myDynamicCSS {
>> typeNum = 123
>> config {
>> disableAllHeaderCode = 1
>> additionalHeaders = Content-type: text/css
>> admPanel = 0
>> }
>> #Your Stylesheet setup here
>> }
>>
>> Joey
>>
>>
>
>
>
More information about the TYPO3-english
mailing list