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

    I’ve been needing a feature for letting a child document inherit the template from its parent.

    This would really ease working with multiple templates and even make it easy to have multiple domains/sites within a single MODx installation.

    This should’nt be very hard to code in for v1.0.3 smiley

    If you want me to code it let me know.

    Should work like this:

    1. Create a static template option for all documents named "Inherit". Warn people when they change template for a document that has inheriting children.

    2. Make the option for default template read as follows:

    a. Default template: <select>[Inherit][TemplateWithName1][TemplateWithName1][TemplateWithName...]</select>
    b. Root document template if root document set to inherit: <select>[TemplateWithName1][TemplateWithName1][TemplateWithName...]</select>

    3. Code the functionality into MODx and maybe remove the "reset ressources..." for template options as it is no longer needed.

    Thanks for your time and an absolute GREAT CMS.

    This great idea came from Pe smiley

      • 27708 MODX Staff
      • 2,502 Posts
      Not sure if I understand what exactly you are looking for. There is a plugin that ships with Evo called InheritParentTpl that when enabled will automatically set the child template to that of the parent. My preferred method is to use a variation plugin called InheritSelectedTpl (available in the Extras Section) that offers a TV list of available templates to choose for child documents. This is ideal for things like news or blogs where the parent will be using one template but all created children another.

      Let me know if there are more features I am missing.

      Cheers,

      Jay
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 23566
        • 2 Posts
        Thanks. InheritParentTpl is just what i need.

        Only, doesnt this feature belong in MODx options and not in a plugin?

        In my opinion it is confusing for a newbie MODx user to have plugins doing stuff, that really should be a MODx feature.

        If you activate InheritParentTpl in a standard installation of MODx, then the system is "broken". A newbie user will not be able to find out why his settings for default template is not working. A seasond MODx user will know that it is because InheritParentTpl over rides any thing set in options, but the newbie will be clueless and not have a good time using MODx. This is not good thing.

        Am I understanding the issue correctly or missing something?

        If correct, I stand by my wish for the new feature to be built into MODx Evo.

        Have fun, Peter
          • 27708 MODX Staff
          • 2,502 Posts
          I see your point. There is a default behaviour for MODx in the System settings: Default Template and then InheritParentTpl is on by default it is countering the supposed default behaviour it is somewhat broken.

          Can you post a feature request to Jira? This is in fact something that should be considered for future release.
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub