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

Different colors for different VertMenu boxes

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-15-2004, 09:20 PM
 
AFA AFA is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 31
 

Default Different colors for different VertMenu boxes

How would I go about making the different verticle menu boxes and title areas different colors? As in.... categories box is blue, but help box is green, just as an example.
Thanks.
Tina
Reply With Quote
  #2  
Old 12-16-2004, 09:47 AM
 
balinor balinor is offline
 

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

Default

Hi Tina. There are a couple ways to do this that I know of.

The first method would be to write an {if} statement that calls a different style for each different menu. This requires some knowledge of how Smarty tags work, but would be less code in the long run.

The second method would be to create a different copy of menu.tpl and different styles for each different menu style you want (more code, less complicated).

I can walk you through the second method, but the first method will require some help from one of the Smarty gurus around here

Also, if you could put your X-Cart version number in your signature, it will help us help you better. Thanks!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 12-16-2004, 11:47 AM
 
AFA AFA is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 31
 

Default

That would be great. I'd appreciate any help.

Added my version to my signature.
Tina
Reply With Quote
  #4  
Old 12-16-2004, 11:50 AM
 
AFA AFA is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 31
 

Default

Or, I thought I had added it....
Reply With Quote
  #5  
Old 12-16-2004, 12:21 PM
 
balinor balinor is offline
 

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

Default

Ok, here we go. By default, each of the side menus is using the same template: menu.tpl and the same set of styles: VertMenuBox, VertMenuBorder, etc.

The first step is to create all the different styles you want - I tend to name them so that I can keep track of them - HelpMenuBox for example. Set all of those up in your Skin1.css file.

Next, you will need to create a duplicate of menu.tpl for each different style you want to use. Let's use the help menu as an example. Go to edit templates and scroll down to where it says 'Create New File'. Type help-menu.tpl in the box and hit the create button.

Now open the menu.tpl file and copy the contents. Cancel out without saving and then open the file you just created (help-menu.tpl) and paste the contents in the empty box.

Change the styles to the styles you want. For example, if you want to change the background of the menu box itself, you would replace this:

Code:
<TD class="VertMenuBox">

with this:

Code:
<TD class="HelpMenuBox">

Repeat this for whichever styles you want to change, and then hit Save.

Now you need to make sure the help menu actually uses your new template. Go to Edit templates and click on help.tpl. Scroll down towards the bottom. Replace this:

Code:
include file="menu.tpl"

with this:

Code:
include file="help-menu.tpl"

Click Save. You are done! The help menu should now take on the style you defined for it in the skin1.css file.

Repeat this for each of the boxes you want to appear differently. The .tpl files for each of the boxes are:

News - news.tpl
Authentication box - auth.tpl & authbox.tpl
Help - help.tpl
Categories - customer/categories.tpl
Special - customer/special.tpl
Users Online - /modules/Users_online/menu_users_online.tpl
Your Cart - /customer/menu_cart.tpl

As I said, the Smarty tag method would be a lot less code, but this really isn't that bad once you get the hang of it. Good luck!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 12-16-2004, 09:29 PM
 
AFA AFA is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 31
 

Default

Thank you!! That worked great. I really appreciate your help.
Tina
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 07:52 PM.

   

 
X-Cart forums © 2001-2020