Features / Usability

Features / Usability

How to display only the number/count of items in a Tracker

posts: 3653 United States

I'm looking for an easy way to display the number (i.e., the count) of items in a tracker that match specific criteria.

Basically, I want to use TRACKERLIST and return only the # of items — not the actual traker items themeselves. I was able to come close by using something like:

{trackerlist trackerId="1" fields="1" shownbitems="y" status="o" filterfield="19" exactvalue="Yes" list_mode="csv" wiki="EmptyTemplateTPL"}

And then my _EmptyTemplateTPL is a blank wiki page. This gets me most of the way... I get a single line returned:

Items found: 9

Which is hardcoded in the wikiplugin_trackerlist.tpl. I could edit that .tpl, but I'd rather not (as I use it elsewhere and want the text).

So... is there a better/easier way to simply display the # of items in a Tracker?


posts: 212

You would have to decide if there was any security risks with doing it this way, but you could make a DNS for your Tiki database and then just use the SQL plugin

{SQL( db="MyTikiDB" raw="1")} select count(*) from `tiki_tracker_items`  where `trackerId`='1'{SQL}


posts: 3653 United States

Yeah, that was my other option... but I'd rather not... although it may be my last resort.




posts: 212

OK, how about using the REGEX plugin to remove the text?  
Create a wiki page with just:

/Items found: /::

And then put the REGEX plugin around your tracker list:

{ your tracker list }