[TYPO3-dev] Dynamically load TS/CSS/JS/HTML based on the new backend layout

Franz Koch typo3.RemoveForMessage at elements-net.de
Sat Mar 19 11:06:05 CET 2011


Hey Thomas,

...
> This way quite easy, because I just could use the
> constants to get my desired files:
>
> page.includeCSS {
> layoutFile = css/{$application.template.layout}.layout.css
> }
>
> So I didn't need any conditions and could just use
> a single line to include any configured layout.
>
> As for now, the layout is set dynamically, based on
> the backend layout field, and unfortuately I can't
> use this technique anymore.

You can still use this concept, but you would need to use a hook. There 
is one that's called while compiling the TS (there are two actually, one 
at the beginning and one at the and). You would need to use that hook 
and add the needed TS file includes (just point to a folder having a 
setup.txt and/or a include_static.txt), snippets and constants there. 
For inspiration on how to use this hook just have a look at Rons 
"templavoila_framework" where he does the same but only for TV. It's 
really easy.

I do something quite similar using this hook. In my case I have 
multidomain setup where users additionally to the page layouts (1-3 
columns) can choose their overall theme. This is working just fine, but 
is still in development and needs to be improved.

-- 
kind regards,
Franz Koch




More information about the TYPO3-dev mailing list