Forums / Templates, Stylesheets, Page Layout / URGENT! How to change background based on user group?

URGENT! How to change background based on user group?

Locked

Views: 1,189

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
20 Apr 2010, 7:37 AM
#1
rogdov avatar

rogdov

New Zenner

Join Date:
Apr 2010
Posts:
12
Plugin Contributions:
0

URGENT! How to change background based on user group?

My client want different background for each user group. I'm going to a meeting with this client later today... in other words... this is urgent!

How is this done?

20 Apr 2010, 8:06 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: URGENT! How to change background based on user group?

You would need to add the background image as an inline style to the body tag and then write and add some code to run on every page to populate determine the user group and embed the link to the appropriate image into the inline style.

You'd do the first step by overriding common/tpl_main_page.php file with your changed version, and the second step by overriding the init_includes/init_customer_auth.php file, which is where your site already pays some attention to the type of customer you have.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

20 Apr 2010, 8:33 AM
#3
rogdov avatar

rogdov

New Zenner

Join Date:
Apr 2010
Posts:
12
Plugin Contributions:
0

Re: URGENT! How to change background based on user group?

Is it possible to use different stylesheets. Put in a code to make the system check which user group is logged in and change the stylesheet reference according to the group?

20 Apr 2010, 8:51 AM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: URGENT! How to change background based on user group?

You could. In that case your template override would be of the html_includes.php file.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

20 Apr 2010, 9:06 AM
#5
rogdov avatar

rogdov

New Zenner

Join Date:
Apr 2010
Posts:
12
Plugin Contributions:
0

Re: URGENT! How to change background based on user group?

kuroi:

You could. In that case your template override would be of the html_includes.php file.

Do you have a "quick" and easy code that will do this?

20 Apr 2010, 9:09 AM
#6
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: URGENT! How to change background based on user group?

'fraid not. Never tried to do this before, and it would depend on the specific criteria your client wanted to apply anyway.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

20 Apr 2010, 9:30 AM
#7
rogdov avatar

rogdov

New Zenner

Join Date:
Apr 2010
Posts:
12
Plugin Contributions:
0

Re: URGENT! How to change background based on user group?

kuroi:

'fraid not. Never tried to do this before, and it would depend on the specific criteria your client wanted to apply anyway.

My client actually just want another background color for the different groups.

Could it be a code like "if usergroup = none { stylesheet.css } else { stylesheetgroup.css }"

Not exactly a working code, but I hope you see what I'm trying to do.

20 Apr 2010, 9:57 AM
#8
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: URGENT! How to change background based on user group?

That would over complicate it, as you'd be messing with the main stylesheet.

If you want to make this a whole stylesheet just to change the background colour, it would be better to have a stylesheet with that single line in.

The complexity though is in how you assign a value to usergroup to begin with.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

20 Apr 2010, 10:36 AM
#9
rogdov avatar

rogdov

New Zenner

Join Date:
Apr 2010
Posts:
12
Plugin Contributions:
0

Re: URGENT! How to change background based on user group?

Thanks. I think I got it now. If not.... I'll be back :-)