We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11449
    • 28 Posts
    So I have been using form customization to force all children of a resource to use a different template than the parent. To do this I have to place the ID of the template I want used on the children in the default area for the "template" on a form customization set that is applied to the parent template. I do this on one set for "Update Resource" and on a second identical set for "Create Resource".

    Then by setting the template manually on the parent (through editing the resource in the manager) to something other than the default I can have a parent with one template, and the children inherit a different template. But I have a major problem, and I'm assuming its a bug.

    The TVs of the child template are what show up when editing the parent, even though the parent is being displayed on the front-end with its template. I had assumed this was just the quirky way that this option was implemented. And it seems to work ok with an ImagePlus TV, but today I added a listbox (multi-select) TV to the parent template, for it to show up while editing the parent I had to also add it to the child template. When I use it as soon as I save the resource the template is changed from the parent template to the child template.

    This totally breaks my use case. None of this would matter if MODx had a less retarded way of letting me set a default template for children of a resource. Any help would be appreciated, I hope my explanation makes sense.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Here's a plugin that has a resource use its siblings template. https://gist.github.com/pepebe/d5b776c0d1221c33f426

      You might also be interested in Collections, which allow you to specify the template of the children of the Collections container.
        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