We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47562
    • 113 Posts
    I'm in need of advice on Wayfinder usage.

    I have the following resource structure:

    siteroot
     category1
      subcategoryA
       topicA
       topicB
       topicC
       ...
      subcategoryB
      subcategoryC
      ...
     category2
     category3
     ...


    Due to factors unrelated to the menu itself (for instance, an advertisement blurb that needs to be rendered for each category, the components of which are captured in MigX), I've split the wayfinder generation into two levels: that for generating the category levels (iterating over category1, category2, etc), and that for the subcategories/topics under each of those categories.

    Ok, so the menu pulldown content shows up just great (the resource menu text and ads appear just as expected). The problem is that the urls being produced are missing levels.

    For instance, for subcategoryA, I see a url of siteroot/subcategoryA, where I'd like to see siteroot/category1/subcategoryA.

    Same thing for the topics: I see siteroot/topicA, but would like siteroot/category1/subcategoryA/topicA

    The links that are being produced work just fine, and I think I understand why they're being generated that way, but can anyone suggest an approach to get the intermediate levels filled in, given the split in wayfinder calls? (I've been considering calling on a snippet to adjust [[+wf.link]] manually, but that seems to defeat the purpose a bit). Is this a situation best handled by getResources or some other tool instead?

    Any suggestions/guidance greatly appreciated...

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

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You could try using the &displayStart property when generating your inner levels, and juggling its outerTpl and startItemTpl chunks. For example, the outerTpl can omit the closing </ul> tags, and the startItemTpl can have the <li> tags for the start item and the closing </ul> tag. Just be careful to use the wf.wrapper in the right places to get the rest of the menu generated.
        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
        • 47562
        • 113 Posts
        Thanks Susan. I see where you're going with this; I'll mess with it a bit to see if I can't get it tweaked in the right direction. Appreciate the help...
          • 47562
          • 113 Posts
          Okay, based on the fact that a call to makeurl for subcategoryA returns "siteroot/subcategoryA", this is not a wayfinder question, per se, but perhaps an issue of configuration (or even more likely, a complete lack of understanding on my part with regard to how things are designed to work).

          Looking at makeurl, I don't see any mechanism for producing something that includes the nested containers in question, so maybe I'm just completely missing the mark here.

          So a simpler set of questions: Is my "siteroot/category1/subcategoryA" url producible using core functionality? If so, via what call(s)? And if not, has anyone else had need of such links, and what did they use to produce them?

          Thanks very much for any help/info.
            • 47562
            • 113 Posts
            Is there some setting that would prevent containers from showing up in menus? I'm stumped, and it's happening across the board...
            • discuss.answer
              • 22427
              • 793 Posts
              Just guessing: Check your System Settings.
              Perhaps the setting "use_alias_path" is set to No, should be Yes.
                • 47562
                • 113 Posts
                Quote from: ottogal at Jul 02, 2014, 12:57 AM
                Just guessing: Check your System Settings.
                Perhaps the setting "use_alias_path" is set to No, should be Yes.

                Ugh! Thank-you, that took care of things!

                Still figuring out some of the ModX intricacies... smiley