Table of Contents

Modules

Include FE custom CSS/JS in a module

To get css or js files included in the frontend output (in the head) of your module add them to your code like:

Docu:
Forum: How to include custom CSS in module

Autor: breitsch
CMS-Version: >= V1.3.0
Version:(2009/02/21)
Update:

Condition:/config/phpwcms/conf.inc.php




// load js functions
$block['custom_htmlhead']['javascript.js'] = '  <script src="'.$phpwcms['modules'][$crow['acontent_module']]['dir'].'template/js/javascript.js" type="text/javascript"></script>';
  //load inline css
$block['custom_htmlhead']['inlinecss.css'] ='<style type="text/css">'.LF.'  .classname  {property:value;}'.LF.'</style>';
  //load external style sheet
$GLOBALS['block']['custom_htmlhead']['externalcss.css'] = LF.'  <style type="text/css">'.LF.'@import url("'.$phpwcms['modules'][$crow['acontent_module']]['dir'].'template/css/externalcss.css");'.LF.'</style>';

last key of the $block array must be unique!

Include BE custom JS in a module

$BE['HEADER'][] = getJavaScriptSourceLink('include/inc_js/optionselect.js');