New in Tiki 21.0 - this provides an easy way to make fields in a tracker form show or hide (or be required or not) depending on the settings of other fields in the form.
is empty
, contains
and doesn't contain
like other "collection" fields, but for categories you need to enter the category Id's, not the names.
Note, this is an extremely new feature and should be considered rather fragile as of 21.0 (early 2020). Future changes in the code may mean you need to remake your rules after an upgrade.
In PluginTracker there are two new parameters, rules
and rulesparent
, rules
is a y/n switch so set that to y
, but rulesparent
is a little trickier on a customised tracker plugin form (leave it empty if you are not using a Pretty Tracker form in your page.
Assuming you are, you need to tell the rules which element is the parent container element for the field you are acting on (say, to show or hide it).
This form is a simple wiki table, so the container element is the tr
(table row) which contains the input and the label, so your selector will be simply tr
, but to make sure it doesn't get confused if the table's inside another one use tr:first
, so your markup should be:
{tracker trackerId="42" wiki="tracker test tpl" rules="y" rulesparent="tr:first"}
Related:
Alias names for this page:
Tracker Rules | TrackerRules | TrackerFieldRules | Tracker Rule | TrackerRule | TrackerFieldRule | Rule | Rules