0

I am new to joomla.

I am trying to develop component.

How can I have sidebar in Joomla admin component.

Please help me solve this.

| improve this question | | | | |
0

Look at an example: administrator/components/com_installer/views/default/view.php In the view it renders the sidebar:

    // Render side bar.
    $this->sidebar = JHtmlSidebar::render();

Later in a template it outputs the sidebar

    <?php echo $this->sidebar; ?>

But how does it know what to be in the sidebar? In the main controller administrator/components/com_installer/controller.php it established the sidebar

        // Load the submenu.
        InstallerHelper::addSubmenu($vName);

And if you look at the helpder, you can see that it just adds common buttons to the sidebar

    JHtmlSidebar::addEntry(
        JText::_('COM_INSTALLER_SUBMENU_INSTALL'),
        'index.php?option=com_installer',
        $vName == 'install'
    );
    JHtmlSidebar::addEntry(
        JText::_('COM_INSTALLER_SUBMENU_UPDATE'),
        'index.php?option=com_installer&view=update',
        $vName == 'update'
    );

So resuming: Add buttons like this:

JHtmlSidebar::addEntry(
    JText::_('COM_INSTALLER_SUBMENU_INSTALL'),
    'index.php?option=com_installer',
    $vName == 'install'
);

Render sidebar like this

echo JHtmlSidebar::render();
| improve this answer | | | | |

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