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

    I'm fairly new at using Mod x in website development and I haven't actually been heavy into web development for a few years so I'm a little rusty around a few things, but i'm catching up quickly.

    This is the second time I've used Wayfinder for menu creation and I'm a little confused on some behavior that I'm experiencing.

    I'm trying to create rows of 4 Icon based menus for a splash page, the templates work well and produce what I desire, though the Wayfinder call I use to have it work is not conventionally shown online. The call is:
    [[Wayfinder? &startId='2' &outerTpl=`splashMenuContainer` &rowTpl=`splashMenuRow` &limit=`4` ]]
    


    Those aren't backticks being used in the &startId, if I use backticks wayfinder doesn't output anything at all on the page. But with that it produces the menu I want, but doesn't start at the page ID I want it to start at. I've tried a few things just messing around and can't seem to have it function correctly.

    Where am I going wrong?
    (note I'm using MODX Revolution 2.3.3-pl (traditional))
      • 5430
      • 247 Posts
      Never gonna work without the backtics. Have you tried moving &startId=`2` further down in the call so it appears after one of the other parameters (order isn't important)? If so, did Wayfinder ignore the first parameter in the chain regardless? Are you making this call inside a rich-text editor or in a page with rich text turned off? if it's inside a rich text editor, there's a good chance the editor is messing with you.
      • Property values must be surrounded with backticks, without exception. The reason it generates something with single-quotes is that it ignores the property and falls back to default, the current resource - whichever one you requested from the browser. What happens if you request resource #2 from the browser with the startId removed from the snippet's property list?

        Are you sure that resource #2 has children? The children are published? Their Hide from Menus checkbox is clear? Is the CSS and Javascript used for your menu hiding them for some reason? Check the View Source of the resulting page to make sure the menu is really not being generated.

        Something to keep in mind when working in the Manager. A logged-in Manager user can see unpublished pages, but the listing snippets like Wayfinder and getResources still won't list them.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
        • Rich Text editors like TinyMCE will convert the property list's "&" to its HTML entity, but MODX will make allowances for that. Sometimes, though, the RTE gets overzealous and will double up on the conversion, which MODX can't deal with. Check its raw HTML view to see what it's doing to your snippet's property list.

          One way to avoid this is to use Property Sets, then your snippet call will look like this
          [[Wayfinder@PropSetName]]


          http://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/properties-and-property-sets
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 50589
            • 3 Posts
            Well I replaced the quotation marks with backticks and again the only instance where the menu will load is when I set the startid to 0, otherwise no menu is produced. All the resources I've set to published and none of them are configured to be hidden from menus.
              • 38723
              • 165 Posts
              Quote from: chriskraz at Jun 11, 2015, 01:43 AM
              I'm trying to create rows of 4 Icon based menus for a splash page, the templates work well and produce what I desire, though the Wayfinder call I use to have it work is not conventionally shown online.

              If these are just icons for a splash page, it's not really a menu as you'll never need the 'menu functionality' of things like 'active items' and such. In this case, I'd not even use Wayfinder, and instead use pdoResources, or the older and slower getResources instead. I'm assuming the 'splashMenuContainer' is just an outer ul or similar?

              <ul>
              [[pdoResources? &parents=`2` &tpl=`splashMenuRow` &limit=`4` ]]
              </ul>