1
justtupeu
Multiple CSS posible ?
  • 2005/7/1 20:37

  • justtupeu

  • Just popping in

  • Posts: 78

  • Since: 2005/6/7 8


I want to make a module use it's own separate css, different from the style.css in the theme folder.. How can i implement that ?
Vineri triskaideka - contest for Vineri triskaideka phrase

2
mrjingles
Re: Multiple CSS posible ?
  • 2005/7/1 22:42

  • mrjingles

  • Just popping in

  • Posts: 22

  • Since: 2004/11/10


I am not entirely sure of the best way to do this but here is one way :

Keep the one style.css sheet but make new entries for the stylesclasses that you would like to use in the different module.

You can then update the templates for that particular module (System - Templates from the Admin screen) and change the class references to the new ones you entered in the style.css.

3
tl
Re: Multiple CSS posible ?
  • 2005/7/1 23:06

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


You may want to take a look at this TIP

http://xoops-tips.com/news-article.storyid-89-page-1.htm
Xoops Tips - Tip It and Use It

4
justtupeu
Re: Multiple CSS posible ?
  • 2005/7/1 23:17

  • justtupeu

  • Just popping in

  • Posts: 78

  • Since: 2005/6/7 8


Quote:

<{php}>
$mod = $GLOBALS['xoopsModule'];
$dirname = (isset($mod) ? $mod->getVar('dirname') :'system');
if ($dirname =='liaise') {
$this->assign('xoops_themecss', XOOPS_URL.'/themes/red/style-l.css');
} else {
$this->assign('xoops_themecss', XOOPS_URL.'/themes/red/style.css');
}

<{/php}>

So i must enter this part of code right at the top of the theme.. nothing above it ?
And must i make some modification to the script, or shall i leave it as is ?
Vineri triskaideka - contest for Vineri triskaideka phrase

5
tl
Re: Multiple CSS posible ?
  • 2005/7/1 23:22

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


Quote:
So i must enter this part of code right at the top of the theme.. nothing above it ?

yes

Quote:
And must i make some modification to the script, or shall i leave it as is ?

This is just an example, so you will have modify to fit your own situation.
Xoops Tips - Tip It and Use It

6
justtupeu
Re: Multiple CSS posible ?
  • 2005/7/1 23:27

  • justtupeu

  • Just popping in

  • Posts: 78

  • Since: 2005/6/7 8


Sorry, i'm not so familiar with this and i can't just figure it out what exactly to modify..
I guess only liaise, /themes/red/style.css, and /themes/red/style-1.css.. Am i right or wrong ?
Vineri triskaideka - contest for Vineri triskaideka phrase

7
tl
Re: Multiple CSS posible ?
  • 2005/7/1 23:31

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


The example is about using a different style sheet, style-l.css, for liaise module - under a theme called red.

The bold highlighted are those you need to modify to fit your own situation.

[edit] please read the whole article if you are still having questions [/edit]
Xoops Tips - Tip It and Use It

8
justtupeu
Re: Multiple CSS posible ?
  • 2005/7/1 23:33

  • justtupeu

  • Just popping in

  • Posts: 78

  • Since: 2005/6/7 8


Ok thanks.. Got it ;)
Vineri triskaideka - contest for Vineri triskaideka phrase

9
rowdie
Re: Multiple CSS posible ?
  • 2005/7/2 6:35

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


To make a module use it's own css file you just need to add one line to the php page:

$xoopsTpl->assign("xoops_module_header""<link rel='stylesheet' type='text/css' href='[url to the css file]'/>");


Putting php in the theme is unneccessary.

10
justtupeu
Re: Multiple CSS posible ?
  • 2005/7/2 18:46

  • justtupeu

  • Just popping in

  • Posts: 78

  • Since: 2005/6/7 8


Would you mind giving more details ?
Quote:
$xoopsTpl->assign("xoops_module_header", "<link rel='stylesheet' type='text/css' href='[url to the css file]'/>");

So this code must be included in the index.php of the module ? Does it matter where ?
And if i want a module to use the default style.css in the theme's folder, i would just leave the file as is ?
Vineri triskaideka - contest for Vineri triskaideka phrase

Login

Who's Online

163 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 163


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits