{{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]]
\\
- 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
\\
- Loading More Components:
\\
- And the best now is multi line JavaScript put as in head section.
Be aware – every equal JavaScript section like used in looped Content Parts is rendered only once. \\
To be detected as JavaScript it will need ##%%;%%##, ##%%//%%## und/oder ##%%/*%%##. \\
Just end your JavaScript line by ##%%;%%## is the safest way:
\\
\\
===== Module's area =====
Forum: [[http://forum.phpwcms.org/viewtopic.php?p=113969#p113969]] (breitsch)
To get css or js files included in the frontend output (in the head) of your module add them to your code like:
// load js functions
$block['custom_htmlhead']['javascript.js'] = ' ';
//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!