Hello internet I’m Bernard Sfez a Tiki specialist and in this tutorial we'll see together the basic usage of my favorite plugin in Tiki:
the plugin List, a wiki plugin that can return and output data from your Trackers, File Galleries, Forums, Blog, almost anything in Tiki.

And, yes… In my last Tiki Express Tutorial I said that we’ll talk about the customSearch plugin but as customSearch is using the syntax of the plugin List, it made sense to learn first the plugin List usage and its syntax then the customSearch plugin.

But before we start,
I had a wonderful surprise from Erich from Germany that sent me an old and original Playstation Guncon. Just wow, I really really appreciate and thank you my friend.
I have an old system to restaure and it will nicely complete the set.
A big thank you. (heart)
If you too have old video games system or unused guitar stuff, don’t throw it to the trash, help the planet ! Send it to me and it will get a second life.
That’s a great way to support my Tiki channel and fill my
"do a monthly video" energy bar.

Back to Tiki, Tiki21 Alpha has been released and soon a new Long Term Services version will be available with an incredible list of new stuff. You can follow the progress at dev.tiki.org/tiki21 and doc.tiki.org/tiki21, links will be in the description of this Tiki Express Tutorial.
By the way, for this video I upgraded a Tiki 20 to Tiki 21 alpha to demonstrate the power of the plugin List in Tiki.
Enough for the intro, let’s start

Thanks to our community brightest mind Tiki integrate the wiki plugin List, a very powerful and flexible plugin that is able to retrieve any data indexed in the unified index.

If you have data to be collected, displayed, searched, filtered, shared, etc, using the plugin List is a must, and the options and ways to integrate it keep on improving making Tiki a complete web application builder. And, as I mentioned, it can be combined with the PluginCustomSearch plugin but also with other functionalities like the Wiki page or plugins like the PluginListExecute.

In this Express Tutorial

In this Tiki Express tutorial we’ll review together;

  • The Tiki Unified Index
  • How to refresh the Unified Index
  • The pluginList control blocks
  • We’ll create our first simple pluginList
  • How to use smartly the ALTERNATIVE block
  • How to configure a pluginList using a table template
  • How to configure a pluginList to display files and a carousel
  • How to use it with a Smarty templates
  • The debug tools available for the plugin List

Tiki Unified Index

The plugin List use the Tiki Unified Index to get data.What is not in the Unified Index you won’t find using the plugin List. A minimum knowledge of how Unified Index work is therefore recommended. Here, a link that you should use regularly as reference.
https://doc.tiki.org/Unified-Index

As you can see, there are data related to your own input like the value of wiki page title or a tracker field value but also data created by Tiki like the modification date of an object.

How to refresh the Unified Index

The Unified Index need to be rebuilt regularly to stay up to date and serve the real states and content of your Tiki. It is done in the Control Panel => Search; Rebuilt index.
If you have a big amount of data: pages, items, files, forum post, etc.

It may take time and you may need to adjust the memory and the timeout threshold above the default one to complete the operation. For the Tikis I’m taking care of, I usually set a Tiki Scheduler task that will automatically and regularly run and rebuilt the index using the command line Console that is integrated in Tiki. Check this link : http://doc.tiki.org/Console to find out how you can, if you are an advanced Admin and have access to your server shell, launch and interact with you Tiki instance.

The plugin list control blocks

The plugin List use different control block:
* to create PAGINATION

  • to FILTER and SORT the data

to produce thet OUTPUT or the results
to FORMAT the data if needed
and to DISPLAY the data

Alternatively an another block ALTERNATIVE can be define to display output when an individual item (a row) from a search has no value. So it is possible to personalise the message when nothing is returned.

I’m giving you very basic definition and you can find more information on the PluginList page at:
https://doc.tiki.org/PluginList. All the link will be in the description below the video as usual.

The PAGINATION block control how much row of data will be displayed in the page.
You want to avoid long time upload pages on the internet and rendering a lot of data is taking a lot of time. You can limit the numbers of items or define offset settings using this block.
The FILTER and SORT block do what they say, filter the output with specific criteria like a tracker_id or a specific username. Sort to sort the results (alpha ascending, numerical descending, by date, by range of date or distance, etc).
The OUTPUT block define what template to use to display the results. You can set it to use:
* A build-in template: table, carousel, media, etc.
Your own wiki template from a Wiki page
Your own Smarty template from a Wiki page or a file
Or your inline template
It also has some parameters like inline editing and report.
The FORMAT control block is used format the result values. It is used to display human readable dates, to display a label from the value from a tracker field and also to set a default value if empty, etc.
The DISPLAY block is used to display something at a specific place either in the body of a FORMAT block or directly in the body of the OUTPUT block. It can be used in a custom template.

Again this is super basic and I suggest you to read and re read the doc of this advanced Wiki plugin.

Create our first simple pluginList

Let’s create our first List.
I open a Tiki that was originally in version 20 and was just updated to Tiki 21 Alpha.
I needed a Tiki with data and I picked one I’m working on and not a default install to demonstrate the pluginList. This Tiki is in French and about selling and renting properties so the use case is pretty simple and you’ll understand very easily what you are going to see. I will show how to use the syntax you can find in the Tiki documentation. Again all the links will be in the description at the bottom of the video.

I start by writing the Wiki PluginList tags and add right away a filter so we don’t see all the indexed objects of this Tiki.

This filter is set to get objects that have a tracker_id that is equal to 3.
Most of the pluginList parameters are working using a variable and a value it should be equal to like this example.
In short I want all the object (and they will be only trackerItem here) of the tracker tracker 3.

Save and we have a list of trackerItems from the tracker 3.
Those numbers displayed are my trackeritems titles an option you can set in the tracker list settings.

Let’s add pagination so we limit the number we want to see.

Save, great.

Now we can sort them from the smallest to the biggest.
As this is numerical, I’ll use the numerical parameter, ascending and on the title.

Save, perfect.

Let’s define now what we want to display.

We create an output block and to demonstrate the simplest way I’ll use the display parameter so you see how it work. I want to display the ASP number an internal reference used by this business.

I set a display block and set it to display this value using it’s tracker permaname.
I have to add tracker_field_ before it, so it look like this : tracker_field_catalogueDesBiensNumeroASP

Let’s add more fields.
What do we got here ?
The ASP number, the town and a number instead of the type of transaction. Those values comes from a dropdown field where an internal value is stored and that value equal the label you’ve entered in the dropdown field type options.
To see the human readable version, the text we expect to see here, I add _text to the pernameme.

Note this trick, because you may encounter cases where the returned value is not what you expect and may think something is broken. We’ll see later that we can achieve the same using a parameter in the FORMAT block.

Use smartly the ALTERNATIVE block

Great but what happen if I have no results ?

This can happen be because of the search criteria, when there is nothing to return, it may also happen because of a permission that doesn’t allow you to see the results, etc.

By default a non very instructive: "No results for query." is returned.

Let’s make it smart using the ALTERNATIVE block at the end of our OUTPUT block.

Ok, different but not so smart.
But now we know we can customise it and it accept, like the OUTPUT block, the wiki syntax and wiki plugin.
I will use here a wiki plugin remarksbox to display a simple message. But I could have set it with more explicit text, a button, icons, etc…

Note that not every wiki syntax is working here (for example a link is tricky to add).
Experiment test and add a comment under this video to share what you’ve learn.

Ok, save… We got it smarted

Configure a pluginList using a table template

Ok let’s turn this into a more useful and real life example to display a listing of the properties.

I’ll add the template variable and assign table to it.

Now I need to define the columns of the table.
For each columns I set a label to be displayed and give a field reference so I can use it in my display and link it to the corresponding format if there is one needed. I can also add sorting tools on the column and even more advanced add tablesorter to the party.

It start to be complex but I’ll paste the complete code used here at the end of the description of this Tiki Express Tutorial so you can reuse and test.

We have now
ASP number
The Type to know if the property is for sale or for rent.
The town and a price.

We have back an issue with the type that display an internal value.
Let’s add the corresponding format to this field.
"trackerrender" is a very useful format. It mean: display this value like to show it on the tracker interface. And if we are here another very useful parameter, the default.
If a field is empty by default they will be a long message to tell you that no value were returned.
Using default you set what should be displayed.
Here it will display nothing but I can insert whatever string I want or in case of images a fileId of the default image to display when there is none in the field.

Let see what we have already.
Just fine.

Let’s stop with trackers and look to something else.


We can also work with files and images using inside the display block a wiki plugin. We can use buttons, icons, css style, etc…

This time we’ll use the carousel template.

I want to display all the files having this asp number in their name.
I create a simple pluginList to get some results first searching for files with this ASP number in their title.

Great I got files, but I want to see pictures !
I create an OUTPUT block, add a DISPLAY block for the photo.
And in my FORMAT block I set a plugin img using the object_id to display the image of the files returned.

Images !!!

Using the same parameters I add now the carousel parameters and body settings.
I just did a copy paste from Tiki documentation and that’s a good way to start it.
I also enclose it in a 50% div so we can see all the plugin result in the page.

Save
And we got a swiper and from here you can start to design it to avoid this different images height for example.

We can add many things, it is all configurable and integrate into a bootstrap design in a wiki page.

How to use Smarty template

I created very quickly and just to demonstrate here a page using the pluginList with a Smarty template.

Here how the smarty template was selected.

Here the smarty template using another wiki plugin to include the content of a wiki page and to link together 2 pluginList for the display.

In one pluginList I return the items of a specific tracker and using one returned I look into the file gallery to retrieve one of the picture with the same value.
Also there is at the bottom a pagination block.

Voila, voila, voila…
With Smarty and Tiki you can manipulate variables to calculate, use dates, etc… No limit !

How to troubleshoot and debug tools

It can happen that you get lost and unsure of the exact information you can retrieve using the pluginList. We integrate a super useful tool to test your plugin and see all the information you can get in the result and use.

Go to Setting, Control Panel, Search, the tab tools and click on this long link. :-)
Here I just grab the code of my first file test and paste it in and add the proper output to debug the results.

Many, so many values and field you can use to create reports, listing, calculation whatever you want to present.

With some work and patience you can really achieve whatever you want with your data with Tiki.
And that’s why I keep saying that Tiki is a web application builder. Nothing less !

Ending

Start today, experiment, read the documentation, fail and retry.
Use our forum and ask for support if needed or hire a Tiki consultant. (links below)
It is not easy but to copy/paste at first and learn and there are tools to test and understand.

I hope you’ve enjoyed this tutorial. Let me know in the comments, like and share this video. I’ll publish one in time next month and there will be more video tutorials on the pluginList and the trackers. You don’t want to miss my Tiki Express Tutorials ?
Subscribe and smash the little youtube bell !

I’m also considering a way to answer questions as I keep receiving a lot.
May be a monthly questions and answers question ?
May be a live chat session ?
Don’t know yet, if you got ideas… post a comment.


Thanks again for watching this Tiki Express Tutorial and may the power of Bootstrap and Tiki be with you.

Bloopers

… You have to seeeee iiiitttt ! :-)

https://dev.tiki.org/Tiki21
https://doc.tiki.org/Tiki21
https://doc.tiki.org/Unified-Index
http://doc.tiki.org/Console
https://doc.tiki.org/PluginList
https://tiki.org/consultants
https://tiki.org/forums
https://tiki.org/Support

{LIST()}
{filter field="tracker_id" content="yourtrackerid" }
{pagination max="3"}
{sort mode="title_nasc"}
{OUTPUT(template="table")}
  {column label="ASP" field="asp"}
  {column label="Ville" field="ville"}
  {column label="Type" field="type" sort="tracker_field_yourfieldpermaname"}
  {column label="Price" field="price"}
{OUTPUT}
{FORMAT(name="asp")}{display name="title"}{FORMAT}
{FORMAT(name="ville")}{display name="tracker_field_yourfieldpermaname"}{FORMAT}
{FORMAT(name="type")}{display name="tracker_field_yourfieldpermaname" format="trackerrender" default="empty"}{FORMAT}
{FORMAT(name="price")}{display name="tracker_field_yourfieldpermaname"}{FORMAT}
{ALTERNATE()}{REMARKSBOX(type="warning" title="Yourtext." close="y")}{REMARKSBOX}{ALTERNATE}
{LIST}

{LIST()}
{filter type="file"}
{filter field="title" content="yourvalue"}
{OUTPUT(template="carousel")}
    {carousel interval="2000" wrap="true" pause="hover" id="mycarousel"}
    {body field="photo" mode="raw"}
  {display name="photo"}
{OUTPUT}
{FORMAT(name="photo")}{display format="wikiplugin" name="wikiplugin_img" fileId="object_id" styleimage="width:100%"}{FORMAT}
{LIST}

{LIST()}
{filter content="3" field="tracker_id"}
{output(template="debug")}
{LIST}