Items List and Item Link Tracker Fields
This is one of the tracker field types in trackersThe item link field provides a selection list with all the unique values in a particular field of another tracker. This allows the use of trackers for simple relational database applications. Using an items list field instead of a text field or text area guarantees that always the same text/phrase is use to describe something, which helps in searching etc.
Especially powerfull is the combination with the filter field and filter value options of the trackerlist pluging, which allows the displays of only those tracker fields on a particular topic. To use this, the same exact phrase in every record of the tracker is required, which the items list field makes possible.
Example
You want to display the list of products of a company- tracker Company (id 6)
- id 14: Company name - text field
- id 16: Product list - items list = 5,15,14,12
- id 17: Address - text field
- tracker Products (id 5)
- id 12: Product name - text field
- id 15: Company name - item link 6,14
The view of the tracker Company will looks likes
The view of the tracker Products will looks like
The insert of a Product item will looks like
Company name will be drop down with Macromedia, Apple, Microsoft
Item link parameters
The parameters are separated with ,| trackerId | the tracker you want to display fields | |
| fieldId | the fieldId of the tracker you want to display | |
| linkToItem | 1 or 0 to create a link to the item in view mode and listing | |
| displayedfieldslist | FieldIds separated with vertical bar to display this list of fields instead of the the second parameters | |
| status | limit the choice of values to the items with a specific status (values:o,c,p,op,oc,pc or opc) | |
| pageLink (Tiki 6+) | the item to the name of the wiki page to link to. If this is set, and when linkToItem is set to 0, the link will go to the wiki page where a PluginTrackerlist is present, instead of to tiki-view_tracker_item.php | |
In the above example, Company name in Products tracker is a item link
If you add the option 1 to the item link parameter, you will create a link to the company when displaying a product
If you use the parameters 6,14,0,14|17, instead of seeing the company name, you will see the company name concatenated to the address.
Important: If you change the company name, the company name in the products items will not be updated. But if you change the product name, the product list in the company items will be updated.
Important:If you change the company name, the link from the product to the company will be lost. If you have 2 companies with the same name, the link will be randomly to one of this company.
PS: If the Company tracker is not know before you enter the products, you will have not to use the itemlink type for the field 15 but a simple text field.
PPS: Since Tiki8, the new interface to edit tracker fields and their options does not allow to modify the type of a field once it is created.
Items list parameters
| trackerId | the other tracker you want to display fields | |
| fieldIdThere | the fieldId in the other tracker you want to match with the fieldId of your tracker | This can be a list of fieldIds separated with colons (see below) |
| fieldIdHere | the fiedId in your tracker you want to match | |
| displayFieldIdThere | the fieldId in the other tracker that is displayed. | In tw>2.0 FieldIds separated with vertical bar to display this list of fields |
| linkToItems | 1 or 0 to create a link to items in view mode and listing | |
| status | filter the status of the items. Value: o, c, p, op, oc, pc or opc. | tw>=5.0 |
Do not forget the result can be a list
FieldIdThere can be a list of fieldId - so that you cross as many trackers you want. For instance imagine your product tracker has a field contact(fieldId=50) that is an item link to a person tracker , and imagine the person tracker has 2 fields : a name (fieldId=51) and a phone number (fieldId:52)
If you want to display the phone numbers of all your product contact in the company tracker, you will have a field 5,15:50:51,14,52
To visualize you can use this kind of table
| item0 in company | fieldId 14 | Apple |
| item1 in product | fieldId 15 | Apple |
| item1 | fieldId 50 | sg |
| item2 in person | fieldId 51 | sg |
| item2 | fieldId 52 | 800 200 4000 |
Since Tiki8, there is a new interface to edit tracker fields and their options, and thus, this tracker field looks like:
Displaying Multiple Fields
In the case below, both 29 and 30 are "text" fields.
FIELD46
name = Responses (Person,Yacht)
position = 9
type = l
options = 7,27,19,29|30,0
isMain = y
isTblVisible = y
isSearchable = y
isPublic = y
isHidden = n
isMandatory = n
name = Responses (Person,Yacht)
position = 9
type = l
options = 7,27,19,29|30,0
isMain = y
isTblVisible = y
isSearchable = y
isPublic = y
isHidden = n
isMandatory = n
New options added in Tiki9
In Tiki9 some new options were added to "item link", which include:- allow selecting more than one item from Tracker B as linked with that item in Tracker A,
- you can use a "static text" tracker item field as a separator for the fields displayed from each item in tracker B (for instance, a " dash " ( - ) can be used )
- and many other improvements (see some in the image below).
Items list | item link | item list | items link | tracker field items list | tracker field item link | tracker field item list | tracker field items link | itemslist | itemlink | itemlist | itemslink | foreign key
