We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41647
    • 49 Posts
    Hi,

    I am dealing with the following problem:
    A user creates a resource from the backend via rightclicking on a parent.
    The page reloads and everything is fine.
    But now there is no information about my "position" in the resource-tree.

    What I would like to have:
    a) to highlight all parent resources (for example a green background) in the tree
    OR
    b) showing a breadcrumb in the docform. (somewhere above the pagetitle f.e.)

    I would prefer version a).

    I tried to hack the tree with a plugin and some js but there is barely no information which parent I#m working on. Also after switching the templte I lose my information about the parent...

    Does anyone have an idea how to accomplish this?
    I think that would be nice to have anyway.

    thanks,
    janein
      • 3749
      • 24,544 Posts
      Modifying the tree is not easy, but in a plugin that fires when the doc is saved, the parent's ID should be available with:


      $resource->get('parent');


      That would be a great feature request to submit at http://bugs.modx.com.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 41647
        • 49 Posts
        Quote from: BobRay at Jul 26, 2013, 02:15 AM
        Modifying the tree is not easy, but in a plugin that fires when the doc is saved, the parent's ID should be available with:


        $resource->get('parent');


        That would be a great feature request to submit at http://bugs.modx.com.

        I would need to show this before the new resource is saved. Afterwards it would be quite easy to show at least the breadcrumbs above the form.

        I nearly could do the trick to select the parent element in the tree with javascript, but the only attribute refering to the resource is:
        <div ext:tree-node-id="CONTEXT_ID">...</div>
        When I try to select the element via javaascript I get an error because of the colon in the attribute's name. I also couldn't escape it with a "\".