Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 08:32:47 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155482 Posts in 21708 Topics by 7733 Members
Latest Member: himagain
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: different stylesheet for each group?  (Read 627 times)
Aaaarco

Offline Offline

Posts: 25


« 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
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« 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

*weg*
Aaaarco

Offline Offline

Posts: 25


« 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
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4884



« Reply #3 on: March 11, 2009, 05:21:21 PM »

Hello, you will need the GroupID (number) rather than the group name.

href="'.TEMPLATE_DIR.'/group'.$thegroup.'.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

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!