We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36575
    • 104 Posts
    I have used ultimateparent in the past to set up navigation on a page (eg on the left hand side, navigation for one category). However, when I try and use it on a site with contexts, it goes right up to the root, and counts the context as the ultimate parent, and therefore returns me the "top level" navigation, not the navigation of one section. I guess with contexts I need the penultimate parent.

    Anyone know how I get around this?
      • 36632
      • 202 Posts
      Do you have site_start in the context's settings?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        When working with contexts, don't overlook the usefulness of creating unique settings for each context, and remember that "web" is only a default context, no more important than your other contexts. Context settings will override global system_settings for that context. This is an extremely important and powerful part of the MODx architecture, and I think too often overlooked.
          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
          • 36575
          • 104 Posts
          My issue is in the default web context - I have not actually tested in other contexts yet. My site start is 1.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            The UltimateParent snippet has a property to indicate how many levels from the "top" you want to stop at.

             * @example [[UltimateParent? &topLevel=`2`]]
             * Will find the ultimate parent of the current document at a depth of 2 levels
             * in the document hierarchy, with the root level being level 1.
            
              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
              • 36575
              • 104 Posts
              Thanks Susan! I could have sworn I tried that, with no success, but I just tried again and it worked. Thanks again.