Pretty Trackers | ||
This page is significantly out of date This page contains advice that applied to old version of Tiki (i.e. before version 21 at least).
The modern way of achieving customised views of tracker (or other) data is by using Plugin List and Tracker Field Rules.
e.g. Suppose you have a movie review site. You can create a tracker that asks for:
Trackers have the ability to change the order and size of these fields, and if you try you can get your tracker to display a reasonably clean arrangement. But (as always) you want more. You want to use all your html and css skills to arrange and style these reviews in your tracker exactly like so. Thats what pretty trackers are for.
|
Inside a Tracker or in a Wiki Page ? | |
There are are two ways in which pretty trackers are used.
Note In tiki world a template can mean several similar things e.g. content templates all related to some kind of "coookie cutter functionality. TPL is short for Template and they can be used interchangably, here they both mean a page or a file having the instructions how to render some other page.
|
Quick Step by Step Guide to a Pretty Tracker | |
Please read this Pretty Tracker HowTo first. |
Parts of a Pretty tracker | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
A pretty tracker has several moving parts that are chained together. Not all will require all the parts below but this is the whole list. In the table below R=Required, Y=Can be used, N=Not used.
Tip wiki pages used as a template needs to be assigned the perm tiki_p_use_as_template to the group of users that you plan that they will work with the pretty tracker, in order to work properly.
|
How it Fits Together | |
|
The Pretty Tracker In Action | |
When executed the sequence in the code works like this.
Note Pretty Tracker does not work when the option 'mirror tables' in Tracker Settings (Admin) is set
|
Tutorial - A Simple Pretty Tracker. | |
Note: This tutorial assumes you know how to set up a tracker.
|
Dynamic Pretty Trackers | |||||||||||||||||||||||||
But what if you want to have different questions or different answers displayed in your template based on the information in that item? Basic conditional display is covered by PluginTrackerToggle. Using pretty trackers and JavaScript, more advanced behavior is possible for those who know HTML, DOM and JavaScript. The following form uses the jQuery library and PluginJq:
Syntax changed since Tiki 7 Keep in mind that default syntax for tracker fields changed since Tiki7, so that when referring them from within plugin jquery, you have to update the syntax.
For more information, read: http://doc.tiki.org/Tiki7#Upgrade_notes
|
Conditional fields | |
The initial state is achieved with the following code: Copy to clipboard
fileprompt and urlprompt are the identifiers of DIV elements defined in the template to allow controlling the display of the 2 fields and their label: Copy to clipboard
Copy to clipboard
The function is executed when field 121 is changed. When the function is executed, one of the 2 blocks is run depending on the value of the selected (or "checked") radio button. |
Display a message when a certain value is selected | |
Copy to clipboard
|
Using a Pretty Tracker in a Wiki Page | |
Conditional display of input fields | |
|
Syntax tips | |
Pre-defined variables | |
{$f_created}: created date
|
Registration pre-defined variables | |
You can easily integrate registration information in your pretty tracker using the proper syntax
See http://doc.tiki.org/User-Tracker#Using_Pretty_Trackers_to_generate_the_Registration_Tracker |
Syntax modifier | |
Modifiers can be applied using "|" (pipe). |
Date modifier | |
{$f_lastmodif|tiki_short_date} will display human readable date only.
|
View / edit modifier | |
Copy to clipboard
This is reported not to work within a wiki table
|
Limitations to using wiki pages | |
There are certain limitations to the use of pretty tracker veriables when using a wiki page as the template, for example:
Related
See:
|