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.