We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37042
    • 384 Posts
    Could somone check the following screengrab for me?

    I'm trying to make any new resources of with a parent Container of 282 use a specific Template.

    AFAIK the Contraint Field and Constraint are setup properly but new Resources are not using the correct Template.
    My other rules regarding which TVs are visible are working but not the Template setting.
      ...
      • 3749
      • 24,544 Posts
      That should work, but only when you create new resources. If not, I'd say it's a bug.

      This might work as a plugin connected to OnDocFormPrerender:


      if ($resource->get('parent') == 282) {
         $resource-set('template', 12);
      }
      

      Change 12 to the ID of the template you want.
        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
        • 37042
        • 384 Posts
        Must be a bug. The correct TVs render when I manually change the Template but the resources default Template is not the one I requested.
          ...