WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • different stylesheet for each group?
  • Print
Pages: [1]   Go Down

Author Topic: different stylesheet for each group?  (Read 4197 times)

Offline Vlob

  • Posts: 106
different stylesheet for each group?
« on: March 11, 2009, 04:05:20 PM »
I want to use a different look for a site for each usergroep

is it possible to use the name of the usergroup as selector for the stylesheet...

something like

<link href="<?php echo TEMPLATE_DIR; ?>/[GROUP]/style.css" rel="stylesheet" type="text/css" />

in stead of

<link href="<?php echo TEMPLATE_DIR; ?>/style.css" rel="stylesheet" type="text/css" />

in which I make sure the needed css files are present

for instance
usergroups:
- group1
- group2

and in the templatefolder:

group1(folder)/style.css

+

group2(folder)/style.css
Logged

chio

  • Guest
Re: different stylesheet for each group?
« Reply #1 on: March 11, 2009, 04:12:43 PM »
<?php
$thegroup = 'none';
if ($wb->is_authenticated()) { $thegroup = $wb->get_group_id(); }
echo  '<link rel="stylesheet" type="text/css" href="'.TEMPLATE_DIR.'/group'.$thegroup.'.css"  />';
 ?>

EDIT: Sorry, I forgot a bracket
« Last Edit: March 11, 2009, 04:54:25 PM by chio »
Logged

Offline Vlob

  • Posts: 106
Re: different stylesheet for each group?
« Reply #2 on: March 11, 2009, 04:40:26 PM »
thank you

just tested it and I get a blanc page.. any suggestions



<?php
$thegroup = 'none';
if ($wb->is_authenticated() { $thegroup = $wb->get_group_id(); }
echo  '<link rel="stylesheet" type="text/css" href="'.TEMPLATE_DIR.'/group'.$thegroup.'.css"  />';
 ?>

I created a testgroup called test and a test.css and put it in a folder 'group' in de template folder
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: different stylesheet for each group?
« Reply #3 on: March 11, 2009, 05:21:21 PM »
Hello, you will need the GroupID (number) rather than the group name.

href="&#39;.TEMPLATE_DIR.&#39;/group&#39;.$thegroup.&#39;.css" 
this means, that your css file is inside the template folder
and the name of your CSS File beginns with "group".

It should be something like group02.css

Hope this helps.

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • different stylesheet for each group?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2