{{indexmenu_n>500}} ====== Script into area ====== ===== Template's area ===== Forum: [[http://forum.phpwcms.org/viewtopic.php?p=101300#p101300]] (OG) Put Mootools or any other JavaScript that might be called also from inside phpwcms into your template's head area. Always use a frontend_render script that looks like this - the script filename //(here: $block['custom_htmlhead']['...script...'])// is always used as array index: '; /* Load Mootools in newer releases < V1.4.3 r380 */ initMootools(); /* Load Mootools in newer releases >= V1.4.4 r381 */ initJSLib(); /* Load My custom JavaScript */ $block['custom_htmlhead']['my.js'] = ' '; /* or alternatively */ $block['custom_htmlhead']['my.js'] = getJavaScriptSourceLink('template/inc_js/my.js'); /* Load some other positions */ $block['custom_htmlhead']['favicon1'] = ' '; $block['custom_htmlhead']['favicon2'] = ' '; /* IE <=6 Style Hack */ $block['custom_htmlhead']['IEhack'] = ' '; /* Hm I want to overwrite some default CSS */ $block['custom_htmlhead']['mycss'] = ' '; ?> \\ **Special case CSS-file at /template/inc_css/*** In this case we can use an own array ['block']['css']. It´s home base is /template/inc_css/* . \\ E.g.: $GLOBALS['block']['css']['reg_tabs_accordion01_login'] = 'specific/reg_tabs_accordion01_login.css'; \\ ==== Since phpwcms r411: ==== Forum: [[http://forum.phpwcms.org/viewtopic.php?p=127961#p127961|…and some more too]] **Notation:** %%%% The designated spaces##%% %%## are mandatory!! \\ === CSS: === \\ - As Inline CSS: Equal CSS used this way is rendered only once and also always put into the section. \\ === JavaScript: === \\ - Integrate plugins (jQuery) e.g. using the files: * template/lib/jquery/plugin/ui-1.8.custom.min.js * template/lib/jquery/plugin/jquery.easing.min.js \\ Similarly, for MooTools: Load Plugin or More as described and based on current JavaScript framework/library. It will also render in head. - Integrate e.g. MooTools 1.2x with the files in: * template/lib/mootools/plugin-1.2/mootools.flext.js * template/lib/mootools/plugin-1.2/mootools.Quickie-yui.js \\ - Loading More Components: \\ - And the best now is multi line JavaScript put as '; //load inline css $block['custom_htmlhead']['inlinecss.css'] =''; //load external style sheet $GLOBALS['block']['custom_htmlhead']['externalcss.css'] = LF.' '; last key of the $block array must be unique!