Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

InfoBox Category and Subcategory Link Color


mwgsr

Recommended Posts

Posted

Hi,

 

For the category infobox I want my Main Category Links to display a different color then my subcategory Links. Can any one help me out real quick on this one.

 

Thanks,

 

Mike. :thumbsup:

Posted

Open catalog\includes\boxes.php and find function tep_show_category()

Now for each entry there is a link that is generated with <a href= ......</a> tags. Setup a couple of classes in your .css file for the colors you need then insert the class="mynewcolor1" in the <a> tag after the link is instantiated. ie this line

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

will become

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '" class="mynewcolor1">';

 

and finally place some code to check for the category_id. If its 0 use class with color1 else color2.

Posted

see the $tree[$counter]['level'] array in that function. When its value is 0 is a top category therefore you deploy color1 else color2.

Posted

Got it, thanks.

 

Just incase anyone else needs to know how to do it:

 

//Added for color mod
if($tree[$counter]['level'] == '0') { //Top cat
 $cat_class = 'mainCat';
} else {  //Sub cat
 $cat_class = 'subCat';
}

 

:thumbsup:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...