We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19534
    • 183 Posts
    Hi there!

    Is there a way to set some default properties for resources which are created in certain container resource?

    For example if I’ve got a container called "news" I want all resources which are created in the "news" container to be hidden in the menu and to use the "news" template (which is not the default template) by default.

    Thanks for your help!

      Add-On to easily manage your multilingual sites: Babel
      • 28215
      • 4,149 Posts
      If you’re using Revolution, see Security -> Form Customization.

      If you’re using Evolution, see the ManagerManager plugin.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 19534
        • 183 Posts
        Hey splittingred!

        Thanks a lot! That’s what I was looking for!

        Setting the hidemenu field works great but unfortunately my rule to set the template field doesn’t have any effect.

        The template field isn’t listet in the docu as available fields (http://rtfm.modx.com/display/revolution20/FC-Resource)

        Is there really no way to change the default template via Form Customization?
          Add-On to easily manage your multilingual sites: Babel
          • 19534
          • 183 Posts
          Hmm, I just tried to use the field "template". The template field is set by my FC-rule but after a short time (less than a second) the template is automatically set to the template of the parent document (which is not the default template).

          Maybe there are to processes trying to set the default template of newly created documents: my FC-rule and a ModX-built-in rule which sets the template of the parent resource when creating a new document?(only an assumption)

          If needed here are my sysinfos:

          * Modx 2.0.3pl
          * ExtJS 3.2.1
          * Firefox 3.6.10 / same with IE8
            Add-On to easily manage your multilingual sites: Babel
            • 436 ☆ A M B ☆
            • 265 Posts
            Yeah, I discovered "template" worked too, has anybody figured out the field name for "Parent Resource", as I don’t really want my clients moving the Resources about from how I’ve organised them, I’ve tried "parent" and "parent_resource" and they don’t work.

            A useful tip, when doing form customisation you can add multiple values separated by a comma in the "name" and "value" fields, but sadly when the dialog box is expanded the fields don’t grow with the box sad

              MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
              • 19534
              • 183 Posts
              Hey!

              I’m still struggling with the problem mentioned two posts before. I build up a complete new modx installation to reproduce the problem:

              * Modx 2.0.3pl
              * ExtJS 3.2.1
              * Firefox 3.6.10 / same with IE8

              * create an additional template: Test (id 2) (BaseTemplate with id 1 already exists)
              * create a FC-Rule and set action="resource/create" name="template" containing panel="modx-panel-resource" rule="Field Default Value" value="2"

              Ok that works fine: When I create a new document under Home (id 1) the template is set to Test (id 2)

              And now my problem: When I add a constraint to the FC rule: constraint resource class="modResource" constraint field="id" constraint="1" the rule doesn’t work (like described in my post above):

              When I create a document under Home (id 1) I see 2 for a very short time (< 1 sec) in the template select box. Then the tempalte is set again to BasicTemplate (id 1).

              Is this a bug or am I doing something wrong??
                Add-On to easily manage your multilingual sites: Babel
                • 28215
                • 4,149 Posts
                This seems to be a bug. Can you file it here: http://bugs.modx.com/
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 28215
                  • 4,149 Posts
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 19534
                    • 183 Posts
                    Thank you very much for fixing it that fast!
                      Add-On to easily manage your multilingual sites: Babel
                      • 19534
                      • 183 Posts
                      Hey Shaun,

                      I applied the changes listet on http://github.com/modxcms/revolution/commit/2c67c2b8dcf56ad4cbeeef1bca3f7e4cbb61fee1

                      Then I created a FC-rule to set the default template with an constraint to apply this rule only on a certain resource. That works fine with your patch.
                      But when I add an additional FC for another resource (to set the template of its subresources, too) I have the some buggy behaviour like metioned above. Nevertheless the first FC-rule works fine.

                      Can you confirm this bug or did I make any mistake in patching my files?
                        Add-On to easily manage your multilingual sites: Babel