10/21/2016 - 8:47 AM


You firstly need to create a helper file, for example:

and in this file, add the following:

class HelloWorldHelper extends JHelperContent
    public static function addSubmenu($vName)
            $vName == 'banners'

Change VIEWNAME and the value for $vName to the view for your component that you wish to add the sidebar to.

Then, in your view.html.php file, call it using the following:

and of course, the following is required to render the sidebar which you can put below the code above:

$this->sidebar = JHtmlSidebar::render();
If you have a look at the Banners component that comes packaged with Joomla, it will provide a good example.


If forgot to mention, inside your addToolbar() function in the view.html.php file, you will need to call the helper file like so:

require_once JPATH_COMPONENT . '/helpers/hellowworld.php';
Update 2:

Sorry, I'm not on the ball today. You will need to add the following to your default.php in views/VIEWNAME/tmpl:

<div id="j-sidebar-container" class="span2">
    <?php echo $this->sidebar; ?>
<div id="j-main-container" class="span10">
     // Main part of the component view