Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author robfelty

    (@robfelty)

    collapsing categories adds a class of simply “self”. See for example here:
    https://robfelty.com/category/environmentalism

    You’re right that I should probably also add current-cat

    Thread Starter yourcustomblog

    (@yourcustomblog)

    Thanks for your quick response, and once again, for your contributions to WP. I also love the “self” class — and am using this excellent built in feature. I see how in the URL you sent, the issue is side stepped b/c the post title is displayed. In my case, we are not displaying the post title. So, contextual navigation works for the category archive, but when we arrive at the individual post, there is no way to show that we are in a given category…which is confusing UI b/c we’ve done so up to that point.

    See:

    https://www.micahbazant.com/?category_name=identity

    vs:

    https://www.micahbazant.com/?p=17

    I’ve looked through the plugin files, but I am not a PHP master. Can you help get current-cat dynamically applied? I’d be happy to contribute towards this enhancement.

    Plugin Author robfelty

    (@robfelty)

    I can’t recall when I added this, but I know that in the latest development version, the category gets a class of “parent”, so you could use that to style accordingly.

    Rob

    Thread Starter yourcustomblog

    (@yourcustomblog)

    Rob:

    I’m using v 1.2.2

    I did a “View Source” while on an individual post and no “parent” was found.

    I’m thinking the parent class is applied to the parent category?
    If so, that wouldn’t solve my issue. I need the subcategory to get the class (current-cat or otherwise) dynamically (i.e. when viewing a single post, the class is applied to that subcategory).

    My categories: parent = DESIGN, subcategories = identity, print, web, illustration

    The UI breaks down (no more contextual navigation clue) when on the individual post (sub category menu item is no longer pink, in our case).

    If you’d be able to work on this enhancement, or even point me in the right direction so I can hire a programmer, I’d really appreciate it. I have a (small) budget for this portion of developing the site. We are really happy with your plugin in all other respects!

    Best…


    Peter

    Plugin Author robfelty

    (@robfelty)

    Peter,

    Please check out the development version
    https://www.ads-software.com/extend/plugins/collapsing-categories/download

    Here is a live example:
    https://blog.fedibblety.com/2009/02/new-kitchen-cabinets-part-three/

    Both the subcategory and the main category get the “parent” class. You can use css to style either of them how you want.

    Rob

    Thread Starter yourcustomblog

    (@yourcustomblog)

    Rob:

    Nice mitre cuts! And beautiful kids ??

    Loaded up the development version (2.0). Still…problems (for how we’re trying to use this).

    When on the individual post, all the subcategories get the parent class. That is rather opposite of what we’re hoping for/used to with WP current-class (a single class applied to the active category to provide a contextual navigation cue).

    <ul><li class="collapsing categories item parent"><a title="View all posts filed under identity" href="https://www.micahbazant.com/?category_name=identity">identity</a>         </li> <!-- ending subcategory -->
    <li class="collapsing categories item parent"><a title="View all posts filed under illustration" href="https://www.micahbazant.com/?category_name=illustration">illustration</a>         </li> <!-- ending subcategory -->
    <li class="collapsing categories item parent"><a title="View all posts filed under print" href="https://www.micahbazant.com/?category_name=print">print</a>         </li> <!-- ending subcategory -->
    <li class="collapsing categories item parent"><a title="View all posts filed under web" href="https://www.micahbazant.com/?category_name=web">web</a>         </li> <!-- ending subcategory -->
    </ul>

    I’m still working out the CSS to get the item vs the parent styled correctly on the category archive view with 2.0…but since that was working with 1.2.2, and single post view seems like it still won’t work with 2.0, that may be moot.

    ??

    There’s gotta be a hack (PHP filter or maybe some jQuery?) that will get this to work…but it’s gonna take me too long to come up with it given my limited programming background. Maybe a real programmer can knock it out? Again, if you’re interested, have a referral, or could take on this small enhancement, we are interested!

    Thanks again for your availability today. I’ll be donating to support your work regardless.

    Peter

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Collapsing Categories] current-cat class for contextual navigation’ is closed to new replies.