Loading...
 
Skip to main content

History: PluginList - Hacks and Fun

Source of version: 7 (current)

Copy to clipboard
            ! 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:
{CODE(colors="tiki")}{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}{CODE}

!! Make a carousel with wikipages
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.
{CODE(theme="default")}{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}{CODE}

!! Add links to view page with item details or update form in the Bootstrap modal
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 -+{~np~{~/np~itemId}}+- arg variable):
{CODE()}
{LIST()}{pagination max=1}{filter field="tracker_id" exact="1"}{filter field="object_id" exact="{~np~{~/np~itemId}}"}{OUTPUT()}
    {display default="" name="wikiplugin_img" format="wikiplugin" fileId="tracker_field_myPictures" default="fileId=4"}{OUTPUT}{ALTERNATE()} {ALTERNATE}
{LIST}
{CODE}

Then we just add those two buttons on our listing of items using PluginList:
{CODE()}
{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}
{CODE}

...add your tips here!


~tc~ (alias(LIST - Hacks and Fun)) ~/tc~
        

History

Advanced
Information Version
Geoff Brickell 7
luciash d' being 🧙 6
Bob carousell with wikipages 5
luciash d' being 🧙 4
luciash d' being 🧙 Page renamed from LIST - Hacks and Fun to PluginList - Hacks and Fun. Semantic alias redirect created 3
luciash d' being 🧙 typo 2
Jonny Bradley 1