grayson Posted April 12, 2005 Share Posted April 12, 2005 First: Many thanks for a very nice contribution. This post contains a simple modification to the categories_subtab.php file in this contribution, to highlight the subcategory currently being viewed. Background: Since I removed the categories box and the breadcrumb trail after adding this tabs contribution, I also wanted to have the current subcategory highlighted, so the visitor can still easily see where he/she is in the site. I searched to see if someone had already come up with a solution, but didn't find anything. Turns out it's a much simpler fix than I had envisioned -- in fact, it's the same trick that highlights the current subcategory in the original categories box in categories.php. To add highlighting in the subcategory bar, in the file [store path]/includes/categories_subtab.php, replace (around line 27): // display category name $subcategories_string .= $fooa[$counter]['name']; with if ( ($id) && (in_array($counter, $id)) ) { $subcategories_string .= "<b>"; } // display category name $subcategories_string .= $fooa[$counter]['name']; if ( ($id) && (in_array($counter, $id)) ) { $subcategories_string .= "</b>"; } That's all there is to it! Regards, --Grayson Quote Grayson Morris Link to comment Share on other sites More sharing options...
itsjust Posted March 9, 2008 Share Posted March 9, 2008 Magic! Thanks a million for that! Quote Link to comment Share on other sites More sharing options...
itsjust Posted March 9, 2008 Share Posted March 9, 2008 Just took this a step further so you can use the css styles on it What i did was to change the $subcategories_string .= '" class="subNavigation">'; to if ( ($id) && (in_array($counter, $id)) ) { $subcategories_string .= '" class="subNavigation2">'; }else{ $subcategories_string .= '" class="subNavigation">'; } And then of course make the nesasary css class in the stylesheet: A.subNavigation2 { color: #FF0000; } A.subNavigation2:hover { color: #DD0000; text-decoration:none; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.