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

    My site has two sections: Alpha, and Beta. Each section has its own template. These two sections share a common page: Theta.

    What I am trying to do is: If the user is viewing the Alpha section and clicks on the Theta page, then the Alpha template is used. If they are viewing the Beta section and they click on the Theta page, then the Beta template will be used.

    Is that possible? If yes, how can I implement that? If no, then, what is the work around (other than duplicating all the common Theta pages)?

    Thanks in advance.
      • 31381
      • 31 Posts
      some ideas:

      - what about cookies -> save the start template and let modx get that information
      - what about a GET in the domain (if theta won’t be an entrance site)
      - ajax could do that to - so theta will always be load via ajax instead of load a whole new site
      - a hidden-inputfield could do it via POST

      How do users get to the thera page and should that only be one page or a section?
        • 10449
        • 956 Posts
        I’d leave the template in the backend alone. What you want to do is actually change the CSS-reference, depending on user-choice.

        You can do that in a number of ways: $_GET parameter + snippet (PHP), Javascript, Cookies, PHP session variables...