Adding the Component Category Tree

8 years 10 months ago - 8 years 10 months ago #998 by Joris Ceelen
Adding the Component Category Tree was created by Joris Ceelen

I find myself using the following two classes a lot, unfortunately Component Creator does not set them up automatically when adding a Joomla Category field to your components table, but then it is easy.

I like these functions and the way you can navigate the category tree

how to enable this ? ( it would be great if Component Creator would generate this file too!)

Create a file category.php in the front end under 

here is an example of my file in
I think it speaks for itself
 * @package     Joomla.Site
 * @subpackage  com_content
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
defined('_JEXEC') or die;
 * Content Component Category Tree
 * @since  1.6
class Form_nutrition_fact_groupsCategories extends JCategories
    * Class constructor
    * @param   array  $options  Array of options
    * @since   11.1
   public function __construct($options = array())
      $options['table'] = '#__form_nutrition_fact_groups` ';
      $options['extension'] = 'com_form_nutrition_fact_groups';
      $options['field'] = 'nutrition_fact_cat_id';
Last edit: 8 years 10 months ago by Joris Ceelen.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.