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

    I am creating a simple, sample web site (actually for an article) using ModX:

    http://test1.beleza.modxcloud.com/

    The theme is veeeeery basic, and it will be changed completely shortly (I don't know much about CSS).

    My question is about the Wayfinder. My aim is to have the menu at the top (the "main" sections) and then the menu of the side, showing the sub-sections of the selected sections.
    This is happening "neatly fine" as it is: click on "Music tuition" and the wayfinder displays on the left all of the entries "children" of Music Tuition in the resources.
    This is how I did it:

    TOP WAYFINDER:

    <div id="menu">
    [[!Wayfinder? &startId=`0` &level=`1`]]
    </div>

    LEFT WAYFINDER:
    <div id="sidebar">
    <h1>Sidebar Menu</h1>
    [[!Wayfinder? &level=`1` &outerClass=`sidemenu`]]
    </div>

    Trouble is when you click on a sub-page, like Dance Tuition > Brazilian: http://test1.beleza.modxcloud.com/brazilian.html
    The Wayfinder starts from the current page, and (obviously) it doesn't find any pages "underneath". The ideal result is to show the same pages under "Dance Tuition", with "Brazilian" showing as selected.

    Is this possible "easily enough" with MODX Revolution? If so, how?

    THANK YOU!

    Merc.
      • 4172
      • 5,888 Posts
      you can use UltimateParent in the startId - property.
      http://modx.com/extras/package/ultimateparent
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Don't forget the &level property. &level=`0` shows all the children and their children. &level=`1` as you have it in the call would just show the first level so you'll want to use &level=`2` to get the immediate children of the parent.
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 43193
          • 9 Posts
          Hi,

          THANK YOU!
          Well I did this:

          [[!Wayfinder? &startId=`[[UltimateParent]]` &level=`2` &outerClass=`sidemenu`]]

          And... well, it "worked"!
          I get it: UltimateParent returns the... well, ultimate parent of the page I am viewing. So I use WayFinder with *that* as the startId, and then level 2 so that it display the right level. Right on, it works laugh

          I was looking for the documentation of UltimateParent. From here:

          http://modx.com/extras/package/ultimateparent

          There are no actual instructions on how to use UltimateParent and how to use it.
          In the Package Manager, within the MODX manager, I cannot see any instructions.
          I found _some_ instructions in the package itself in the modNsipset folder:

          @param &id The id of the document whose parent you want to find.\\n * @param &top The top node for the search.\\n * @param &topLevel The top level node for the search (root = level 1)\\n *\\n * @license Public Domain, use as you like.\\n *\\n * @example [[UltimateParent? &id=`45` &top=`6`]]\\n * Will find the ultimate parent of document 45 if it is a child of document 6;\\n * otherwise it will return 45.\\n *\\n * @example [[UltimateParent? &topLevel=`2`]]\\n * Will find the ultimate parent of the current document at a depth of 2 levels\\n * in the document hierarchy, with the root level being level 1.\\n *\\n * This snippet travels up the document tree from a specified document and\\n * returns the \\"ultimate\\" parent. Version 2.0 was rewritten to use the new\\n * getParentIds function features available only in MODx 0.9.5 or later.\\n *\\n * Based on the original UltimateParent 1.x snippet by Susan Ottwell\\n * <[email protected]>.

          Is this supposed to actually display somewhere in the GUI? It _is_ useful!


          Quote from: frogabog at May 11, 2013, 02:10 PM
          Don't forget the &level property. &level=`0` shows all the children and their children. &level=`1` as you have it in the call would just show the first level so you'll want to use &level=`2` to get the immediate children of the parent.
            • 10208 ☆ A M B ☆
            • 1,780 Posts
            The info that you found within the package, is actually the official documentation for UltimateParent.

            This may help, use the translator though (is in German).
            http://calidris.de/ottogal/ymodx/index.php?id=332

            Ottogal also has some helpful Wayfinder information there as well.
              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster
              • 43193
              • 9 Posts
              Hi,

              I am still lost... is there a spot somewhere where _all_ of the packages' official documentation goes, and it's easy to read, within my own MODX installation? Or in the MODX web site...?

              Merc.

              Quote from: frogabog at May 12, 2013, 01:37 PM
              The info that you found within the package, is actually the official documentation for UltimateParent.

              This may help, use the translator though (is in German).
              http://calidris.de/ottogal/ymodx/index.php?id=332

              Ottogal also has some helpful Wayfinder information there as well.
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                Quote from: mercmobily at May 13, 2013, 03:12 AM
                Hi,

                I am still lost... is there a spot somewhere where _all_ of the packages' official documentation goes, and it's easy to read, within my own MODX installation? Or in the MODX web site...?


                Unfortunately no. If the author submits it to the official Add On RTFM (http://rtfm.modx.com/display/ADDON/Home), you can find documentation there. If not, you'll find it either in core/components/someComponent/docs or assets/components/someComponent/docs

                Sometimes you will only find documentation in the snippet or plugin itself (such as UltimateParent).

                Typically, whoever authors the component will document it somewhere and that is usually listed in the package itself and in the Extras repository (http://modx.com/extras/). Sometimes the most comprehensive documentation is found on the author's website (such as http://bobsguides.com), sometimes that is the only place to find the docs.

                Sorry, not the answer you were looking for, huh?
                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster