We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36686
    • 165 Posts
    I'm experiencing some issues when trying to replace Wayfinder with pdoMeny to create a simple one-level menu.

    This is what I have for Wayfinder:

    [[Wayfinder?
        &startId=`0` 
        &level=`1` 
        &includeDocs=`1,16,26` 
        &hereClass=`selected` 
        &outerTpl=`navOuter` 
        &rowTpl=`navRowTpl`
    ]]


    This is what I would have thought would work with pdoTools:

    [[pdoMenu?
        &parents=`0`
        &level=`1`
        &resources=`1,16,26`
        &hereClass=`selected`
        &tplOuter=`navOuter`
        &tplParentRow=`navRowTpl`
    ]] 


    The problem is I don't get &tplParentRow=`navRowTpl`, which I would have thought was the equivalent of &rowTpl=`navRowTpl`, to work. It works if I remove &level=`1` and &resources=`1,16,26` however.

    I've also tried with &tplInnerRow and other options found in the documentation at http://docs.modx.pro/en/components/pdotools/snippets/pdomenu with no luck. What would the correct option in pdoMenu be to replace &rowTpl in this case?

    (MODX Revo 2.2.13 + pdoTools 1.9.2)

    This question has been answered by iusemodx. See the first response.

      • 36686
      • 165 Posts
      Duh! In answer to my own question, the correct replacement for &rowTpl was simply &tpl.

      [[pdoMenu?
          &parents=`0`
          &level=`1`
          &resources=`1,16,26`
          &hereClass=`selected`
          &tplOuter=`navOuter`
          &tpl=`navRowTpl`
      ]]


      It was just too easy wink

        • 36686
        • 165 Posts
        Ok, so, next question:

        Which placeholders are available for tplStart with pdoMenu? In Wayfinder I have this:

        <h2>[[+wf.title]]:</h2>[[+wf.wrapper]]

        I don't get the title to show with pdoMenu. Tried [[+title]] with no luck and also tried setting the prefix with &phPrefix.
          • 22840
          • 1,572 Posts
          Just looked for 30 mins and can't find the answer due to the fact most of the tutorials are in Russian, hopefully Susan will be along soon as I know she uses it and has reference to pdoTools on her cook book but I can't find that either, going to be one of those nights sad
            • 39404
            • 175 Posts
            stalemate resolution associate Reply #5, 9 years, 9 months ago
            Did you find this?: http://docs.modx.pro/en/components/pdotools/snippets/pdomenu

            Looks like it is a little sparse on the placeholders though.

            I also looked at this: https://www.youtube.com/watch?v=Cin46A24W8s
            and at 0:19, there is a setting within the pdoMenu snippet for plPrefix, which in the video is set to "wf." Make sure yours is and try your snippet call again.

            Regards,
            Tom
              • 36686
              • 165 Posts
              Thanks for your advice guys! After some trial and error I finally got the placeholder to work simply by replacing "title" with "pagetitle". Both [[+pagetitle]] and [[+wf.pagetitle]] seems to do the job, without even setting the phPrefix.

              Also, to get rid of the wrapping <ul> around the title I had to add &tplOuter and &tplInner. My final snippet call:

              	                	[[pdoMenu?
              					&parents=`[[UltimateParent]]`
              					&displayStart=`1`
              					&tplStart=`@INLINE <h2>[[+pagetitle]]:</h2>[[+wrapper]]`
              					&tplOuter=`@INLINE [[+wrapper]]`
              					&tplInner=`@INLINE <ul>[[+wrapper]]</ul>`
              					&level=`1`
              					&hereClass=`selected`
              				]]


              I guess the placeholder "title" is specific to Wayfinder. It would no doubt be useful with a list of placeholders for pdoMenu in the English documentation, and some more advanced examples. I would have thought replacing Wayfinder with pdoMenu would be done in a jiffy but it's taken me hours. Let's hope the result is worth it though smiley
                • 22427
                • 793 Posts
                From the Wayfinder Documentation:
                wf.title
                the title text for the link, from the field as specified in the &titleOfLinks parameter

                The placeholder [[+wf.title] is used for the title of a link (which shows up on hovering over the link), e.g.
                <a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>
                It defaults to [[+pagetitle]], but can be modified by the property &titleOfLinks:
                &titleOfLinks
                The field to get the link title from.
                Possible values: menutitle, id, pagetitle, description, parent, alias, longtitle, introtext
                Default value: pagetitle
                  • 36686
                  • 165 Posts
                  @ottogal: Yes this is how Wayfinder does it, but do you know if there is an equivalent in pdoMenu or which placeholders can be used?
                    • 22427
                    • 793 Posts
                    Sorry, I don't know pdoMenu enough to have an answer.
                      • 13226
                      • 953 Posts
                      Quote from: sketchi at Jul 31, 2014, 10:28 AM
                      @ottogal: Yes this is how Wayfinder does it, but do you know if there is an equivalent in pdoMenu or which placeholders can be used?

                      I am not sure if you ever got this problem sorted but I am currently converting from Evo to Revo and use the title tag in my wayfinder template

                      I have now found out how to use the href title tag / placeholder in pdoMenu, here the relevant elements:

                      [[pdoMenu? 
                      &plPrefix=`wf.`
                      &titleOfLinks=`longtitle` 
                      &tpl=`@INLINE <li><a href="[[+link]]" title="[[+wf.title]]" [[+attributes]]>[[+menutitle]]</a></li>`