Loading...
 
Skip to main content

History: PluginTrackerToggle

Source of version: 27 (current)

Copy to clipboard
            {syntax type="markdown"  editor="wysiwyg"} See also: ((Tracker Field Rules))

# Plugin TrackerToggle

*Introduced in ((Tiki7))*

This ((wiki plugin)) utilizes jQuery to toggle the visibility of an HTML element (like a div) depending on the value of a field. This plugin can be used in ((Pretty trackers)) (but it is not meant to be used with ((pluginLIST)) ). This plugin permits ((Dev:Display logic)).

## Parameters

{pluginmanager plugin="trackertoggle"}

### Note

- Category needs categId not categName to match
- If you use a field more than once in a template (e.g., `{$f_180}` ) only the first one on the page will be functional
- Only one plugin TRACKER of the same trackerId may appear on the page
- Only fields with a text value or checkbox (y/n) are functional prior to ((Tiki11))

## Examples

### Radio buttons

This code will show the div *success* only if the field 206 has the value "Show". When the field is not set yet, the div is not displayed. 
{CODE(colors="tiki")}
{DIV(id="success")}Congratulations! The "success" div now shows.{DIV}
{trackertoggle fieldId="206" value="Show" visible="y" id="success"}
{$f_206}
{CODE} 
Result: 
{tracker trackerId="18" wiki="PluginTrackerToggleExample1Template" formtag="n"}

### Show only if checkbox is checked

This code will show the div 'checkbox' only if the checkbox is checked. When the box is not checked, the div is not shown 
{CODE(colors="tiki")}
{DIV(id="checkbox")}The checkbox div{DIV}
{trackertoggle fieldId="180" value="y" visible="y" id="checkbox"}
Checkbox: {$f_180}
{CODE}

### Show unless checkbox is checked

Will show the div until the checkbox is checked. 
{CODE(colors="tiki")}
{DIV(id="checkbox")}The checkbox div{DIV}
{trackertoggle fieldId="180" value="y" visible="n" id="checkbox"}
Checkbox: {$f_180}
{CODE}