Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author ulfben

    (@ulfben)

    Why can’t you use

    .dtNode .node{
    }

    ?

    Thread Starter ivomasterche

    (@ivomasterche)

    Because as far as i can see the category links are .dtNode .node too …

    And i would like to now which link is category and which is post…

    Plugin Author ulfben

    (@ulfben)

    I don’t believe that’s possible.

    What you call a “category” is just a parent node, and all nodes are just links to dtree. A parent node might be a category, but it might just as well be a page or some custom taxonomy.

    Thread Starter ivomasterche

    (@ivomasterche)

    Ok you have done a great job with this plugin and i didn’t have the time to look in the code so you must be right.

    The only thing that i can add is that you give different id to the different nodes – i noticed – dcat###, jcat###, scat### so i thought that you can give them different class too…

    I actualy used jQuery to check if the id of the node starts with “scat” which i noticed is used for the nodes that are posts in my case, so i can add some additional functionality to these nodes.

    Once again you’ve done a great job, i just wanted to propose something that i thought would be useful.

    Plugin Author ulfben

    (@ulfben)

    Indeed it does give different IDs. I checked it out and this is what I gather

    j: seems to be DOM-nodes related to the tree controls (plus/minus signs)
    d: seems so be the DOM-nodes containing block of nodes that hide/appear together
    s: seems to be all links (posts, categories, archives – all of them)

    So yeah; there are different IDs, but the script is still not aware of what they’re pointing to.

    Now – the script is obviously able to separate “folders” from “files” (eg. nodes). Unfortunately that distiction is made much later than the class/id assignment so it would take a fair bit of hacking around to retrofit a “file”-class into the anchor surrounding the icon. And I’m not sure the icons truly matches your definition of a post vs. category node either?

    Thread Starter ivomasterche

    (@ivomasterche)

    I guess we can close this case, but if you have 5 minutes you can see the way i implemented your plugin –

    https://intelligames.bg/tournaments/q-and-a

    The site is in bulgarian, but i hope, that you’ll get the idea.

    As i said earlier i used that different ID structure with jquery, so i got the functionality i needed – to load the post content dynamically, and to have a slightly different behavior.
    The styling is nor perfect but the site is still in development.

    Once again thank you for your plugin

    Plugin Author ulfben

    (@ulfben)

    That’s a pretty cool use case. Not at all what I imagined when you said you put post content next to the links. I’m sure there are a lot simpler ways to implement a FAQ with toggle functionality, but still – this is an excellent hack! Good job!

    I’m sure you’ve thought off this already, but it would be trivial to use jQuery to check how many indentation sprites are used for the post node, and duplicate them for the faq_content. Thus keeping the content aligned with the header-link.

    I’ll keep this request in the back of my mind when I go through the script next time (adding some more contextual “tags” to the tree output would be useful anyway), but I’m fairly sure your jQuery-selection is the best solution to this particular problem.

    (and I love the Settlers of Catan boardgame. Especially with all the cool expansions as of late.

    I played (rather poorly) in the Swedish National Tournament five- or six years ago. ?? Great stuff.)

    Thread Starter ivomasterche

    (@ivomasterche)

    Thank you.

    I’ve checked some other solutions, but still i liked your most.
    I’m an engineer – i like to make things the complex way ??

    And yes some additional styling is coming on the way.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: WP-dTree] adding class to post links’ is closed to new replies.