Search code examples
phpjoomlajoomla2.5joomla1.7joomla1.6

How to create a submenu in Joomla! frontend


What I'm trying to do is create a submenu (in Joomla! backend) with below code but it does not work.

JSubMenuHelper::addEntry(JText::_('test'), 'index.php?option=com_test&controller=test', $controller == 'testcon');

I have attacted a sample pictures here. It explains what type of menu I want.

sample menu is here. check this picture

Thanks!


Solution

  • JSubMenuHelper is designed to be used in the Joomla! Administrator section, it's not made for the frontend.

    If you really want to get to it, you need to include the file:

    /administrator/includes/toolbar.php
    

    Also you will have a bunch of missing CSS (js maybe also) files that you also need to include (form the admin template folder)

    But I see no reasons what you want to use JSubMenuHelper in front-end. I would strongly advise against using it.