We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34001
    • 428 Posts
    Jean-Christophe B. Reply #1, 16 years, 1 month ago
    Hello,

    I want to define a default template or a default parent resource with form customization. But it seems that these fields are not available for customization, I don’t see them in the list of available fields: http://svn.modxcms.com/docs/display/revolution20/FC-Resource

    Is it a restriction of the system or am i missing something ?

    My intention was to automatically set a certain template if the user is creating a resource in a defined parent. For example, the user is creating a new article in a blog section and the "Blog" template is automatically defined.

    I thought i could do this with form customization, but it seems that’s not possible for the moment. Am i right ?

    Thanks in advance.
      Intégrateur web freelance
      • 34001
      • 428 Posts
      Jean-Christophe B. Reply #2, 16 years, 1 month ago
      Just another question: if it’s not possible with form customization, should I create a plugin for that ?
        Intégrateur web freelance
        • 28215
        • 4,149 Posts
        It’s definitely doable:

          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 34001
          • 428 Posts
          Jean-Christophe B. Reply #4, 16 years, 1 month ago
          Sorry, you’re right. It does work with templates. smiley

          But, what about the parent field ? Is there a way to assign a certain template only if the resource has a certain parent ?
          I’ve tried with the constraint field, but it does not seems to work. The rule is applied, even if the parent has not the defined ID.
            Intégrateur web freelance
            • 28215
            • 4,149 Posts
            That is definitely a bug, and one that’s been fixed in Git, and will work in 2.0.1:

            http://svn.modxcms.com/jira/browse/MODX-2238
            http://github.com/modxcms/revolution/commit/c0dbc3119ab0d7d98d0e9acdcb72fd3f820d266b
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 34001
              • 428 Posts
              Jean-Christophe B. Reply #6, 16 years, 1 month ago
              I’ve updated the affected files, the rule is now working perfectly.

              Thank you very much Shaun. smiley
                Intégrateur web freelance