We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30521
    • 1 Posts
    Is there any way I can create a page named menu.php that has the wayfinder menu for my modx site embedded in it so I can use a php include in an html page to include the menu on that page?
      • 22427
      • 793 Posts
      Why do you want to include a php-file? Just put your WayFinder call into a Chunk (say named WFcall), then insert {{WFcall}} in your templates whereever you want to see the menu.
        • 3749
        • 24,544 Posts
        Quote from: tradelog at Oct 08, 2009, 08:30 PM

        Is there any way I can create a page named menu.php that has the wayfinder menu for my modx site embedded in it so I can use a php include in an html page to include the menu on that page?

        MODx won’t run PHP for a page unless it’s contained in a snippet. This is *much* more secure than embedding PHP in a page, or using "include."

        The standard method is to create a Template and put the Wayfinder call in the Template. That way it will appear on any page that uses that Template.

        The site in my sig might be helpful.

          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 18338
          • 31 Posts
          Quote from: tradelog at Oct 08, 2009, 08:30 PM

          Is there any way I can create a page named menu.php that has the wayfinder menu for my modx site embedded in it so I can use a php include in an html page to include the menu on that page?

          To include a wayfinder menu on static pages outside of modx, create a new page (in modx) with a blank template and turn off the rich text editor, then put your wayfinder call in the content section. That should leave you with a page you can include from anywhere outside of modx that you need the menu.