[TYPO3-english] How to Inclue Javascript files Based on template Layouts
Peter Russ
peter.russ at 4many.net
Mon Mar 29 07:55:42 CEST 2010
--- Original Nachricht ---
Absender: Moses Dinakaran
Datum: 29.03.2010 07:21:
> Hi all,
>
>
>
> How to include Javascript based upon template layouts, My site has two and
> three column layouts and I am including the following js
>
>
>
> page{
> includeJS {
>
> file1 = fileadmin/template/js/main.js
> file2 = typo3conf/ext/jquery/src/jquery.js
> file3 = typo3conf/ext/jquery/plugins/jquery.validate.js
> file4 = typo3conf/ext/jquery/plugins/jquery.form.js
> ....
> }
> }
>
> Right now these js are included in both the Layouts which need to be
> restricted,
>
> Say if the page is using 2 column include only file1, if the page is using 3
> column layout include all js
>
>
>
> I am using the template selector to choose the layouts.
>
>
>
> plugin.tx_rlmptmplselector_pi1.templateObjects.main{
> 10 < temp.threeColumnTemplate
> 20 < temp.twoColumnTemplate
> }
see
http://typo3.org/extensions/repository/view/fdfx_yaml/current/info/ext_localconf.php/
function tx_fdfxyaml_userMatch($template)
and
http://typo3.org/extensions/repository/view/fdfx_yaml/current/info/ext_typoscript_setup.txt/
e.g.
[userFunc = tx_fdfxyaml_userMatch(h-123_abb-f.html)]
...
[end]
Enjoy.
--
docendo discimus
_____________________________
uon GbR
http://www.uon.li
http://www.xing.com/profile/Peter_Russ
More information about the TYPO3-english
mailing list