Chris_Giggs
Chris_Giggs

Reputation: 11

Add helper / submenu to Joomla 4

I have to migrate some files and functions from Joomla 3 to 4. A former colleague had add custom extensions to the J3 CMS. I don't know exactly what I'm doing wrong. I'm trying to add a submenu to a component admin view in the backend using a helper file.

What I've done:

<?php namespace MySpace\Module\MyComp\Administrator\Helper; 
defined('_JEXEC') or die;
class MyhelperHelper extends JHelperContent
{
    public static function addSubmenu($vName)
    {
        JHtmlSidebar::addEntry(
            '<i class="icon-home"></i> ' . JText::_('some_text'),
            'index.php?option=com_mycomp',
                        $vName == 'myview'
myhelperHelper::addSubmenu('myview');$this->sidebar = JHtmlSidebar::render();
<div id="j-sidebar-container" class="span2"><?php echo $this->sidebar; ?></div>
$container->registerServiceProvider(new HelperFactory('\\MySpace\\Module\\Mycomp\\Administrator\\Helper'));

Error: Class "MySpace\Component\Mycomp\Administrator\View\MyComp\MyhelperHelper" not found

Unfortunaly, there are not many well written guides to J4 especially when you are new in Joomla 4. Maybe someone has a recommendation or solution. Thanks.

Upvotes: 1

Views: 279

Answers (1)

Hung Tran
Hung Tran

Reputation: 815

That submenu is removed in Joomla 4 so you safely remove it in your component. If you still want to have similar submenu, you need to build and render it in your own way.

Upvotes: 0

Related Questions