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

    I’m trying to create a rule to hide the default content field but when I go >Security >Form Customization I can’t see an a way to add a rule - just a button to create a new profile.

    Also, the docs here: http://rtfm.modx.com/display/revolution20/Customizing+the+Manager

    Don’t really explain the process of creating a rule - is there info in this?

    Cheers

    Ben
      • 33337
      • 3,975 Posts
      Currently, Form Customization has 3 layers:

      Profile -> Sets -> Rules
      First create profile, then a set, then u will be able to create a rule.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 3749
        • 24,544 Posts
        Right-click to edit them.
          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
          • 5532
          • 251 Posts
          Thanks heaps - been away from Modx for a few years but Modx is still the best community around!

          The docs have also improved which is impressive - but should this page here:

          http://rtfm.modx.com/display/revolution20/Form+Customization+Rules

          Be available from the form customization pages which currently only talk about profiles/sets and not rules?
            • 36225
            • 20 Posts
            Right-click to edit them.
            Right-click on what?

            Right-click on a set gives: Edit, Duplicate, Export, Deactivate, Remove.
            Right-click within a set doesn’t offer any Add rule?
              • 3749
              • 24,544 Posts
              On the profile screen, click on the "Create New Set" button and the rule dialog will come up.
                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
                • 36225
                • 20 Posts
                When I click on Create New Set, I do get the popup Create New Set (see attachment) and not the on titled Create rule.
                  • 3749
                  • 24,544 Posts
                  Sorry, it’s been a while since I created any actual rules.

                  You need a profile to create any sets, and you need a set to create any rules.

                  Here’s an example from the book that covers setting the default value of a TV:

                  To set the default value of tv one for the Editors user group, we first need to create a profile for that group. Go to Security ð Form Customization, and click on the “Create New Profile” button.
                  Set the following fields:

                  Name: EditorProfile
                  Description: Form customization rules for Editors
                  Check the “Active” checkbox, and click on the “Save” button. Now, right-click on the Editors profile in the grid and select “Edit” from the drop-down list. This will take you to the Sets grid.
                  Click on the “Create New Set” button, and set the following fields:
                  Action: Create Resource
                  Description: Rules for new resources
                  Constraint Field: Leave blank
                  Constraint: Leave blank

                  Make sure the “Active” checkbox is checked, and click on the “Save” button. Click again on the “Create New Set” button, and set the following fields:

                  Action: Update Resource
                  Description: Rules for existing resources
                  Constraint Field: Leave blank
                  Constraint: Leave blank

                  Make sure the “Active” checkbox is checked, and click on the “Save” button.

                  Note that we left the template field blank so that our rules would apply to all templates. In many cases, however, you might want to tie the rule set to a particular template. Doing so will speed up the Manager for pages using other templates since MODX won’t have to check the form customization rules for those pages.

                  To attach the rule sets to our Editors user group, click on the “User Groups” tab at the top of the grid and then click on the “Add User Group” button. Select the Editors user group in the drop-down list, and click on the “Save” button in the pop-up dialog. Next, click on the “Save” button at the upper right. If you forget this second save, MODX will not attach the rule set to the Editors user group. Notice that we could have attached our rule sets to more than one user group here. Click on the “Save” button to save the set.

                  Now it’s time to create our rule. Click on the Profile tab to return to the rule set grid. Right-click on the “resource/create” rule set and select “Edit” from the drop-down list. This will take you to the rules grid. You’ll see fields at the top that allow you to set a template and constraints for the rule set, but don’t change those now.

                  Notice that there are three tabs at the top: Set Information and Fields, Tabs, and Template Variables.

                  On the Set Information and Fields tab, you can see a list of all the page settings fields in one part of the grid and the resource fields in another part. The Resource Content field has its own section of the grid. Using the grid, we could change the Label, visibility, and default value for any field.

                  On the Tabs tab, you can create a new tab for the Create/Edit Resource panel or set the title and/or visibility of any tab.

                  We want the “Template Variables” tab, so click on that. You should see your template variables in the grid. The grid shows the name of each, whether it is active, whether it is visible or not, its Label, its Default Value, its Original Value, the name of the tab it appears on, and the rank of that tab. The Original Value is the default value of the TV itself (if any), and the rank determines where the TV tab appears among the tabs of the Create/Edit resource panel.

                  Double-click on the “Default Value” column for TV One. Set a different value than the Original Value. If there are Input Option Values settings for the TV, be sure to use one of them for the Default Value. Click on the “Save” button. We could create the same rule for the resource/update set, but there’s no point because TV default values only apply when a new resource is created.
                    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
                    • 17016
                    • 138 Posts
                    Hi Bob,

                    thanks for this very good explanations.

                    Beside this do you know any reason why two different profiles for two different user groups can interfere to each other like I described hier:

                    http://modxcms.com/forums/index.php/topic,67036.0.html

                    Is there anything we maybe did wrong?

                    Letti
                      • 3749
                      • 24,544 Posts
                      Quote from: Letti at Jul 25, 2011, 05:46 PM

                      Hi Bob,

                      thanks for this very good explanations.

                      Beside this do you know any reason why two different profiles for two different user groups can interfere to each other like I described hier:

                      http://modxcms.com/forums/index.php/topic,67036.0.html

                      Is there anything we maybe did wrong?

                      Letti

                      I’m sorry, I don’t know the answer to that. It seems to me like that should work. Permissions are inherited from users with a higher authority number, but that should only happen when they are in the same group. A group-specific FC rule should only affect users in that group.
                        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