Loading...
 
Features / Usability

Features / Usability


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

posts: 3665 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:

Copy to clipboard
{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:

Copy to clipboard
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?

-R

posts: 214

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

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

 

posts: 3665 United States

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

Thanks,

 

-R


posts: 214

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

Copy to clipboard
/Items found: /::

And then put the REGEX plugin around your tracker list:

Copy to clipboard
{REGEX(pageName=TheNameOfYouRegexPage)} { your tracker list } {REGEX}

 



Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting