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')

ZOO Documentation