We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24278
    • 165 Posts
    Dear Member,

    I have a folder called "Organization" (UnPublished + uses a Blank tempalate) and contains the following documents... about, the staff, the volunteers, contact, donate, terms of use, privacy policy.

    I need to show "about, donate, contact" in the header region of every page and... show about, contact, donate, terms of use, privacy policy in the footer region of every page.

    What is the best way to achieve this?

    Thank you for your suggestion,

    regards,

    -Raavi
      • 25663 MODX Staff
      • 12,272 Posts
      If the pages in that section really won’t be changing frequently, just hard code them into your template or in a chunk; there’s no real need to use a dynamic menu builder. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 10487 MODX Staff
        • 1,535 Posts
        I’d agree with Ryan but if you’re just dying to use DropMenu then I know one solution that people use is to create a separate folder for the header and footer navigations.

        Create weblinks in these folders to the main documents, and use DropMenu to generate your menus from these header and footer folders.

        Hope that helps, Garry
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com
          • 24278
          • 165 Posts
          Thanks a lot rthrash and garryn,

          I appreciate your suggestions. I have hard coded the links but new problem is this... how do I trap, that the hard linked document is the current document so that it can styled differently.

          Do i need to check it in a snippet and supply the chunk which calls the snippet with a class="here" or is there a better way to do it?

          regards,

          -raavi.
            • 10487 MODX Staff
            • 1,535 Posts
            Hi raavi - Yes, you’ll need to use a snippet to render the links for this.

            In the snippet, place your page URLs into an associative array so the key values are the page IDs, then use a foreach loop to output each of the menu items.

            This way, you can compare each page ID in the array to the current page ID - obtained using $modx->getDocumentIdentifier(’id’) - and render the ’here’ class if you get a match.

            Hope that helps, Garry
              Garry Nutting
              Senior Developer
              MODX, LLC

              Email: [email protected]
              Twitter: @garryn
              Web: modx.com
              • 24278
              • 165 Posts
              Thanks again, garryn. That was really quick. I appreciate that.

              regards,

              -Raavi.