Using the JToolBar class in the frontend

From Joomla! Documentation

This Page Needs Your Help

This page is tagged because it NEEDS REVIEW. You can help the Joomla! Documentation Wiki by contributing to it.
More pages that need help similar to this one are here. NOTE-If you feel the need is satistified, please remove this notice.

NOTE: This documentation was not previously updated for Joomla! 3.2. I have made some updates to bring it closer to what is needed for Joomla! 3 but admittedly, I still don't have this functionality working. Additional corrections and contributions would be greatly appreciated! Erik Jorgensen 12/10/2013.

Using JToolBar

It's now simpler to use JToolBar in the front end than it was in Joomla! 1.5 as it only requires two steps.

Step 1

Add the toolbar to your view display function

function display($tpl = null)
	// Set the toolbar
	$input->set('hidemainmenu', true);

Step 2

Add an addToolbar() function to view.html.php file in the view you wish to add the toolbar to (this function could possibly be placed in a helper function).

	protected function addToolbar()
		$input = JFactory::getApplication()->input;
		// Add whatever buttons you require