We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28309
    • 12 Posts
    Sir,
    I have 1000 document and client has given me 5 different designs, which i have to integrate into the documents.
    At present I have a default template basetemplate for all t1000 documents.

    I want to switch the document template on the basis of the user setting similar like orkut.
    i.e.
    $mydesign=1; then i will show the document with design 1.
    $mydesign=2; then i will show the document with design 2.
    $mydesign=3; then i will show the document with design 3.

    So that I do not have to create another 1000 document for each design given by the client.
    I am using the friendly url and do not want to change the path of the document.
    The site is in the development stage.

    How I can achieve it ??

    My configuration are below.

    MODX
    Your latest and current version.
    I am adding tables and fields for my project.
    reducing the plugin and the
    Web Server:
    * PHP version 5.2.x)
    * Apache2
    * RHEL4
    (Shared webhosting)

    Database:
    * MySQL 5

    Browser/Client:

    * Moxzila firefox(1.5,2,3),Internet explorer(5.5,6,7,8),chrome,opera ,safari (current versions)
    * MS Windows98,Xp,Vista and Mac[b][/b]
      • 28309
      • 12 Posts
      Thanks ganeshXL.
      I was not aware of the activestylesheet function.
      but the designs are drastically different from each other.
      contents an the place of content both are changed.
      the divs and and css have different naming conventions and
      three of the five design are id based not class based.

      Although i got an idea some thing similar to you that
      I will be placing design in cookie or session.
      all my document will be using the same base template.
      in base template i will put a snippet call which will decide on the basis of session value
      which template file to include.

      I need to do some small things for PROOF OF CONCEPT. It’s Appropriateness,speed and other thing.

        Thanks again..

        • 3749
        • 24,544 Posts
        This is off the top of my head but I think you could create a plugin that would reset the page’s template based on a $_SESSION variable, system setting, or whatever, before the page is rendered. I think having the plugin triggered by the OnLoadWebDocument event might work.
          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