We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10512
    • 28 Posts
    Hello-

    I am working on my first ModX site. I am using Wayfinder for my navigation with a top level menu that only shows the main sections, and a sidebar menu that shows the subsections of the site. I have that working just fine, thanks to the awesome forums here. I would like the sidebar menu to have the main section name at the top. For instance the top menu looks something like this:

    Home | Events | History | About

    And the sidebar menu contains the subsections of each main section. I would like to call the page name of the main menu page and have it stay at the top of the sidebar, which is generated by Wayfinder as well. (for instance, Events will always be at the sidebar top of the events subpages) Here was what I tried first:

    <div id="sidebar">
    		
    			<h2>[*pagetitle*] </h2>
    			[!Wayfinder? &startId=`[[UltimateParent]]`!]
    		
    	</div>
    	<!-- end #sidebar -->


    But [*pagetitle*] returns the page title of the active document. I would like to know how I return the "Parent" pagetitle...I am sorry if this is a silly question but I don’t know the right syntax. I am reading the forums, wiki, and other documentation as fast as I can- but I am really new to this although I can usually figure things out eventually wink

    Any help appreciated,
    Catherine
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      There is a parameter for the Wayfinder call that displays the parent’s title in h2 tags by default, it’s &displayStart=`1`

      I used it here: http://loripsum.co.uk/seashells.html
        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
        • 10512
        • 28 Posts
        Thank You!!! Perfect!

          • 32830
          • 21 Posts
          I think you could also just use [*pagetitle*] to achieve this.
            • 10512
            • 28 Posts
            Susan gave a good way to do this. The reason that [*pagetitle*] would not work in my case is because I wanted the "Main Menu" title dynamically inserted at the top of the sidebar menu throughout each entire section, with the sublinks inserted dynamically below with Wayfinder.

            [*pagetitle*] did not work for my heading display because it returns the name of the active document, not the container or parent. That was the first thing I tried too! smiley

            This parameter in Wayfinder that Susan gave: &displayStart=`1` accomplishes exactly what I wanted- the Main Section shows up in the header tags at the top of my sidebar, no matter what sub page I am on.

            Catherine
              • 32830
              • 21 Posts
              Oh, I totally understand now.
              Thank you for taking the time to explain that! It’s helpful as I’m still trying to get my head around everything wayfinder can do.

              I once believed that my menu was so convoluted, it was impossible to achieve with modxcms. A little extra research proved me happily wrong. I’m now a believer that modxcms can do anything if one is willing to just figure it out.
              Take care, ned