List is a wiki plugin that uses the improved search index to provide search functionality. It provides a full-text search across most major tiki features, enhanced by programmable filter, OUTPUT, DISPLAY, and SORT commands, which combined can render almost any information in the database in any format desired, similar to pretty trackers.
The body of the plugin contains commands with their own plugin-like syntax, but only these four exist within LIST:
filter: chooses the objects (rows) to include. (required) OUTPUT: which columns/fields to include about those objects (optional) DISPLAY: placement and formatting of those fields. (optional) SORT: which order. (optional)
To Do
This part needs help - need to explain the scope of these commands (what each is for)
Steps to Create a List
Note that it is important to set a max otherwise performance might be slow:
{list max="10"}
Note that this setting will take precedence over any maxRecords setting which is set in the query string, and that maxRecords in the query string will only apply if offset is set anyway, while the above setting will work always.
Notes on the Syntax
The field argument in the content filter can contain multiple fields separated by commas.
Available Fields
The field list can be found in the Search Index documentation.
Available filters
Name
Description
Boolean
Sample
Tiki Version
categories
Match on the object's directly associated categories
yes
1 OR 3
7
content
Full text search on all of the object's content Additional field argument can be provided to search for other fields instead of the default ones.
yes
hello world
7
deepcategories
Match on the object's categories or their parents, providing deep searching
yes
1 OR 3
8
language
Search on the object's language (2-letter code) when available. unknown is used when unspecified.
yes*
en or fr OR unknown
7
type
Filter on object type
no
wiki page (from Tiki 8 you can search for multiple types by providing a comma separated list)
7/8
range
A date (unix timestamp) range Must have from and to arguments specified
no
<searchfieldname>
8
range
In Tiki 9, from and to can now take "now" instead of a unix timestamp, and you can also set either from or to together with "gap" to specify the one relatively to the other
no
<searchfieldname>
9
textrange
A text range Must have from and to arguments specified
no
<searchfieldname>
8
relation
Must have certain relation Additional field arguments objecttype and qualifier (the relationship) must be specified
no
<object_id>
8
favorite
Show only the favorited objects of a certain user
no
{{user}}
8
contributors
user login to search for as the contrbutors for the content
yes
admin OR testuser
8
* AND matching won't make much sense, single-value field
Boolean Syntax
To be documented here, see UnifiedSearch for the moment.
Accessible variables:
$results, containing the result set. Each results contain all values provided by the search query along with those requested manually.
$count, the total result count
$maxRecords, the amount of results per page
$offset, the result offset
In Tiki 8, the following have been added:
$offsetplusone, basically $offset + 1, so that you can say "Showing results 1 to ...."
$offsetplusmaxRecords, basically $maxRecords + $offset, so you can say "Showing results 1 to 25"
$results->getEstimate(), which is the estimate of the total number of results possible, which could exceed $count which is limited by the max Lucene search results to return set in Admin...Search
Including Pagination
To include pagination below the template, pagination=1 can be used, just like when using the wiki formatter. However, if you want to locate the pagination elsewhere, you can do it using Smarty. Skip the pagination=1 part.
Note: In Tiki 9.0 (at least) $row values are wrapped in reversed no-parse tags, so if you want to test for a value within the TPL (e.g. where price == 0 for instance) you would need to use:
{if $row.stock neq '~ /np~0~np~'}
(but without the space between the ~ first and the /)
These keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):