Loading...
 
Skip to main content

PluginList - Hacks and Fun

A collection of tips, hacks and fun things you can do with PluginList that don't really belong anywhere else.

How to reference any of the search indexed parameters

In all the various LIST examples the way the value that a particular Tiki feature can be used is to refer to its 'field' description e.g. tracker_field_myPictures, and the data for this field will be in the search index (if its kept up to date!).

But as the search facilities in Tiki are now very extensive it is not always possible to keep up to date with all the possible parameter 'references' that can be used - so very, very usefully these are all summarised at Search and List from Unified Index.

Set the Browser Page Title

A client needed a wiki page title (set in the <head><title> tag) changed from the default page name, and (eventually) we did it like this:

Copy to clipboard
{DIV(class="d-none")}{LIST()} {pagination max="1"} {OUTPUT()}{display name="mytitle" pagetitle="y"}{OUTPUT} {FORMAT(name="mytitle")}This is the page title, not the wiki page title{FORMAT} {LIST}{DIV}

You need to create some wikipages and set a category to them. In the example it is the category id 22. LIST will load all pages which contain the category and the carousel will display them.

Copy to clipboard
{LIST()} {filter type ="wiki page"} {filter categories="22"} {OUTPUT(template="carousel")} {carousel interval="2000" wrap="true" pause="hover" id="mycarousel" } {body field="page" mode="raw"} {OUTPUT} {FORMAT(name="page")} {display format="wikiplugin" name="wikiplugin_include" page="object_id"} {FORMAT} {LIST}

One needs to add class click-modal to the links (buttons) leading to service controller to be displayed in the modal. As there is no working Tracker view item action in the Tracker controller we need to create a wiki page first (in this case named "Item Details") to display the requested item details and use the the Wiki action_get_page controller (the Argument variables pref must be enabled for this example to work with {{itemId}} arg variable):

Copy to clipboard
{LIST()}{pagination max=1}{filter field="tracker_id" exact="1"}{filter field="object_id" exact="{{itemId}}"}{OUTPUT()} {display default="" name="wikiplugin_img" format="wikiplugin" fileId="tracker_field_myPictures" default="fileId=4"}{OUTPUT}{ALTERNATE()} {ALTERNATE} {LIST}


Then we just add those two buttons on our listing of items using PluginList:

Copy to clipboard
{LIST()} {filter field="tracker_id" exact="1"}{OUTPUT()} ... | <a class="btn btn-primary click-modal" href="tiki-wiki-get_page?page=Item%20Details&itemId={display name="object_id"}&modal=1">View Details</a>{GROUP(groups=Admins)} <a class="btn btn-dark click-modal" href="tiki-tracker-update_item?trackerId=1&itemId={display name="object_id"}&modal=1">Update Item</a>{GROUP}{OUTPUT} {LIST}


...add your tips here!