Tracker Field Rules

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.

Some brief instructions:

Notes on Field Types


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.

Using Field Rules in a Wiki Page (with Plugin Tracker)

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:

Copy to clipboard
{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

History Source