X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Different skins for admin and customer (https://forum.x-cart.com/showthread.php?t=13124)

jkk 03-31-2005 06:58 AM

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

balinor 03-31-2005 07:08 AM

Admin is single/home.tpl and skin1_admin.css. You can do quite a lot by just changing those two files.

PhilJ 03-31-2005 07:12 AM

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.

jkk 03-31-2005 09:03 AM

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

jkk 03-31-2005 09:11 AM

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


All times are GMT -8. The time now is 11:20 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.