Fullscreen
[Show/Hide Right Column]

Items List and Item Link Tracker Fields

This is one of the tracker field types in trackers

The 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
Image

The view of the tracker Products will looks like
Image

The insert of a Product item will looks like
Image

Company name will be drop down with Macromedia, Apple, Microsoft


The parameters are separated with ,
trackerId the tracker you want to display fields
fieldIdthe fieldId of the tracker you want to display
linkToItem 1 or 0 to create a link to the item in view mode and listing
displayedfieldslistFieldIds separated with vertical bar to display this list of fields instead of the the second parameters
statuslimit 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 parameter 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

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 trackerThis 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
linkToItems1 or 0 to create a link to items in view mode and listing
statusfilter 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 companyfieldId 14Apple
item1 in productfieldId 15Apple
item1fieldId 50sg
item2 in personfieldId 51sg
item2fieldId 52800 200 4000


Displaying Multiple Fields

In Tiki 7, the displayed fields list parameter might not be working properly. This is fixed in Tiki 8


Can someone clarify what the constraints are for displaying multiple fields in the displayedfieldslist parameter using '|'? I am trying to concatenate several fields in an "items list" using the definition below. Instead of showing the expected result, e.g. Fred SS Minnow, it returns 30. (You will notice that 30 is actually the second field ID to display.) A little experimenting has proven that I can display field 29 or field 30, but if I attempt to display multiple fields, it displays nothing but the the ID of the second field - i.e. the first field doesn't appear at all. I suspect only certain field types are allowed?

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



alias
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


Contributors to this page: xavi64712 points  , Philippe Cloutier1003 points  , Nelson799 points  , hanolff152 points  , Marc Laporte8178 points  , sylvie7160 points  , simonf162 points  , mlpvolt4266 points  and xavidp1209 points  .
Page last modified on Monday 17 October, 2011 07:06:53 UTC by xavi64712 points .
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.

Site Language

Reference Guide

Keywords

These keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):



Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki