Extend content parameters

This tutorial will walk you through the process of adding custom content parameters to apps, categories and items in ZOO.

Getting started

All the content parameters are located in /media/zoo/applications/APPLICATION/application.xml.

In general you can include any Joomla parameters types, like text, textarea, list, etc. Further you can also use any ZOO parameters, like ZOOimage.

Getting into detail

A typical application.xml file might have the following params.

<params group="application-content">
	<param name="title" type="text" label="Title" description="Set a frontpage title." />
	<param name="image" type="zooimage" label="Image" description="Choose a frontpage image." />
</params>
<params group="category-content">
	<param name="teaser_description" type="textarea" label="Teaser Description" description="Set a teaser description for this category. It will be displayed in the parent category." />
	<param name="teaser_image" type="zooimage" label="Teaser Image" description="Choose a teaser image for this category. It will be displayed in the parent category." />
	<param name="image" type="zooimage" label="Image" description="Choose a category image." />
</params>
<params group="item-content">
</params>

Notice that the params tag has an attribute called group. The value for content params ends with -content.

Application content parameters will go into the <params group="application-content"> tag.

Category content parameters will go into the <params group="category-content"> tag.

Item content parameters will go into the <params group="item-content"> tag.

By adding parameters to them, you will be able to use them in your templates, or anywhere else throughout the code. Use the applications, categories or items method getParams() and then get(content.PARAM_NAME). Notice the content. in front of the PARAM_NAME, it tells the parameter object where to look.

For example: $this->application->getParams()->get('content.title')

Within a template php file

You can access the content of your parameter within a template with the following syntax:

$view->params->get('content.title')

Documentation on Github

Help us out! If you are feeling that our documentation has errors or can be improved, fork it at Github and send us a pull request. Any contribution is much appreciated. Thank you!