Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Different skins for admin and customer

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-31-2005, 06:58 AM
 
jkk jkk is offline
 

Member
  
Join Date: Mar 2005
Posts: 15
 

Default Different skins for admin and customer

Hi -

I am relatively new to X-Cart, but not to PHP. I would like to have 2 different skins on the site that I'm working on - one for administrators and one for customers to see. Basically, I want to keep the administrator login page to have one of the generic skins that comes with X-Cart and I want to use a custom skin/CSS/etc. for customer viewing only.

The reason I want to do this is for simplicity. The site I'm working on is heavily customized, and I don't want to modify all of the CSS definitions and graphics to do both the admin as well as the customer pages. With a single images directory, I have ended up with graphics that look great from a customer perspective, but terrible from an admin perspective (as it's a conglomeration of 2 different color combos) - and I also don't feel like going through and hand-editing all of the template files to track down all of the images.

I was thinking about making 2 different smarty.php - each one defining a different skin directory - and then changing the auth.php in the admin directory to point to the right smarty.php. Is this the proper way for doing this? Will this catch all administrator pages? Do I need to specify a different templates_c and cache directory with 2 different skins on the same site?

Does this make sense? Has anyone done this before?

Thanks

-jkk
__________________
X-Cart Gold 4.0.14
X-AOM 4.0.14
X-GiftReg 4.0.14
Reply With Quote
  #2  
Old 03-31-2005, 07:08 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Admin is single/home.tpl and skin1_admin.css. You can do quite a lot by just changing those two files.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 03-31-2005, 07:12 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default

put an IF statement in the template files like this

eg for menu.tpl

Code:
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode ne "")} put your admin style menu code here {else} put your customer style menu code here {/if}

You can use this method throughout the templates that are shared between admin and customer.

From v4, admin and customer have different stylesheets.
__________________
xcartmods.co.uk
Reply With Quote
  #4  
Old 03-31-2005, 09:03 AM
 
jkk jkk is offline
 

Member
  
Join Date: Mar 2005
Posts: 15
 

Default

Quote:
Originally Posted by PhilJ
put an IF statement in the template files like this

eg for menu.tpl

Code:
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode ne "")} put your admin style menu code here {else} put your customer style menu code here {/if}

You can use this method throughout the templates that are shared between admin and customer.

From v4, admin and customer have different stylesheets.

Yeah, I figured I could do that, but I'm attempting to avoid touching every single file. I also thought about copying out all of the modules and everything that the customer referenced and putting it in the customer directory, but again, that's a lot of work that I'd like to avoid - plus it makes putting on modules a little more difficult.

I'm guessing that there is no easy way to do this past track down all of the files. Is that correct? If I'm going to modify all of the templates that only a customer sees, they're all referenced out of the customer directory, right?

Thanks.

-jkk
__________________
X-Cart Gold 4.0.14
X-AOM 4.0.14
X-GiftReg 4.0.14
Reply With Quote
  #5  
Old 03-31-2005, 09:11 AM
 
jkk jkk is offline
 

Member
  
Join Date: Mar 2005
Posts: 15
 

Default

Oh, here's an idea...

Is there any way that I can find out what the user type is during the processing of smarty.php? If so I specify a different value of ImageDir depending on if it was a customer or an admin logging in.

-jkk
__________________
X-Cart Gold 4.0.14
X-AOM 4.0.14
X-GiftReg 4.0.14
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:29 AM.

   

 
X-Cart forums © 2001-2020