Releasing the Collapsing Categories WordPress Plugin

I started using the Fancy Categories plugin by Andrew Rader about 6 or 8 months ago. I have been slowly modifying it for some time now, and it seems appropriate to release it as a new plugin. (Note that I thought that Andrew Rader disappeared as well, but I now have found him at his new home at void*. The functionality is best described by simply looking at my categories list on this blog. The default wordpress categories list is a simple unordered list. This plugin gives it some dynamic capabilities, similar to the default on Blogger. I have decided to keep increasing the version number from what Andrew was using, so I am calling this version 0.2. Here are the main highlights:

  • Changed name from Fancy Archives to Collapsing Archives
  • Changed author from Andrew Rader to Robert Felty
  • Added triangles which mark the collapsing and expanding features That is, clicking on the triangle collapses or expands, while clicking on a month or year links to the archives for the said category. This uses html entities (dings) instead of images, for a variety of reasons
  • Lists the titles of posts, instead of just listing subcategories
  • Removed the rel=’hide’ and rel=’show’ tags, because they are not xhtml 1.0 compliant. Now uses the CSS classes instead
  • MOST IMPORTANTLY — it is compatible with both the pre 2.3 database which uses categories, and the 2.3+ database structure which uses the tag taxonomy

You can download it from the WordPress plugin repository.

This entry was posted in (x)html, css, javascript, php, sql, wiki/cms, wordpress. Bookmark the permalink.

84 Responses to Releasing the Collapsing Categories WordPress Plugin

  1. robfelty says:

    Alicia,

    Thanks for the tip on that last one. It wasn’t just you. I updated the postquery SQL query, and that fixed the duplicate issue. I also added some options to the widget in 0.5.1.

    Thanks for your patience.

    Rob

  2. mccormicky says:

    Hello and thanks first for this plugin I couldn’t do what I wanted to do with categories without it.
    Now, for the problem.
    In collapsecatlist.php there is this:
    (and the closing tag of course), which causes pages to fail validation.The validator says there is a ul tag that isn’t finished, then it points to the line of code I typed above.
    But it’s just html, not php or javascript causing errors so the plugin works.
    I must have done something wrong because your page doesn’t have the same errors, I checked with an html validator.
    Our categories all have subcategories — we used to use another plugin that did kind of the same thing–sort of–and in order to make the categories show up the way we wanted them for that plugin we had to title the posts with the same name as the subcategory…which was a bit redundant to say the least.And probably really bad for seo.

    Now I’m wondering if I got rid of the subcategories if that would get rid of some of the errors-if not all.
    What do you think?
    Otherwise thanks a bunch!

  3. mccormicky says:

    drat! ul style=”display:none” is what i was talking about.

  4. Lucian says:

    Hey Rob,

    Great plugin. I have loaded them into my site, but the triangles on both the collapsing categories and the collapsing archive don’t work. They are there, but they don’t expand (they are not an active link either). I noticed on the collapsing archives comments that you mentioned the need for a javascript file that should be in the /plugins/collapsCat/ directory, but I can’t find one for either plugin (category or archive). Any ideas?

    Lucian

  5. Michael says:

    I, also, cannot get the plugin to work. I am new to WordPress and REALLY wanted the functionality Collapsing Categories brings to it. Basically, like Lucian above, clicking on the triangles does nothing. Is there something else besides installing and activating the plugin needed?

  6. robfelty says:

    Michael,

    If you put up a test site with the errors, I might be able to help more. Lucian said that deactivating and then re-activating the plugin worked for him. Also make sure that the plugin is installed in the right place. It should be in:
    wp-content/plugins/collapsing-categories

    Rob

  7. Jeff says:

    Hi Rob,

    Great plugins!

    I’m trying to figure out how to have a collapsible menu version for my normal static ‘pages’ as well as the categories and archives? I have numerous pages and such a function would be excellent. Is there any plugin available that you know of which does this or can any of yours be used, if so can you kindly point me in the right direction as I’m struggling to find something suitable.

    Loving these plugins, work superbly.

    Jeff

  8. Hikari says:

    Jeff I think that what you need is an horizontal menu with support to nested submenus.
    Take a look on my blog http://ConscienciaPlanetaria.com I use such menu there and on its botton there is the author link.

    You should search some with about using WordPress as a CMS too :)

  9. GingerNuts says:

    Yes, Id like a version of collapsing ‘Pages’ too to complement these plugins.

    If this could be done id be happy to donate.

    GN

  10. robfelty says:

    GingerNuts and Jeff. Your wish has been granted. I have a preliminary version of of collapsing-pages. I have requested to host it in the official repository, but haven’t been granted access yet. For now, I put it in my own svn repository. You can find it at:
    http://robfelty/svn/viewvc.cgi/collapsing-pages/
    Please let me know if it does what you were hoping it to. I actually did not realize that you could have sub-pages before you requested this. So thanks for letting me know.

    Hikari, what theme are you using on your site? I am interested in using wordpress more like a CMS as well.

    Rob

  11. Hikari says:

    Author link is on my blogs. Are you talking about http://ConscienciaPlanetaria.com ?
    Anubis is a nice theme, I contacted author asking for a custom theme with full width but he didn’t answer yet.

    About the menu, the blog has link to author too. The theme didn’t have any kind of pages menu, so I added that menu there. It supports at least 5 levels of submenus on it, I never saw a CMS theme with such nice menu :P

  12. Adam says:

    Hi and thanks for the awesome plugin. I’m having a small issue: I once changed the css to make the arrow smaller and now in FireFox but not IE it has some funky behavior. Once expanded, the arrow shinks and no longer has hover-over behavior. I have complete deleted the plugin files and re-uploaded them but cannot get it fixed. http://somedaymap.com/

    Thanks for any tips.

  13. GingerNuts says:

    Rob,

    thanks i will look into it now, hopefully itll be just what im looking for, where shall I forward the donation?:)

    GN

  14. robfelty says:

    GingerNuts: I have added a donation link on my WordPress Plugins page.

  15. GingerNuts.com says:

    Looking great so far rob, is there a wayu I can exclude certain pages from being included in the collapsing menu?

    thanks

    GN

  16. robfelty says:

    @Gingernuts – I added an option to exclude certain pages (and sub-pages of those pages) in version 0.1.1

    @Adam – I took a look at your site, and confirmed the behavior with Firefox. It definitely has something to do with your theme. I took out the css line on the body with font-size 65% or something like that, and that did the trick. Maybe you could also try adding an id tag to the span.collapsArch rule, like #sidebar span.collapsArch

    Rob

  17. adan says:

    Thanks rob, it’s very cool of you to provide free help like this. I remove the line you mention but it does not fix the issue for me. Clearly, I’m not a web developer and have little understanding of CSS, i mostly just hack my way through it when needed. I guess I chose a bad theme because there are many things in there that seem unnecessary, such as this.

    in style-core.css i remove the line: font-size: 62.5%; /*Resets 1em to 10px , but there’s font-size’s all over the place compensating for it.*/ but still have the issue (i’ve put it back in now until I have time to fix all the fonts). Thanks again.

  18. GingerNuts says:

    Hi Rob,

    Am having some issues with the plugin, breaking out of the widget style etc, if there are various pages, and subcategories, not sure how to explain it, it isnt displaying correctly, and basically the formating of how it looks is broken for me.

    GN

  19. GingerNuts says:

    Also the ability to have more than one widget would be very handy, so you could display separate groups of pages in different parts of your site? Is this possible? This is especially handy for those who use wordpress as more of a cms.

  20. robfelty says:

    @Gingernuts – Could you post a link to your site? I could help answer your questions more easily that way. I will look into making multiple widgets available. Unfortunately there are two different functions for registering widgets register_sidebar_widget and wp_register_sidebar_widget. The wordpress documentation recommends using the former, but only the latter allows one to have multiple instances of a widget (at least as far as I can tell).

    Rob

  21. Hikari says:

    There are some plugins that let u choose how many widget will be available, like Text widget until 2.3.3. With 2.5 Text is now unlimited, as long as I noticed. AdSense Deluxe I think uses that, take a look on its source and see how it is implemented ;)

  22. GingerNuts says:

    Hi Rob,

    Sorry I havent got the site on the web yet, Im still have a problem with the collapsible pages plugin being buggy for me.

    The menu is breaking out of the widget box and not being displayed/formatted correctly, it breaks after the second page ‘parent’ is shown.

    Also after the 5th child to the main parent the collapsible element isnt shown, the following children are grandchildren are showing already expanded withion the collapsible function. I.e. All the grandchildren to the 6th child are already shown in an expanded menu.

    It might be a theme issue, im using the latest ‘mandigo’ theme. Its a shame as I think this plugin could be perfect for my needs.

    Being able to have more than one widget for these plugins would also be superb and being able to pick and choose what is shown in the collapsible lists.

    i.e. Have a selection of pages i.e. of one certain category/selection displayed, then underneath or on another part of the site have another widget which would display another selection of pages.

    As it stands I have a large number of pages and showing every single one of them within just one collapsible menu widget isnt effective in the manner of showing the visitors the information clearly.

    Ill keep a close eye on this, keep up the good work.

    GN:)

  23. robfelty says:

    @Gingernuts – please check out the development version. There are a number of improvements in it.

    Rob

  24. Andy says:

    Hi!
    I’d love to use your plugins but I’m still facing some issues. I use a custom theme and it looks like the css for collapsing_archives just gets ignored. Esp. the font-size :(
    The second problem ist much more severe: collapsing categories just doesn’t show anything.. I’m using the plugin “Top Level Categories” that kills the “category”-folder and puts all categories in the main directory.. do you think that’s the problem and could you fix it?

    I’ll provide my link if necessary.

  25. Andy says:

    Hi!
    I’d love to use your plugins but I’m still facing some issues. I use a custom theme and it looks like the css for collapsing_archives just gets ignored. Esp. the font-size :(
    The second problem ist much more severe: collapsing categories just doesn’t show anything.. I’m using the plugin “Top Level Categories” that kills the “category”-folder and puts all categories in the main directory.. do you think that’s the problem and could you fix it?

    Here is the page: http://www.onkelandy.com/blog

  26. GingerNuts says:

    will do rob, thanks for the hardwork, if its suitable for me ill happily donate.

    GN

  27. Pingback: | Onkel Andys Tagebuch

  28. Andy says:

    Hi Robert!
    It was the “wp_” prefix indeed that made the problem! You’ve hardcoded that prefix in CatList in line 134: $tables = $wpdb->query(“show tables like ‘wp_term_relationships’”);
    After changing the wp_ with my prefix everything works perfectly. Yikes! So you have a reason to release a bugfix ;)

  29. robfelty says:

    Andy,

    Thanks for finding that bug. It is now fixed in 0.5.4.

    As regards to the css, it might depend on how your sidebar is named. The current rules I have use #sidebar. I wasn’t sure whether I should include any CSS at all, for this very reason. You can try removing the #sidebar part, that is from:

    #sidebar .collapsPost {font-size: .9em}

    to:

    .collapsPost {font-size: .9em}

    I hope that helps. I would be happy to hear a better solution than this.

  30. Andy says:

    I’ve tried to alter the css but well it only works when I put the definitions in the main stylesheet of the theme. No idea why, but no problem..

    But there is a problem with subcategories: the code isn’t XML valid. Can you take a look at it? I’ve figured out that those without within are the prob so the fix is easy as you can see on my site. Anyhow, when you also check the source code you see that there are a lot of useless tags in it!

  31. robfelty says:

    Andy,

    If I were you, I would put the CSS in your stylesheet for your theme. That way if/when you upgrade, your changes will remain intact. I only provided a stylesheet which I thought would be a good default for most people.

    Thanks for pointing out the validation problem. I discovered that it was only a problem when not displaying posts. I have fixed this in 0.5.5

    I also noticed you were using +- instead of arrows. I added this as option in 0.5.5

    Rob

  32. Andy says:

    Thanks for the cool updates.. If you advise to implement the css in the main stylesheet anyhow it may be better to not include the css and esp. the link to that file but just to supply the samples within an instructional txt-file – just an idea ;)

    Thanks for the great work anyhow. Actually my +/- was just somehow a compromise. I guess I’ll make some nice graphics so that the menu points don’t jump around left and right anymore.. I’ll keep u informed. Thanks so far for your work!

  33. Andy says:

    I’ve taken a look to the counting of posts per category because your plugin shows different numbers than the wordpress-function list_category. Actually the way you combine the count of parent and child-categories is great. But when the count of the main cat is 0 you don’t consider the subcategories at all. Means a category with 0 posts in the maincategory but several posts in subcategories should be listed in your plugin but aren’t.

    One other issue: when you expand “Ausgang” on my site, there should be a “+” before “Privat-Event” because it’s a sub-sub-category. You can click on the empty space in front of the entry and then the “+” or arrow shows up. But when you reload the page, the plus has disappeared again.. :(

  34. robfelty says:

    Andy,

    Thanks for your diligent bug reports. I have fixed both of these issues in 0.5.6. Also, I created separate pages for all my plugins. I am closing comments on this post. All further comments should be posted on the collapsing categories page