Loading...
 

LIST - output command


The OUTPUT command defines what the output ‘template’ will be for the results.

Below the simple Wiki Formatting Within Plugin is discussed as well as the standard/built-in templates, e.g., table, medialist and carousel. For user defined wiki or smarty templates see LIST - advanced output command.

Basic Wiki Formatting Within Plugin

By placing Wiki syntax directly in the OUTPUT body content, along with the required objects to be displayed, the command allows a template for each row of output to be constructed within the LIST plugin itself.

In the example below a table is constructed with the table ‘header’ row placed before the LIST and the table closing characters placed after the LIST. Each row of the table is then created by the LIST plugin with each table cell element generated by the display command and separated by the usual table separator, i.e., a |

Wiki Output Sample
||Type|Object
{LIST()}
    {OUTPUT()}
        {display name="object_type"}|{display name="object_id"}
    {OUTPUT}
    {ALTERNATE()}This will display if no results are found{ALTERNATE}
{LIST}
||


Table Formatting

A simple built-in templating method can be used by setting the OUTPUT template parameter to table and then using a column command in the OUTPUT body content to define the individual columns of the table.

Column Mode Parameter

When you use table output with a column generating HTML output (like objectlink and trackerrender formatted values), you should include the mode="raw" in the column specification. In the sample below, the column “title” mode is set to raw as in the format we want to display an objectlink. Other formats are available; see more about it here: LIST - display command

(Tiki 11+) editable=inline will set the field to be editable online. Required: “Inline editing (found in trackers)” and column should be set to mode=raw. e.g:


Sample using the default table formatting
{LIST()}
   {filter type="trackeritem"}
   {filter content="water"}
   {OUTPUT(template="table")}
       {column sort="title" label="Title" field="title_link" mode="raw"}
       {column label="Description" field="description"}
       {column sort="tracker_field_18" field="event_date" label="Event Date"}
   {OUTPUT}

   {FORMAT(name="title_link")}{display name="title" format="objectlink"}{FORMAT}
   {FORMAT(name="event_date")}{display name="tracker_field_18" format="date"}{FORMAT}
{LIST}

Note that the column plugins (within OUTPUT) are converted to a data array sent to the template. The table formatting uses Smarty formatting and provides the same capabilities.

The use of the FORMAT commands allows individual objects to be ‘formatted’ and then referenced in the various OUTPUT methods - see LIST - FORMAT command for more details.

Download CSV of Table Results

(Tiki 18+) downloadable=filename.csv parameter can be used to add a Download button which generates a CSV file with all data found in the table. Header row is based on the table headers formatted via column mode parameter.

Output formatting with download option
{OUTPUT(template="table" downloadable="Sample file.csv")}
...column specification...
{OUTPUT}


Table formatting with tablesorter

Starting with Tiki15, PluginList can be used with tablesorter. Use a {tablesorter} tag to add the tablesorter parameters. See below, which uses the same syntax as above except for the addition of the tablesorter tag:

Sample adding tablesorter functionality
{LIST()}
   {filter type="trackeritem"}
   {filter content="water"}
   {OUTPUT(template="table")}
       {column sort="title" label="Title" field="title_link" mode="raw"}
       {column label="Description" field="description"}
       {column sort="tracker_field_18" field="event_date" label="Event Date"}
       {tablesorter server="n" sortable="type:reset" tsortcolumns="type:text|type:text|type:digit" tsfilters="type:text|type:dropdown|type:digit" tspaginate="max:10" tscolselect="critical|5|6"}
   {OUTPUT}
   {FORMAT(name="title_link")}{display name="title" format="objectlink"}{FORMAT}
   {FORMAT(name="event_date")}{display name="tracker_field_18" format="date"}{FORMAT}
{LIST}


Please note that in some cases, if you want to use the tsfilters, you will need to take into account an extra column at the beginning for the:
  • status field
  • checkbox to perform actions on the listed items through the PluginListExecute
    you can safely pre-pend, for instance, a “type:nofilter|” at the begining of the parameters of the tsfilter in such cases.

Media List Formatting

Tiki13+
This sample presents a list of badges obtained by the current user.
Sample using the default media list formatting
{LIST()}
  {filter relation="" objecttype="user" qualifier="tiki.badge.received.invert"}
  {OUTPUT(template="medialist")}
    {icon field="tracker_field_image"}
    {body field="tracker_field_description"}
  {OUTPUT}
{LIST}


Tiki14+
This sample presents agile gallery of images as a Bootstrap Carousel.
Sample using the default Bootstrap Carousel formatting
{LIST()}
  {filter field="gallery_id" content="6"}
  {OUTPUT(template="carousel")}
    {carousel interval="2000" wrap="1" pause="hover" id="mycarousel"}
    {body field="pic" mode="raw"}
    {caption field="caption"}
  {OUTPUT}
  {FORMAT(name="pic")}{display format="wikiplugin" name="wikiplugin_img" fileId="object_id" styleimage="width:100%"}{FORMAT}
  {FORMAT(name="caption")}
!!! {display name="title" default="Untitled"}
{display name="description" default=""}{FORMAT}
{LIST}


Example


Count Formatting

Tiki15+
This sample shows how to return a simple count of the number of tracker items in tracker 5. For best performance, it is advised to set the max returned results to 1 to prevent having the index to send all the info for all the results (which will slow the request down unnecessarily).
{LIST()}
  {pagination max=1}
  {filter type="trackeritem"}
  {filter field="tracker_id" content="5"}
  {OUTPUT(template="count")}
  {OUTPUT}
{LIST}


Wiki Formatting (Within Plugin)

For each result, the plugin allows to apply a template. See LIST - advanced output command.

All the LIST Plugin commands


doc.tiki.org


Bootstrap

AdminGuide

UserGuide

Keywords

Keywords serve as “hubs” for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):

Accessibility (WAI and 508)
Accounting (7.x)
Articles and Submissions
Backlinks
Banners
Batch (6.x)
BigBlueButton audio/video/chat/screensharing (5.x)
Blog
Bookmark
Browser Compatibility
Link Cache
Calendar
Category
Chat
Clean URLs
Comments
Communication Center
Compression (gzip)
Contacts (Address Book)
Contact us
Content Templates
Contribution (2.x)
Cookie
Copyright
Credit (6.x)
Custom Home and Group Home Page
Date and Time
Debugger Console
Directory of hyperlinks
Documentation link from Tiki to doc.tiki.org (Help System)
Docs 8.x
Draw 7.x
Dynamic Content
Dynamic Variable
External Authentication
FAQ
Featured links
File Gallery
Forum
Friendship Network (Community)
Gmap Google maps
Groups
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
Kaltura video management (4.x)
Karma
Live Support
Login
Logs (system & action)
Look and Feel
Lost edit protection
Mail-in
Map with Mapserver
Menu
Meta Tags
Mobile Tiki and Voice Tiki
Mods
Module
MultiTiki
MyTiki
Newsletter
Notepad
Payment
Performance Speed / Load
Permissions
Platform independence (Linux-Apache, Windows/IIS, Mac, BSD)
Polls
Profiles
Profile Manager
Report
Toolbar
Quiz
Rating
Feeds
Score
Search engine optimization
Search
Search and Replace
Security
Semantic links (3.x)
Shadowbox
Shadow Layers
Share
Shopping cart
Shoutbox
Slideshow
Smiley
Social Networks
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Stats
Surveys
Tags (2.x)
Task
Tell a Friend, alert + Social Bookmarking
TikiTests (2.x)
Theme CSS & Smarty
Trackers
Transitions (5.x)
TRIM
User Administration including registration and banning
User Files
User Menu
Watch
WebHelp
WebDAV (5.x)
Webmail
Web Services
Wiki 3D
Wiki History, page rename, etc
Wiki Page Staging and Approval (2.x)
Wiki Plugin extends basic syntax
Wiki Syntax
Wiki structure (book and table of content)
Workspace
WSOD
WYSIWYCA
WYSIWYG (2.x)
XMLRPC


Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki
Show php error messages