How to add custom filters to components

From Joomla! Documentation

Revision as of 18:03, 19 January 2012 by Doub1ejack (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


This how-to is intended to give a decent description on how to add dropdown form elements to the backend admin page for a component. I worked out the steps primarily on my own by dissecting/replicating the Banners component. In particular, the 'banners' section of com_banners - not! to be confused with 'banner').

This tutorial was built on code tested in Joomla 1.7 only.

In general, the process of adding these fields breaks down into the following steps:

  • Creating the class that will generate the form element
  • Adapting the view to display the form element
  • Adapting the model to retrieve data from DB & to set submission values in the Joomla 'state'

Extend JFormFieldList (models / fields / fieldname.php)

test formatting

Modify Model (models / zzz.php)

test formatting

Modify View (views / zzz / view.html.php)

test formatting

Modify Template (views / zzz / tmpl / default.php)

test formatting