Variables in Pretty Tracker
Hello Everyone
I have been using TikiWiki (Version 3.3) for about a month and really appreciate the amount of work put into the project. At this point I am trying to master trackers. Who isn't, as I can see from other posts. Here is my scenario.
I would like to build a directory of Banks based on two trackers:
Tracker=Bank, Tracker Id=10
Id |
Name |
Type |
Options |
55 |
Bank Name |
text field |
|
56 |
Description |
textarea |
Tracker=Branch, Tracker Id=11
Id |
Name |
Type |
Options |
57 |
Branch Name |
text field |
|
58 |
Bank Name |
item link |
10,55,0, |
59 |
Description |
textarea |
I populated the two trackers with data...
Id=10
| Bank Name | Description |
|---|---|
| Bank Of America | Just a Bank. |
| Citibank | Just Another Bank. |
Id=11
| Branch Name | Bank Name | Description |
|---|---|---|
| West | Bank Of America | Free coffee. |
| East | Bank Of America | Nice view. |
| North | Citibank | Ample parking. |
| South | Citibank | Extended hours. |
Now I would like to create a page where I can see a bank data from the two trackers. So I created a branch tracker template:
Branch Name: {$f_57} Branch Description: {$f_59}
I created a bank tracker template:
Bank Name: {$f_55} Bank Description: {$_56} In our city the bank has the following branches: {TRACKERLIST(trackerId="11",max="-1",filterfield=58,exactvalue={$f_55},wiki="display branch tracker tpl")} {TRACKERLIST}
Naturally, since it is a template, and I would like to recycle it for other things, I do not want to hard code the bank name in it. So instead of exactvalue="Citibank" for example, I put exactvalue={$f_55}
Now I create the top view page.
{TRACKERLIST(trackerId="10",max="-1",filterfield="55",exactvalue= "Citibank",wiki="display bank tracker tpl")} {TRACKERLIST}
The result is:
Bank Name: Citibank Bank Description: Just Another Bank. In our city the bank has the following branches:
So based on this, plus on the explanation provided below by ibrrorg I conclude that it is not the way it should be done in TikiWiki.
My workaround:
1. Create the following .ccs file and place it in /styles directory.
/* Remove breaks */ .collapse_br { display:none;} /* end of file */
2. Update bank tracker template.
{HTML()}{HTML} Bank Name: {$f_55} Bank Description: {$_56} In our city the bank has the following branches: {HTML()}{HTML}{TRACKERLIST(trackerId="11",max="-1",wiki="display branch tracker tpl")} {TRACKERLIST}{HTML()}{HTML}
3. Update branch tacker template.
{HTML()}{HTML}{if $f_58 eq $f_55} Branch Name: {$f_57} Branch Description: {$f_59} {else}{/if}{HTML()}{HTML}
4. Get Results.
Bank Name: Citibank Bank Description: Just Another Bank. In our city the bank has the following branches: Branch Name: North Branch Description: Ample parking. Branch Name: South Branch Description: Extended hours.
Sorry folks all data between HTML tags is removed by this forum software. So you will not be able to see what I put there 😑