It is possible to add a Parent of Parent Class?
-
I’m using CSS to children of items that are in a different section than what is currently being viewed.
This was working fine when I had two levels deep. However I now have 3 levels deep and there is no CSS class being added to the top level parent when a child of a child is the current category. This means I can’t use CSS to expand that section of children.
If we have a structure like this, and Category B is the current selection the classes look like this:
Category 1 (class=”current-cat-parent”)
— Category A
— Category B (class=”current-cat”)
—- Category i
—- Category ii
—- Category iii
— Category C
Category 2
— Category DBut if Category ii is selected the classes currently look like this:
Category 1
— Category A
— Category B (class=”current-cat-parent”)
—- Category i
—- Category ii (class=”current-cat”)
—- Category iii
— Category C
Category 2
— Category DSo “Category 1” has no class assigned that tells us it is a grandparent of the current category, which means I can’t use css to expand that part of the tree while hiding the other sections not current.
Could the NS Category Widget please be enhanced to add a class like “current-cat-grandparent” to each grandparent of the current category – no matter how many levels up?
So like this:
Category 1 (class=”current-cat-grandparent”)
— Category A
— Category B (class=”current-cat-parent”)
—- Category i
—- Category ii (class=”current-cat”)
—- Category iii
— Category C
Category 2
— Category DOr for more levels deep it could look like this:
Category 1 (class=”current-cat-grandparent”)
— Category A
— Category B (class=”current-cat-grandparent”)
—- Category i
—- Category ii (class=”current-cat-grandparent”)
—— Category (a) (class=”current-cat-grandparent”)
——– Category (x) (class=”current-cat-parent”)
———- Category (xx) (class=”current-cat”)
—- Category iii
— Category C
Category 2
— Category DWould that be possible? It would give us much more custom control with CSS.
Thanks!
Josh
- The topic ‘It is possible to add a Parent of Parent Class?’ is closed to new replies.