We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38462
    • 39 Posts
    Is it possible to call a Wayfinder menu inside a static resource?
      • 22427
      • 793 Posts
      My first thought: Of course!
      Then I tried it: It works - of course... ;-)
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        What are you trying to do?
          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          Static resources work just like document resources. All MODX tags work in static resources. Static resources simply tell MODX to use a file for it's content instead of the content area within MODX. Actually, that's not 100% true because if you modify the content area of a static resource in MODX, the file itself is also modified. Conversely, if you modify the static resource file, the content area in the resource updates to reflect the modifications.

          Be careful changing documents to static resources. If you have content in the resource, delete it before switching to static. If you delete it after saving as static, but before the static file contents show in the content area, you could delete the contents of your file.
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 38462
            • 39 Posts
            Thanks for your help guys. @AMDbuilder I have 2 webpages (resources) that need to have a slightly different page structure to the rest of the site, for which I am using a generic template. However I want to still keep the dynamics of Wayfinder.

            Converting these to pages to static resources should solve this for me. Just about to dive in and give it a whirl.

            Once again thanks.
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              You could just as easily use a second template for these pages. Modify the main template to fit with your alternate structure, which could also be a static resource. In fact, I prefer the templates to be static so that I can edit outside of MODX.

              You could adjust your templates to use chunks for your global sections so you can change heads and footers on the fly.

              Make the chunks static as well, if you like. In fact, your Wayfinder menu could be a chunk, which you could then use in the site_header chunk (handy if you had two different Wayfinder calls to use).

              Insert the
              [[*content]]
              into a static file where appropriate for the mid section of the page.

              Then your template itself would look something like this:

              [[$site_header]]
              [[$basic_page]]
              [[$site_footer]]


              And your alternate template could be:

              [[$alt_site_header]]
              [[$alt_page]]
              [[$site_footer]]
              [ed. note: frogabog last edited this post 13 years, 9 months ago.]
                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster