[TYPO3-core] RFC: #9149: Additional Stylesheets in template.php
Benjamin Mack
benni at typo3.org
Fri Aug 29 23:29:05 CEST 2008
Hey all,
I thought about the whole thing. I does not make sense to have an extra
function for this, that is similar to the loadJSlib function:
* Unlike JS libraries, a lot of extensions (most of them, skins) want to
overwrite the default stylesheets.
* The whole thing is a bit limited right now in template.php with
$stylesheet, $stylesheet2 and $post_stylesheet. Basically, we'd need an
assoc. array for that. You fill in the files you need and can also
override std files. Once you compile the output, you process the array
and fill in the backPath at that point. This way, we can even use that
array in the constructor.
I already created a patch and sent it to Steffen some weeks ago. I hope
he can send in the patch here (after he tweaked it) and we can discuss
it here again.
--
All the best,
benni.
-SDG-
Martin Kutschker wrote:
> Steffen Kamper schrieb:
>> Benjamin Mack schrieb:
>>> Hey Steffen,
>>>
>>> very nice work!
>>>
>>> Some things:
>>>
>>> 1. I'd like to have an interface similar to loadJavascriptLib() called
>>> "addStylesheet()". What do you think? (It's just an idea) :)
>>>
>>> 2. could we make it so that styleSheetFile1 and styleSheetFile2 are
>>> merged to that new array so that we can phase these variables out
>>> (maybe set them to deprecated and rewrite e.g. t3skin to use the new
>>> interface). What do you think?
>>>
>>> greetings from Montana :)
>>> benni.
>>> -SDG-
>>>
>> Hi Urlauber :-)
>>
>> good idea. I modified the patch so you add CSS files in the same mannar
>> like JSFiles:
>> $this->doc->loadCSSfile('contrib/extJS/resources/css/ext-all.css');
>>
>> In template there is a check to prevent double include.
>>
>> For stylesheet and stylesheet2 I added a special parameter, so they will
>> be included befor the other ones.
>>
>> To force a stylesheet to be firstposition, you can use this parameter:
>> $this->doc->loadCSSfile('contrib/extJS/resources/css/ext-all.css', true);
>>
>> new patch is attached.
>
> Looks ok, but wouldn't the
> array_merge(array("newkey"=>"newvalue"),$arrayone) trick work instead of
> the double array_reverse (which looks so odd)?
>
> Masi
More information about the TYPO3-team-core
mailing list