View Single Post
  #1  
Old 07-20-2014, 05:21 PM
 
pgailinas pgailinas is offline
 

Member
  
Join Date: Jul 2014
Posts: 13
 

Default Different background color for each category

I would like to have a different background color for each category page. I need a bit of help though. I thought about two different methods as follows:

Method 1 -- Modify the file classes/XLite/View/controlled.php (function defineBodyClasses) to place a new class into the body declaration (such as cat_12_bg and cat_15_bg) and then define those classes to have the appropriate background colors in the custom css section.

Method 2 -- Create a substitute copy of skins/default/en/main.tpl and place it into skins/custom_skin/default/en/main.tpl. Again, here, the classes would be specified in a <div> and defined in the custom css as previosly described.

I think Method 2 is preferred. In either case, I need to have code to recognize the current category. Method 1 requires php code while Method 2 requires Smarty code.

Now, the problem I have is I don't know how to find what global variable or method to call to identify the category. I have seen some similar code for this in the forums but it appears to apply to versions of X-Cart prior to version 5.

So, anyone got some guidance for this please? Thanks!
__________________
XC 5.1.4
Reply With Quote