Skip to main content.

dmry tree menu plugin mods

March 28th, 2006

I have customized the dmry tree menu plugin by Hakan Demiray so that it will do what I want. It’s a great plugin, but I needed it to work a little differently. I wanted it to automatically open the child nodes of the selected menu item, so that users can see what is there.

I have submitted my modifications to the plugin for possibly inclusion in the next version. In the meantime I will make my version available for download here.

Update: Here is some code to add OpenAll and CloseAll links (in response to the comment by Alby below).
[code lang=”html”]Open all
Close all[/code]

Just put this code after the menu call in your page template (mine is in sidebar.php). If you want to you can use images or buttons instead of simple text for the link.

Posted by Ken in Wordpress

13 Responses to “dmry tree menu plugin mods”

  1. alby says:

    respect at original I think is better;
    only one to do:
    there isn’t the highlight link selected;

    You think can resolve?

  2. alby says:

    is possible to have, how option a button (at the top: near image pc) that open or close all the node;
    but this must be only a funtion on the botton and not
    at evry click on the link;

    you create a next version?

  3. Ken says:

    Hi Alby,

    I am not quite sure what you mean by your first comment, but I do understand the second one. The author of this plugin is Hakan Demiray. What I am sharing here is a modified version that added a function that I wanted. I have submitted my changes to the author for possible inclusion in the next version.

    The buttons that you suggest are a good idea. I think that you could add the buttons you want, and get them to call the proper function to open or close all nodes.

  4. Ken says:

    Today I was thinking about your idea. I added my suggestion to the post above, because WordPress has problems with the code when I try to post it in a comment.

    I hope this helps!

  5. alby says:

    the 1st question is simple;
    to see the item menu enabled (current)

    for a good solution is necessary insert a class style
    in the current menu’s item javascript;
    better to insert a class in the current url, this for who go at page directly by url and not click;

    for the second point is also important to have an option, that if I have open all link and when I click on one item, the other node remain open; this because I am in a particular situation (selected by button see all) where I want to browser in all the link;
    after when I close by button the tree, then
    the menu can to have normal behavior

  6. alby says:

    the second point;
    I not have tested
    maybe is already so?
    if not I think is necessary to use a variable
    that change when I active openAll;
    variable that is after used for to change the
    behavior when I click on links

  7. Ken says:

    I agree that adding a class style to the current node is the best idea. But the html is generated by the javascript, and I haven’t figured out how to do that yet. (There is actually something in the plugin code that tries to do this, but it doesn’t work.)

    For the second point, I just tested it and you are right, when I select an option all the submenus do not remain open. A variable would work, but it would have to be passed back to the plugin. It would be easier to modify the plugin so that all the submenus are open all the time, but that is not as flexible.

    I don’t have much time to work on it right now.

  8. Tomas says:

    Just wondering if anyone could help. I did something stupid and started my blog using a numerical archive system, and now I'd like to change it so that the post title is part of the URL for SEO reasons. Is there any WordPress plugins that anyone knows of that could switch it without sending Googlers to invalid pages? Maybe some sort of redirector to the correct page?


  9. Ken says:

    I had the same problem when I started my blog. What you need to do is issue a 301 permanent redirect when users come to the old URL. That will inform search engines that the location of the post has changed.

    I remember seeing a plugin to do what you need, and when I searched I found this redirection plugin. I haven’t tried it, but the plugin page says that it can automatically do a 301 redirect when the URL for the for the post changes. I hope that this helps!

  10. Damon says:

    Does anyone know the name of the wordpress plugin that creates a list of your posts in a category instead of just displaying them one after the other? I want it so that when someone clicks on a category they just get a list of posts from that category.

    I'm sure Ive seen one…and sifting through the WP site is a nightmare

  11. Ken says:

    Damon, I’m not sure of a plugin, but you could create a new category template in your theme. I think it would be called category.php. You could use index.php as a model, and change it to display post titles instead of the entire post. You really only need to change one line.

  12. Jonas says:

    What I want to do on my blog, is every few hours take the oldest post and move it to the
    front of the queue, all automatically. Anyone know if there is a plugin that can do this or
    a simple way to set up another plugin to do this (use my own feed perhaps)?

  13. Ken says:

    It sounds like you want to continually rotate your posts, so that the newest is not always first. I don’t know of a plugin to do that, but there are a few plugins to display a certain number of randomly selected posts. One that I use on my other blog is < href="">Customizable Post Listings. It gives you a great deal of flexibility in displaying your posts. But you would need to edit the index.php in your theme to set it up.