LIST - display

The DISPLAY control block (or block) is used when you want to display something in-place where you put it - either in the body of a FORMAT block or directly in the body of the OUTPUT block or in a referenced custom template (Smarty tpl file or a wiki page).

Syntax

DISPLAY block has two possible syntax options similar to Wiki-Plugin syntax.
For example you could use:

Copy to clipboard
{DISPLAY(param="foo")}{DISPLAY}


But it seems the body of the DISPLAY block is never rendered anyway so it is obviously better to use the lowercase shortened version without the content part:

Copy to clipboard
{display param="foo"}


The param="foo" can be e.g. format="plain".
It is possible to omit the double quotes but it is recommended to use them for consistency just in case a value contains spaces.

Parameters

Examples

General

Copy to clipboard
Display blog post with title (yes, you can use vanilla HTML code in the OUTPUT) <h2>{display name="title" format="objectlink"}</h2> {display name="blog_content"} Display shortened blog post snippet {display name="blog_content" format="snippet" length="96" suffix="…"} Display category links {display name="categories" format="reference" type="category"} Display freetag links {display name=freetags" format="reference" type="freetag"} Display item link {display name="tracker_field_42" format="trackerrender"} {display name="tracker_field_42" format="reference" type="trackeritem"} Display start of a wiki page {display name="wiki_content" format="snippet" length="500 " suffix="..."} Display a username and real name (e.g. for blog posts) with link to user info: {display name="contributors" format="reference"} {display name="contributors" format="reference" type="user"} Display field in FORMAT block referenced via alias "foo" {display name="foo"} (Please note FORMAT must be always outside of the OUTPUT) {OUTPUT()}Preview of the Foo: {display name="foo"}{OUTPUT} {FORMAT(name="foo")}{display name="wiki_content" format="snippet" length="500 " suffix="..."}{FORMAT} (Tiki 8) Categories (n.b. does not seem to work on the mysql engine, checked in Tiki 12 and 14 - not tried Lucene) {display name="categories" format="categorylist" singleList="y"} {display name="categories" format="categorylist" requiredParents="15,20" excludeParents="5,6"} {display name="categories" format="categorylist" singleList="y" separator=", "} Display a time only {display name="modification_date" dateFormat="%k:%M"} Display only the year {display name="tracker_field_dateOpening" format="date" dateFormat="%Y"} Display a tracker item's status only {display name="tracker_status" format="trackerrender"} Display an 'action' ''Note: this is an example of only displaying 'Delete' Tracker item functionality, other functionality, for example 'edit' will be different'' {DIV(class="btn btn-danger text-white click-modal")}[tiki-tracker-remove_item?trackerId=11&modal=1&itemId={display name="object_id"}|{icon name="delete"}]{DIV}

Wiki Plugin Formatting

Copy to clipboard
(Tiki 9) Wiki Plugins {display name="wikiplugin_addtocart" format="wikiplugin" code="tracker_field_42" description="tracker_field_43" price="tracker_field_44"} (Tiki 11) {display name="wikiplugin_img" format="wikiplugin" fileId="tracker_field_pic" thumb="box" default="fileId=42"} If the wiki plugin needs a body, this goes into the content {display name="wikiplugin_list" format="wikiplugin" content="{filter type=trackeritem} {filter field=tracker_id exact=4}" } Note: this makes use of the fact that single-word parameters don't really need to be surrounded by double quotes. The same result is obtained with the more ugly: {display name="wikiplugin_list" format="wikiplugin" content="{filter type=\"trackeritem\"} {filter field=\"tracker_id\" exact=\"4\"}" } (Tiki 19 - backported to 18.4) To replace parts of the content parameter with data from the results surround the field name with %percentages% This example shows the number of comments on each tracker item {display name="wikiplugin_list" format="wikiplugin" content="{filter type=comment} {filter field=parent_object_type content=trackeritem}{filter field=parent_object_id content=%object_id%}{output template=count}{ALTERNATE()} 0 {ALTERNATE}"}

All the LIST Plugin control blocks

History Source