Jump to content

Recommended Posts

Alright, so I'm attempting to just add a CSS class to a selected category link.

I'm trying to get more familiar with the category tree (category_tree.php) and the only thing I've found that controls the selected output is the following:

$OSCOM_CategoryTree->setCategoryPath($cPath, '<strong>', '</strong>');

This, of course, just bolds the current selected category.

However, I'm just looking to do something similar to this (see the "CUSTOM_CSS_CLASS"):

<a class="list-group-item list-group-item-action CUSTOM_CSS_CLASS" href="http://mywebsite.com/catalog/index.php?cPath=3"><strong>Electronics</strong></a>

Is there a way to achieve this with any of the available functions within category tree?

Share this post


Link to post
Share on other sites

Thanks @JcMagpie

I was finally able to look at your post and I'm not sure if that's exactly what I'm looking to do. 

I pretty much want to add a class to the current selected category and I thought it could be done utilizing one of the functions from the category_tree.php

I'm going to play around with some things and see what I can come up with, thanks again!

Share this post


Link to post
Share on other sites
Posted (edited)

If you just want to style the text between strong tags then you should be able to replace them with

<span class="custom_class"></span>

then add to css

.custom_class { color:red }

or use bootstrap classes

<span class="text-danger"></span>

 

Edited by Hotclutch

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×