NAVIGATION
This is an old revision of the document!
Um in der Frontendausgabe CSS oder JS Dateien (Im Headbereich) in das Modul zu bringen kannst du folgendes Schnipsen zum deinem Code hinzufügen.
Docu: –
Forum: How to include custom CSS in module
Autor: breitsch http://web.casa-loca.com/
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>';
Der letzte Schlüssel der Arrays $block muss einzigartig sein!
$BE['HEADER'][] = getJavaScriptSourceLink('include/inc_js/optionselect.js');
Festlegen vom Parametern für die Moduleinbindung in “include/inc_module/mod_xxxx/module.default.php”:
// Module/Plug-in Glossary // register module name //DO NOT USE SPECIAL CHARS HERE, NO WHITE SPACES, USE LOWER CASE!!! $_module_name = 'glossary'; // module type - defines where used // 0 = BE and FE, 1 = BE only, 2 = FE only $_module_type = 0; // Set if it should be listed as content part // has content part: true or false $_module_contentpart = true; // simple switch to allow fe render or fe init $_module_fe_render = true; $_module_fe_init = false; $_module_fe_search = true;
In der Datei include/inc_lib/default.php werden die folgenden drei Variablen initialisiert:
$phpwcms['modules'] = array(); $phpwcms['modules_fe_render'] = array(); $phpwcms['modules_fe_init'] = array();
In der Datei “include/inc_lib/modules.check.inc.php” werden alle Module in das Array $phpwcms['modules'][] aufgenommen.
Durch die Angaben in der Datei module.default.php wird entschieden ob Script in frontend_init/render ausgeführt werden sollen bzw. die Arrays
werden mit den jeweiligen Links zu den Dateien gefüllt.
In der Datei “include/inc_front/content.article.inc.php” werden die Moduldateien “include/inc_module/inc/cnt.article.php” aus dem Array $phpwcms['modules'][] includiert.
In der Datei “include/inc_front/content.func.inc.php” werden alle frontend_init/render Scripte aus den Arrays $phpwcms['modules_fe_init'][] und $phpwcms['modules_fe_render'][] includiert.