We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22427
    • 793 Posts
    Hi all!
    Given the following resource tree:
    web
    |___Home       (1)
    |___weblink1  (44)
    |___weblink2  (55)
    |___....
    |___subtree   (33)
         |__....
             |__....
         |__....
             |__....

    Both the weblinks point to the resource (33) which shares the same template with all its children.
    But when called via weblink2, the subtree should be invoked using an alternative template (again the same for the whole subtree).

    What would be the best way to achieve this?

    MODX 2.2.0-pl2 (trad)
    [ed. note: ottogal last edited this post 12 years, 3 months ago.]
      • 3749
      • 24,544 Posts
      Weblinks always use the template of the target. Symlinks use the template of the Symlink.
        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
        • 22427
        • 793 Posts
        I see. So using symlinks instead of weblinks: How to ensure the children of (33) will inherit the template imposed by the symlink to resource (33)?
          • 3749
          • 24,544 Posts
          I believe the InheritParentTemplate would do it. The template is set when the resource is created.


          ---------------------------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
          MODx info for everyone: http://bobsguides.com/MODx.html
            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
            • 22427
            • 793 Posts
            InheritParentTemplate
            What is this? As an Addon I only found Inherit Selected Template.

            In Evo 1.0.5 there was a configuration option "Automatic Template Assignment". I would have expected to find an analogue option in the System Settings of Revo.
            • When you create the child it will be assigned the template of its parent. If you change the template of the parent, that won't change the template of its children. The template setting is done upon resource creation. TVs @INHERIT binding works differently since the resource's TV value is stored in a separate table while the template is indicated by a field in the site_resource table along with the other resource values.

              Changing templates on-the-fly doesn't work if the page in question is cached, as the page's template is never checked if it's set to be cached and its cache file does exist. Although I don't know anything at all about how weblinks and symlinks work in Revo, so there must be some mechanism for dealing with that.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org