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

    I am pretty new to modx, so sorry if this question is silly. I have a page/resource that I want to display in one of two templates depending on how the user got to that resource. The user would click a link where they can get more information on a specific topic, but when they click, I want to pass whatever template the user is currently using so that the next page is using that same template. Like I said, there are two different templates that the user could be using. How would I be able to do that?

    Thanks.
      • 3749
      • 24,544 Posts
      One way to do that is to just a duplicate of the page (with a different template specified) and then put the appropriate link on the pages that users will be coming from. It’s inefficient and a pain to maintain, though.

      As an alternative, you might consider using the same template, but a different CSS file. It’s easy to have a snippet that will detect the referring page and inject the correct CSS into the <head> of the page with $modx->regClientCSS().

      If you can be more specific about exactly what’s different about the two templates, we can probably give you better advice and maybe a simpler way to go.

        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