Loading...
 
Features / Usability

Features / Usability


Display a tracker item inside a wiki page

posts: 25 United States

If I have a tracker with the Page Selector as a Distinct item inside of it, is there a way to tell the wiki page to automatically show the tracker inside of it?

For example, assume I have a tracker "Movies" with "Movie Title" as a Distinct Field of the type Page Selector along with other fields for the director, year of release, etc.

If I make a Tracker entry for "Raiders of the Lost Ark", can I tell the "Raiders of the Lost Ark" wiki page to automatically get the data from the Movie and show those that data inside the wiki page.

In short, an automated Infobox inside of a wiki page.

posts: 25 United States

Just curious as to if anyone had a point in the right direction for this.

I'm on the verge of attempting a Trackerbox plugin for this that would:
1)Get the trackerId and itemId that has a Page Selector as the main field:

Copy to clipboard
SELECT tiki_tracker_fields.trackerId, tiki_tracker_item_fields.itemId FROM tiki_tracker_fields INNER JOIN tiki_tracker_item_fields ON tiki_tracker_fields.fieldId = tiki_tracker_item_fields.fieldId WHERE tiki_tracker_item_fields.value=".$page.'" AND tiki_tracker_fields.type='k' AND tiki_tracker_fields.isMain=True


2) Retrieve the fields for that trackerId and itemId that are Public:

Copy to clipboard
SELECT tiki_tracker_fields.name, tiki_tracker_item_fields.value FROM tiki_tracker_fields INNER JOIN tiki_tracker_item_fields ON tiki_tracker_fields.fieldId = tiki_tracker_item_fields.fieldId WHERE tiki_tracker_fields.trackerId='.$trackId.' AND tiki_tracker_item_fields.itemId='.$itemId.' AND tiki_tracker_fields.isPublic=True


3) Build atable (or "trackerbox") to display it on the page

However, everytime I do some more researchI get the impression this is already being done with the Page Selector and tracker plugins.

Does this in fact exist? Is there a specific page I should be looking at for how to do this?


posts: 25 United States

OK, the answer was just waiting on me to ask a question in a public forum before it magically materialized in front of me.

:-)

Anyway, I got it figured out.


posts: 758 United States

Loren, I read with great interest, as I am playing with trackers right now, I was monitoring your original topic waiting for an answer as well. And what you discovered helps me in my own tracker quest, so thanks for that.
I have done what you have before, ask a question, it never gets answered, and then I end up with a stubborn fervor, figuring the danged thing out anyway! Great job!

And thanks for sharing your adventure with this.


posts: 758 United States

" Is there a specific page I should be looking at for how to do this? "

OH yes, did you find the page? If so can you enlighten me?


posts: 25 United States

Hi John,

The answer wasn't obvious, but here's the key phrase that I caught from Page selector:

"When used with the TRACKERLIST plugin (param view=page) in a wiki page, the plugin will only display the associated tracker item on that wiki page. When used with TRACKER in a wiki page (param view=page), the plugin will modify the item associated."


Here's what I did
1) Created my Pretty Tracker in a wiki page called "Tbox: People" by putting the following code into it (you'll notice it's still very much in rough draft form from the Tikipedia theme plus you'll see that I have a TRANSCLUDE added to it as well):

Copy to clipboard
{DIV( class="panel infobox col-sm-3 pull-right")} !!! {$f_7} {$f_8} !!!! A table || __A label__ | Some information __Date of Birth__ | {$f_1} __Place of Birth__ | {$f_3} || !!!! A second table || __Row 1 Column 1__ | Row 1 Column 2 | Row 1 Column 3 __Row 2 Column 1__ | Row 2 Column 2 | Row 2 Column 3 __Row 3 Column 1__ | Row 3 Column 2 | Row 3 Column 3 || {DIV(class="pull-right")}PORTAL: {TRANSCLUDE(page="Portal: People")}{TRANSCLUDE}{DIV} {DIV}


My page is here: http://ghsfha.org/wiki/tiki-index.php?page=Tbox%3A+People

2) In each individual wiki page that I wanted the box to show up, I put:

Copy to clipboard
{trackerlist trackerId="1" view="page" wiki="Tbox: People"}


An example of one of my pages is here: http://ghsfha.org/wiki/tiki-index.php?page=Billy+Henderson

The key statement from the Page Selector documentation is that the view="page" parameter is what tells that Pretty Tracker to show the Pretty Tracker only for the current page.

A couple of things I'd still like to figure out.

The first is how I can get the column names to automatically appear.

The second (which I haven't really investigated) is how to cycle through data to show more rows.

For example, in my initial movie example above, on the Raiders of the Lost Ark wiki page I would have a "trackerbox" with the data from the Movie tracker itself, and then some way to list a separate tracker that shows all the actors in that movie.

Such as:

Raiders of the Lost Ark
Release date: 1981
Director: Spielberg
Actors:
Ford
Allen
Freeman
Lacey
etc.


posts: 758 United States

Sweet!!!!!!! That is some great work with that Loren.
Are you using namespaces too?

posts: 25 United States
No namespaces. What do you use them for?
posts: 758 United States

Namespaces are common in wiki software. Most wiki's run namespaces where you can have areas that are in a sense categories but for the wiki platform in general. For example you could have Namespaces such as:

Tiki:
Templates:
Wiki:
Tracker:

They are convenient to keep the main areas of your tiki organized. So lets say you have made a bunch of templates for your trackers, without namespaces you simply create another wiki page to serve as your template, but if you had namespaces, you would create your templates in the tpl namespace, where all your templates would reside, apart from your wiki pages. And you can restrict that namespace tpl for admin editing only, so anything that falls under the tpl namespace, can only be edited by you, the admin.

I do not use them myself, I am considering it though, I just need to read up more on how Tiki namespaces function.


posts: 25 United States

Thanks, John.

I'm actually quite familiar with namespaces themselves,

I only meant how do you specifically use them on your website :-)

I see where you have a number of "portals", but didn't see any namespaces.

The Tiki namespace separator is :_: rather than the Mediawiki colon, although I understandthat can be set to something else.

posts: 758 United States
I don't use them yet Loren, I am debating weather or not it's necessary or convenient. I am a little concerned with the "Experimental" status tiki namespaces has, so I am not sure if it's a good time to implement them. I did like the MW namespaces, as you mentioned, they were very convenient, hmmm, the verdict is out if I am going to use them or not, but I need to make up my mind quickly before my site is developed much further.