How to include custom CSS in module
How to include custom CSS in module
High!
Does anybody know how to include a module specific style sheet in a module. For use with the front end templates.
Example,
I have a module that shows information from PHPWCSM, but i want to include a stylesheet relevant to the templates of that module.
So i make a css folder in my module/template directory, add a css file, but ghow do i include them in my template properly (= according to O.G.'s way of scripting)
please advise.
Julius
Does anybody know how to include a module specific style sheet in a module. For use with the front end templates.
Example,
I have a module that shows information from PHPWCSM, but i want to include a stylesheet relevant to the templates of that module.
So i make a css folder in my module/template directory, add a css file, but ghow do i include them in my template properly (= according to O.G.'s way of scripting)
please advise.
Julius
A website is a concept not a digital brochure ! Vectrus Internet Solution
Re: How to include custom CSS in module
Put something like the following into your template:
In this example the css file is living in /template/inc_css/specific/
I think that this should work for you also (like it's working for me )
Code: Select all
[PHP]
$GLOBALS['block']['css']['reg_tabs_accordion01_login'] = 'specific/reg_tabs_accordion01_login.css';
[/PHP]
I think that this should work for you also (like it's working for me )
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Re: How to include custom CSS in module
That would work for normal tempates, in normal content parts. Not in module templates. I f you would do that in a module, you would always end up placing the css file in the normal template/inc_css directory. I would like to NOT touch the phpwcms core in the module but rather include the css file in the modules template directory. like in :
/include/inc_module/mod_fe_userdetails/templates/css/style.css
Julius
/include/inc_module/mod_fe_userdetails/templates/css/style.css
Julius
A website is a concept not a digital brochure ! Vectrus Internet Solution
Re: How to include custom CSS in module
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Re: How to include custom CSS in module
Uuooh - you are right... I didn't read that your question does deal with a module
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Re: How to include custom CSS in module
Claus you were close.
to get css or js files included in the frontend output (in the head) of your module add them to your code like:
last key of the $block array must be unique!
to get css or js files included in the frontend output (in the head) of your module add them to your code like:
Code: Select all
// 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>';
Re: How to include custom CSS in module
That's great! I've been looking for that for days now for my forum integration (fiddled together some workaround by now) - will check it out! Thanks!
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Re: How to include custom CSS in module
S H I ....
I didn't see this. VERY nice.
I didn't see it because of the work on mod_userdetails, but now i see it, so now i am still not done with the module. =>
I didn't see this. VERY nice.
I didn't see it because of the work on mod_userdetails, but now i see it, so now i am still not done with the module. =>
A website is a concept not a digital brochure ! Vectrus Internet Solution