Question

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!

Was it helpful?

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.

OTHER TIPS

You should create menu and (submenu) in Admin Panel, but I think you already know that :) Later you add look and feel with CSS. I think you should do ti with CSS not PHP.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top