We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36541
    • 222 Posts
    Revolution 2.0.0-pl r7210.

    I need to set default values to some template properties, mainly [tt]hidemenu[/tt] and [tt]alias[/tt], so all new documents based on a template are hidden from menus and use specified alias scheme. I thought property sets could be used, but they seem not to work with templates this way.

    What can you advice?
      This is the web: the only thing you know about who will come is that you don't know who will come.
      • 28215
      • 4,149 Posts
      Use Form Customization, with a Template constraint.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 36541
        • 222 Posts
        Thanks, it works. However: 1) it affects all templates, not only the one I specified 2) it’s not effective when using Quick Create menu command.

        Here’s the rule:

        Action: core - resource/create
        
        Name:             hidemenu
        Containing Panel: modx-panel-resource
        Rule:             Field Default Value
        Value:            1
        
        Constraint Class: modTemplate
        Constraint Field: id
        Constraint:       2
        


        The template in question has id 2. Is the above constraint correct?

        When creating a new resource the default template is used (id 1) and the [tt]hidemenu[/tt] is checked. I expect it to get checked when selecting the template with id 2? Is that, how it’s supposed to work?
          This is the web: the only thing you know about who will come is that you don't know who will come.
          • 36541
          • 222 Posts
          I was studying FC-Resource Available Fields and noticed that the following are not taken into account:


          • Resource Alias ([tt]alias[/tt])
          • Parent Resource ([tt]parent[/tt])
          • Deleted ([tt]deleted[/tt])

          All those can’t be affected by Form Customization. Is this intentional?

          Also, is there any documentation on Constraints usage?
            This is the web: the only thing you know about who will come is that you don't know who will come.
            • 36541
            • 222 Posts
            Bump.
              This is the web: the only thing you know about who will come is that you don't know who will come.
              • 3749
              • 24,544 Posts
              Quote from: gadamiak at Jul 28, 2010, 05:11 AM

              I was studying FC-Resource Available Fields and noticed that the following are not taken into account:


              • Resource Alias ([tt]alias[/tt])
              • Parent Resource ([tt]parent[/tt])
              • Deleted ([tt]deleted[/tt])

              All those can’t be affected by Form Customization. Is this intentional?

              Also, is there any documentation on Constraints usage?

              I think they were just left off the list. They would probably work if you used them.

              Constraints (scroll down): http://rtfm.modx.com/display/revolution20/Form+Customization+Rules
                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
                • 36541
                • 222 Posts
                Quote from: BobRay at Aug 18, 2010, 03:47 AM

                I think they were just left off the list. They would probably work if you used them.

                I did and they didn’t work.

                Constraints (scroll down): http://rtfm.modx.com/display/revolution20/Form+Customization+Rules

                Thanks! I must have overlooked it. That’s exactly what I needed.
                  This is the web: the only thing you know about who will come is that you don't know who will come.