Collapsing Categories

The collapsing categories plugin creates a list of all categories, subcategories, and posts, which can be expanded and collapsed dynamically, as you can see in the sidebar on this page.

The plugin is hosted on the official WordPress repository at: http://wordpress.org/extend/plugins/collapsing-categories

If you have any questions, bug reports, or feature requests, please visit the Frequently Asked Questions, and at the other comments here (find is your friend)).

Your appreciation

If you really like my plugins, please give them a nice ranking in the wordpress plugin repository (links above), or you can send me a donation via paypal below:




240 Responses to Collapsing Categories

  1. David says:

    Hi… I really like the plugin, but the display on my sidebar is weird. I have the same problem as Ruben in that there are line breaks between the “bullets” and the items:
    +
    Category
    >
    Post

    Ruben was content to switch themes, but I’m not. Can you take a peek at MemorizeShakespeare.com and see if you can identify why this happens? Thanks.

  2. robfelty says:

    @David,

    Check out version 0.6.6. The problem is that you set

    li a {display: block}

    in your style.css file. This automatically starts a new line. I added a float:left to the symbol, which takes care of this in most cases.

    Rob

  3. Hi Rob Felty:

    About two months ago I sent you a letter requesting that you make specific improvements in your plug-in Collapsing-Categories that I would need for the development of my site http://AspergerSyndromeEmployment.com. At that time I offered to contribute to you for this service. When I didn’t hear back from you I brought the project to another web developer to modify as I needed for my site. To date I have paid over $1000.00 for the work to be done to this plug-in. You can go to my site to review the results of his work.

    The development work done was roughly divided into two parts:

    The Javascript work needed to keep the menu open when a new page was visited cost roughly $500.00. I was sad when I just went back to visit your site and see that you have duplicated this work.

    The CSS work needed to display different fonts at different menu depths, at roughly another $500.00 from another developer.

    As I see that you are actively involved in the continuing upgrade of this plug-in I have a dilemma; is it the right thing to do, to contribute my $1000.00 of custom code back to you, when you didn’t even email me back?

    Given this choice I would like to send you my code. I have several motivations for this:

    It may be that the Javascript that I had done professionally may improve your code base, and the addition of the refined fonts in my menu may be something that you are working on, or have on your to-do list, (altruistic).

    If I don’t contribute’ my code back to yours I can never take advantage of any upgrade you make to the plug-in, without paying for additional custom coding to my menu, (practical).

    I would hope that you could in some way credit me in your documentation for the code of mine that you use, and make a mention of my web site so that people who can benefit from my project to benefit Autism could be made aware of it, (charitable).

    Finally, the code that I have paid for still needs some work. The menu displays correctly in Firefox and Safari for both Windows and Ubuntu. There is a small glitch in the animation in IE7. And the CSS still needs work in IE6. I hope that if I contribute my code back to you, you could fix these problems and save me the additional development costs, (cheap)! :-)

    I look forward to hearing from you. Regards, Phil

  4. Philip says:

    Hi Rob

    Thanks for your continued work on this great plugin.

    I don’t like the little tweak you made in 0.6.6, though. My sidebars are all text-aligned right, so floating the symbol left looks really odd. Take a look here: http://test.londonkoreanlinks.net/

    0.6.4 worked just fine: http://londonkoreanlinks.net/

    Keep up the good work

    Cheers
    Philip

  5. robfelty says:

    @Philip Garrow –
    I apologize for not responding to your letter. I am not very good about keeping my paper life organized, yet I seem to do pretty well with my digital life. I also feel bad that I missed out an opportunity to make some money, and I feel bad that you paid so much for so little. If you would like me to help you with styling, I would be happy to do so at a price (much less than what this other hack was charging you). Since this styling would be custom for your site, the appropriate place to put it would be in your theme, not in the plugin.

    As far as sharing back the code, that would depend somewhat on the arrangement you have made with that developer. If you own the code, and wish to share it, I would be happy to see it.

    @Philip (of London Korean Links) –
    You’re absolutely right. I have gotten rid of that change in 0.7 (and I added some other new cool features).

  6. minorio says:

    Serious Error!

    Warning: collapscat::include_once(collapscatUI.php) [function.collapscat-include-once]: failed to open stream: No such file or directory in /wp-content/plugins/collapsing-categories/collapscat.php on line 57

    The collapscatUI.php is not included in the Zip package downloadable as collapsing-categories.0.7.zip.

  7. Rob says:

    @Minorio,

    Thanks for alerting me to this. I forgot to add that file to the repository after testing it out. I just added it. Please try re-downloading the zip file.

    I apologize for the mistake.

    Rob

  8. Rattler says:

    Hi, Rob!

    Just tried to upgrade to 0.7 and was hit by a bunch of problems, both on my test site todos-contra-matias.net as well as at my private ohlmer.es (WP 2.6.3):

    РIt started with uploading, I had to use file-by-file upload as for some reason it wouldnt do all the folder at once (Transmit on a Mac, and I up̦loaded 6 more polugins at the same time w/o probs)

    – Once uploaded, when going to administer plugins I got the message “Error: Collapsing Categories got deactivated because the plugin collapsing categories doesnt exist”

    – I re-activated, and all seemed normal, until I found out it didnt appear in the sidebar: Adding it would accept it, but saving changes it would be out of the sidebar widget list again.

    – Also could not change any settings while I had it in the list.

    Now on TCM back to 0.6.3, my private on normal cats.

    Am I doing anything wrong?

    Thanks,

    Rattler

  9. Matt Algren says:

    I’m having the same type of problem as minorio, both on the Options page and the widget editing box thingie. It seems to be having trouble finding the files ‘processOptions.php’ and ‘options.txt’ from ‘collapscatUI.php’ (lines 53 and 63) AND from ‘collapscatwidget.php'(lines 99 and 104).

  10. Rob says:

    @Rattler and Matt,

    Jeez. I feel like an idiot today. I have added the files to the repository. Please try downloading once more. Thanks for letting me know.

    Rob

  11. David Chua says:

    Hi Rob,

    I’m having problems with IE not animating when clicking on the expansion. Please take a look at my site http://www.d3dphotography.com/blog

    Thanks

  12. minorio says:

    One more file missing.

    Thanks Rob, for your quick response!

    I re-downloaded the collapsing-categories.0.7.zip, and uploaded 3 new files;
    collapscatUI.php
    options.txt
    processOptions.php

    Now I can see the collapsing-categories’s Admin contol page. But I cannot execute option update. The updateOptions.php file seems to be missing.

    I got the following error message;
    Warning: include(updateOptions.php) [function.include]: failed to open stream: No such file or directory in /wp-content/plugins/collapsing-categories/collapscatUI.php on line 34

  13. David Chua says:

    Hi Rob,

    I have a problem with the 0.7 not expanding or contracting the Categories in IE. Tested with Firefox and Chrome no problems.

    Please take a look at my site.

    Thanks

  14. Rob says:

    @Minorio – ok. what a terrible day for me. I have added updateOptions too. Now all should work.

    Rob

  15. Matt Algren says:

    HA! Glad it was an easy fix!

    The open/shut animation isn’t working (even after I changed the setting on the widgets page), but that seems to be a conflict with the javascript in my contact form. Not your problem.

    Also (you love me, you know you do!) I just tried in IE7 and am having the same problem as David Chua above. The error report it’s giving me (after I click to open a category) is as follows:

    Line: 33
    Char: 5
    Error: ‘1’ is null or not an object
    Code: 0

    Line: 53
    Char: 12
    Error: ‘className’ is null or not an object
    Code: 0

    Thanks for a great plugin!

  16. Rattler says:

    Rob,

    thx, all fixed, and no probs even with my test site todos-contra-matias.net running 2.7 beta3 (WP that is).

    If you ever need a checklist for digital task organisation, call on me… :-)

    Kind regards,

    Rattler

  17. John says:

    Ditto on the recent update breaking the expanding/contracting ability on my website, http://heroesofblackfield.com/heroes_blog/ at least when looking at it in IE.

  18. Aimee says:

    My site is not widget-ready. Is there a way to call the plugin on a page, without using the drag-n-drop feature?

  19. minorio says:

    Hi Rob,

    I have a issue as it sets unwanted hierarchy between categories.
    I wrote the details with screenshots on my blog. Please see this when you have time. Thank you.
    http://d.hatena.ne.jp/minorio/20081127/1227750274

  20. robfelty says:

    Sorry for the slow response time to your comments. I was pretty busy with the Thanksgiving holiday here in the U.S. I will look into the problems with IE7.

    @Aimee – yes. You can use it like so:

    <?php
    if (function_exists('collapsCat')) {
      collapsCat('%i%')
    } else {
      echo "<ul>\n";
      wp_get_categories(your_options_here);
      echo "</ul>\n";
    ?>

    @Minorio – I will try to check into your issue

  21. Rattler says:

    Sorry to bother you again, more so as I am not able to donate atm (if prayers help pls feel heavily donated!?)

    This time I ran into following problem (chk http://mallorca-service.net/nodees/):

    – cats work as links (if you set them so, but my site wants just what you did offer: Expand when clicking on instead of going to cat archive: On my english and german sites this produces map loading attempts in the order of 300+….) but simply wont expand under any setting.

    This happened after updating to v0.7, my other sites – same theme – running 0.6.3 are fine (but of cause w/o the feature to have cats-click just do expand: http://mallorca-service.net/node/)

    WP 2.6.3, CC v 0.7

    Works fine with other theme on my private blog (http://ohlmer.es/blog/)

    What am I doing wrong?

    Rattler

  22. robfelty says:

    @Rattler,

    It looks to me like it is a conflict between the prototype javascript library and the scriptaculous javascript library that I use in my plugin. Try disabling animation, and see if that helps.

    Rob

  23. Rattler says:

    Thanks a lot, Rob! Disabling Animation indeed did the trick!

    Kind regards from Mallorca!

    Rattler

  24. robfelty says:

    I think I have fixed the javascript bug in IE7. Try upgrading to 0.7.1

    Rob

  25. Thanks for the plugin! I have two problems:

    #1 – Exclude doesn’t seem to work using either cat ID, cat SLUG, or cat NAME.

    #2 – Where does the small double arrow “>>” or (»), which appears where a list bullet would appear, get loaded, e.g. via css, javascript or CSS? I can’t seem to get rid of it: http://rsc-web.rsci.com/levi/

    Thanks again.

    Oops, BTW I using WordPress version 2.6.3

  26. David Chua says:

    Thanks a lot Rob, IE is working now!

  27. robfelty says:

    @David Radovanic,

    The double arrow is specified in the collapscat.css file in a :before rule.

    Rob

  28. Andy says:

    Hi Rob! I get the following error with your newest version in Firefox:
    expand is null
    [Break on this error] var thisli = expand.parentNode;

    By the way. In IE after epxanding a category the new entry first jump to left and then back to the correct position after a mouseover..

  29. OK, I probably don’t know enough to know what I don’t know; here goes anyway.

    I love the way this works on your site but I can not get it to show up on mine. I have it in the widget selections and when I click to add it, it shows up in the sidebar listing. The problem is that when I click save, or edit, it disappears. I have no idea why, and I don’t even know how to be sure that Javascript is enabled.

    Please Help Save Me from Myself!!!

  30. robfelty says:

    @Andy – I will look into those bugs. What settings are you using?

    @Charlie – the newest version only works with WP 2.6+. I see that you are using 2.5.1. You can either upgrade wordpress, or downgrade collapsing categories to 0.5.10. Note that most wordpress plugins show a minimum version, and a tested up to version on the main page where you download them.

  31. Andy says:

    I’m using the standard options except that I use images instead of +/-. So, animation is on.

  32. jerry says:

    I have cat ver 0.7.1 and arc ver 0.9.6 activated and they show up on widgets and after i add and save they disappear from the listing of widgets used on side bar… and don’t show up on the front page…

    I am using WordPress 2.7-RC1-10119…

    Will you be updating plugins to work with 2.7?…

  33. Rob says:

    @Jerry,

    I am planning on making the plugins compatible with 2.7. Actually, I had already tested them out a little bit, but I did not try removing and adding them from the sidebar. Strangely enough, if they are already there when you upgrade, they remain there fine. It looks like they have changed the widgets api slightly. Hopefully I should be able to get it figured out relatively quickly.

    Rob

  34. Dreas says:

    Hi I’m using your plugin on my website, but the cookie handling does not work. The categories are collapsed every time i’m clicking on a sublink. I’m using WP 2.6.5 German edition

    Do you have a solution?

    Dreas

  35. Rob says:

    @Dreas,

    Can you provide a link to your site please?

  36. Rob says:

    @Dreas,

    I checked out your site, and it seems that the cookies are getting added, but the javascript is not working right. It looks like you modified the plugin somewhat, since I don’t see any sort of collapsing/expanding symbols. I think that this might be the problem. I have 2 suggestions for now:
    1. undo some of your modifications
    OR
    2. try the development version

    I will also try to add an option to not use any symbols at all, since some people seem to like that. Personally, I think it is confusing, since there is no indication that when I click on “Hunde”, the list expands, but if I click on “Information” I get a different page.

    Rob

  37. will this pulgin work for 2.7?

  38. i have tested it with 2.7 arabic and its working,

    can someone tell me how can I arranage the categories accourding to the termorder?

    please help thanks

  39. Rob says:

    @Iraqgoals,

    You should be able to sort the categories using the options in the widget settings.

    Rob

  40. When I chose sort by category Term order all of the categories dissappear from the main page

    why is that

  41. Is there a collapsing pages plugin?

  42. Jeremiah says:

    Rob, great work on the plugin, it’s a godsend.

    The only major issue I’m having with it is that I see the expand buttons and they all work great.
    However, once expanded, no collapse button appears and the category is un-collapse-able until the page is reloaded, whereupon the menu goes back to its default collapsed state.

    This occurs in both Firefox and IE7, so I think it’s gotta be either a style issue or a javascript problem. Any ideas?

    Thanks in advance.

  43. Hi Rob,

    Is there a way to exclude empty categories without having to list each one individually in the widget? I have prepared a number of categories that I only want to be seen once they are no longer empty. Thank you.

  44. John says:

    I have recently begun operating blogs for friends and had tested collapsing categories and was pleased with how it worked. After WP2.7 upgrade, on a test site where it was already installed it continued working. After I removed the widget and tried to add it again via the widget page it initially appeared on the right hand side of the widget page but as soon as I pressed Save Changes the widget vanished off the list of wigets on the right hand side of the page. Interestingly the total of widgets at the top “You are using 3 widgets in the “Primary Aside” sidebar.” had changed to 4 although only 3 were now shown as installed. The only way to re-set the total figure was to add the collapsing categories widget again, click edit, click remove and then click Save Changes. The total was reset to 3 again and (of course) the widget removed itself. This happens for my other blogs as well.

    Any suggestions how I can get it to stick when I add it?

    Thanks in advance – I really need it for a blog I am just creating for someone.

  45. tim says:

    Im getting an error on page error in ie 7, i tested it in ie beta 8 and the error is the same. Looks like a web script page error.

    ‘1’ is null or not an object
    Line: 32
    Char: 5
    Code: 0

    Ive tried setting various different options within the widget options but whatever I do the error is still the same, in ie and tested on various pcs. any idea what it might be?

    really hope you can help Rob this plugin is vital to me.

    thanks

    Tim:)

  46. tim says:

    forgot to mention im using the latest 0.8 version and WP 2.7.

    Tim

  47. robfelty says:

    @Tim,

    Thanks for letting me know about that. I don’t have access to IE8, but have some limited access to IE7. Besides producing an error message, what other effect does it have, and when does it happen? Does it happen on page load, or when you try to expand or collapse a category? And does it actually break some functionality, or is it really more of a warning?

    I will try to figure it out.

    Also, can you give me a link to your site so I can check it out there?

    Rob

  48. robfelty says:

    yes there is. Look at the page called “collapsing pages”

  49. robfelty says:

    @San Diego Tim – Empty categories should not show up at all. They don’t on my site at least.

    @John – Please upgrade to the latest version, and look at the installation instructions for a workaround to this problem. I am trying to figure out a permanent solution.

    Rob

  50. Jeff says:

    I am having the same problem as Tim. After adding the widget to the sidebar and the pressing “update” the widget dissapears and the widget count shows one more widget than appears in the sidebar. I am using Firefox 3.0.5.