Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / I need help with styling a selected category.

I need help with styling a selected category.

Views: 653

Results 1 to 3 of 3
15 Feb 2012, 8:28 PM
#1
kakapeh avatar

kakapeh

New Zenner

Join Date:
Feb 2012
Posts:
4
Plugin Contributions:
0

I need help with styling a selected category.

Hey guys,

I'm currently in the process of tweaking a template I recently purchased.

It's this one :

http://osc4.template-help.com/zencart_32720/

If you note, whenever you hover over a category it turns green. Now I would like this to persist if the user selects that particular category.

I have an idea of what I need to do but I'm lost looking at this code. I'd like to have the list item (li) of the selected category to have a custom css class so I can style it.

This is the code taken from tpl_categories.php :

http://pastebin.com/2SHWBax9

If anyone can help I'd greatly appreciate it.

TIA

15 Feb 2012, 10:08 PM
#2
kakapeh avatar

kakapeh

New Zenner

Join Date:
Feb 2012
Posts:
4
Plugin Contributions:
0

Re: I need help with styling a selected category.

I've found a temporarily solution.

I could see the following :

     $content .= '<span class="category-subs-parent">' . $box_categories_array[$i]['name'] . '</span>'; 
    } else { 
      $content .= '<span class="category-subs-selected">' . $box_categories_array[$i]['name'] . '</span>'; 

I added those classes into the CSS and that allowed me to style the hyperlinks at least. :clap:

15 Feb 2012, 10:18 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: I need help with styling a selected category.

That's what those classes are there for:)
The code in that version of tpl_categories gives a fake <ul> - all levels of subcategories are equal <li>s in the one <ul>. If you really want to style the categories sidebox fully, you can use Categories Dressing from Free Addons.