1

When you develop the back end of a component, you can add a couple of lines in the addSubmenu function of the component helper to use the category management interface:

class MyComponentHelper extends JHelperContent
{
  public static function addSubmenu($vName = 'myitems')
  {
    JHtmlSidebar::addEntry(
      JText::_('COM_MC_SUBMENU_MYITEMS'),
      'index.php?option=com_mycomponent',
      $vName == 'myitems'
    );
    JHtmlSidebar::addEntry(
      JText::_('COM_MC_SUBMENU_MYCATEGORIES1'),
      'index.php?option=com_categories&extension=com_mycomponent.categories1',
      $vName == 'mycategories1'
    );
    JHtmlSidebar::addEntry(
      JText::_('COM_MC_SUBMENU_MYCATEGORIES2'),
      'index.php?option=com_categories&extension=com_mycomponent.categories2',
      $vName == 'mycategories2'
    );
  }
}

This will generate a menu in your sidebar with 3 items. The first one linking to whatever you develop and the next 2 linking to the Joomla category management interface. Everything is already done for you, you have got a CRUD interface with version, access, basic publishing and language management in place for your back end in, literally, 10 min (and that's because I am not a fast typer). Add to that a a couple of lines in your localization file and the wording is even customized to your liking.

For very simple elements where you need ID, title and description, that's simply powerful.

Now, is it possible to do exactly the same thing but without the tree structure of the categories ?

1

There is FoF which is bundled withing Joomla 3. This framework allows you to create components with little code. See documentation

However it's still more work than what you see for the categories. The reason is that categories are handled by an own component com_categories. You basically just pass a filter to it.

  • I am checking it. Seems promising. – Florian Jun 25 '15 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.