<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Daimonie</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Daimonie"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Daimonie"/>
	<updated>2026-09-10T20:25:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Using_the_JToolBar_class_in_the_frontend&amp;diff=71693</id>
		<title>J1.5 talk:Using the JToolBar class in the frontend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Using_the_JToolBar_class_in_the_frontend&amp;diff=71693"/>
		<updated>2012-08-23T15:17:03Z</updated>

		<summary type="html">&lt;p&gt;Daimonie: /* Complete the toolbar look and feel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== javascript ==&lt;br /&gt;
&lt;br /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
This is a great article :) However I had a small problem due to my lack of experience... I propose a small change in the javascript part:&lt;br /&gt;
Instead of &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;includes/js/joomla.javascript.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&#039;&#039;&#039;, &lt;br /&gt;
shouldn&#039;t it be:&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;includes/js/joomla.javascript.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
?&lt;br /&gt;
&lt;br /&gt;
Since I am quite new to web development (including html and php) it took me some time to understand that the reason behind my buttons inactivity was the language attribute... I do not know if this is a general feature or if it depends on the developer&#039;s configurations... either way, probably this should be mentioned on the article.&lt;br /&gt;
&lt;br /&gt;
--[[User:Sbrandao|Sbrandao]] 13:20, 2 March 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
No,that&#039;s merely a HTML standard. See here: http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.1 Language is, in fact, deprecated. &lt;br /&gt;
&lt;br /&gt;
I am unsure as to why you found it to be like that; however, it might be related to your browser and testing setup.&lt;br /&gt;
[[User:Daimonie|Daimonie]] 10:16, 23 August 2012 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Complete the toolbar look and feel ==&lt;br /&gt;
&lt;br /&gt;
Thanks to the original contributor; very nice piece explaining how we can add the menu to the front end. I would like to add the following to give a more complete picture.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Changes to CSS&#039;&#039;&#039;&lt;br /&gt;
Copy the contents from the following CSS into the new CSS you are creating for your component.&lt;br /&gt;
&lt;br /&gt;
From directory /joomla/administrator/templates/khepri/css&lt;br /&gt;
#  rounded.css or norounded.css as needed (you can copy both if you could be using either of them)&lt;br /&gt;
#  general.css &lt;br /&gt;
#  you can ignore the additions for &#039;&#039;table.toolbar a&#039;&#039; and &#039;&#039;table.toolbar a:hover&#039;&#039; they are already in general.css. However, you need to have the code for icons&lt;br /&gt;
&lt;br /&gt;
The code copied from general.css has the styles for &#039;&#039;div.header&#039;&#039;. By default the color is #0B55C4, change this to your color of choice&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Changes to com_yourcomponent.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;&amp;lt;div id=\&amp;quot;toolbar-box\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;t\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;t\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;t\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;m\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo yourcomponentHelperToolbar::getToolbar( );&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;header\&amp;quot;&amp;gt;menu header&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;clr\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;b\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;b\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;b\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will make sure that the look and feel is exactly like the backend.&lt;br /&gt;
&lt;br /&gt;
Enjoy the toolbar!!!&lt;br /&gt;
== New notworking ==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;New&amp;quot; is a reserved word ergo you can&#039;t have a function called &amp;quot;new&amp;quot; you will get a syntax error that wont go away. So you need to change the name of the &amp;quot;task&amp;quot; &amp;quot;new&amp;quot; to something like &amp;quot;mynew&amp;quot; and then the function to &amp;quot;mynew&amp;quot; also.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hey, something is not working with the function name new(): &lt;br /&gt;
&lt;br /&gt;
function new() &lt;br /&gt;
   {&lt;br /&gt;
      JRequest::setVar(&#039;view&#039; , &#039;new&#039;);&lt;br /&gt;
      parent::display();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parse error: syntax error, unexpected T_NEW, expecting T_STRING in D:\htdocs\cattleinfo\components\com_breed\controller.php on line 7&lt;br /&gt;
&lt;br /&gt;
so..we need to change the function name first, or yu guys have other option to solve this problem.&lt;br /&gt;
&lt;br /&gt;
Its quite confussing where to insert the following form, is it inside default.php&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;form action = &amp;quot;index.php&amp;quot; method =  &amp;quot;post&amp;quot; id = &amp;quot;adminForm&amp;quot; name = &amp;quot;adminForm&amp;quot; /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;task&amp;quot; value = &amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;option&amp;quot; value = &amp;quot;com_yourcom&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thukten dendup&lt;br /&gt;
&lt;br /&gt;
== Problem with toolbar and SEO ==&lt;br /&gt;
&lt;br /&gt;
Hi&lt;br /&gt;
&lt;br /&gt;
I was very happy when I saw the chapter on using JToolBar in 1.6 – everything looked so easy! But, although the description is very good and nothing is missing, I needed a long time until it worked as expected in my tests. &lt;br /&gt;
&lt;br /&gt;
My problem was: In my installation, I had SEO (Search Engine Friendly URLs) set to „Yes“ – and this somehow mixed up the parameters sent by the edit form (but not in the list form - these buttons worked): option, task and all the other parameters somehow got lost and were never seen by a controller, so „save“ and „cancel“ never worked correctly. After changing this setting, almost everything worked on first try. &lt;br /&gt;
&lt;br /&gt;
The one exception ist the toolbar title: it is never displayed in the front end. Is this the same for everybody or just another problem with my site only?&lt;br /&gt;
&lt;br /&gt;
Many thanks for this article – having all the toolbar functionality easily available in the frontend helps me a lot.&lt;br /&gt;
&lt;br /&gt;
--[[User:Rolfz|Rolfz]] 13:56, 21 August 2011 (CDT)&lt;br /&gt;
&#039;&#039;&#039;Added a section on this. The fix is to define your own &#039;standard&#039; button with a changed HTML function.&lt;br /&gt;
--[[User:Daimonie|Daimonie]] 18:07, 8 Octobre 2012 (GMT+1)&lt;br /&gt;
&lt;br /&gt;
== Javascript and Forms ==&lt;br /&gt;
&lt;br /&gt;
You can add the form in the default.php since Joomla builds the view and appends the toolbars from the controller onto one page. When a button on the toolbar is clicked, it submits the form via javascript. To verify view your HTML source. You should see the HTML rendering the toolbars javascript and the form definition on the same page.&lt;br /&gt;
&lt;br /&gt;
The new keyword is reserved. I changed mine to add&lt;br /&gt;
&lt;br /&gt;
--[[User:EduOngeso|EduOngeso]] 17:34, 28 September 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== id of adminForm is misleading ==&lt;br /&gt;
&lt;br /&gt;
This documentation helped me show the toolbar on the front end, but when I tried to save the form it just didn&#039;t pass any data to the save function in the controller. The cancel button worked well. After days of frustration, the answer turned out to be really simple.&lt;br /&gt;
&lt;br /&gt;
The following comment is very misleading:&lt;br /&gt;
&amp;quot;the toolbar MUST be in a form with the id of &amp;quot;adminForm&amp;quot; in order for it to work.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In fact, I found that the form that you need to submit needs to have id=&amp;quot;adminForm&amp;quot;, and the toolbar itself needs to have a different id (I called mine id=&amp;quot;adminForm2&amp;quot;). Now my form actually saves the data, and doesn&#039;t just complain about mandatory fields which already have data in them. Hopefully this tip can save someone else hours of frustration.&lt;/div&gt;</summary>
		<author><name>Daimonie</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Using_the_JToolBar_class_in_the_frontend&amp;diff=71692</id>
		<title>J1.5 talk:Using the JToolBar class in the frontend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Using_the_JToolBar_class_in_the_frontend&amp;diff=71692"/>
		<updated>2012-08-23T15:16:14Z</updated>

		<summary type="html">&lt;p&gt;Daimonie: /* javascript */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== javascript ==&lt;br /&gt;
&lt;br /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
This is a great article :) However I had a small problem due to my lack of experience... I propose a small change in the javascript part:&lt;br /&gt;
Instead of &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;includes/js/joomla.javascript.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&#039;&#039;&#039;, &lt;br /&gt;
shouldn&#039;t it be:&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;includes/js/joomla.javascript.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
?&lt;br /&gt;
&lt;br /&gt;
Since I am quite new to web development (including html and php) it took me some time to understand that the reason behind my buttons inactivity was the language attribute... I do not know if this is a general feature or if it depends on the developer&#039;s configurations... either way, probably this should be mentioned on the article.&lt;br /&gt;
&lt;br /&gt;
--[[User:Sbrandao|Sbrandao]] 13:20, 2 March 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
No,that&#039;s merely a HTML standard. See here: http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.1 Language is, in fact, deprecated. &lt;br /&gt;
&lt;br /&gt;
I am unsure as to why you found it to be like that; however, it might be related to your browser and testing setup.&lt;br /&gt;
[[User:Daimonie|Daimonie]] 10:16, 23 August 2012 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Complete the toolbar look and feel ==&lt;br /&gt;
&lt;br /&gt;
Thanks to the original contributor; very nice piece explaining how we can add the menu to the front end. I would like to add the following to give a more complete picture.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Changes to CSS&#039;&#039;&#039;&lt;br /&gt;
Copy the contents from the following CSS into the new CSS you are creating for your component.&lt;br /&gt;
&lt;br /&gt;
From directory /joomla/administrator/templates/khepri/css&lt;br /&gt;
#  rounded.css or norounded.css as needed (you can copy both if you could be using either of them)&lt;br /&gt;
#  general.css &lt;br /&gt;
#  you can ignore the additions for &#039;&#039;table.toolbar a&#039;&#039; and &#039;&#039;table.toolbar a:hover&#039;&#039; they are already in general.css. However, you need to have the code for icons&lt;br /&gt;
&lt;br /&gt;
The code copied from general.css has the styles for &#039;&#039;div.header&#039;&#039;. By default the color is #0B55C4, change this to your color of choice&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Changes to com_yourcomponent.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;&amp;lt;div id=\&amp;quot;toolbar-box\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;t\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;t\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;t\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;m\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo yourcomponentHelperToolbar::getToolbar( );&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;header\&amp;quot;&amp;gt;menu header&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;clr\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;b\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;b\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;b\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will make sure that the look and feel is exactly like the backend.&lt;br /&gt;
&lt;br /&gt;
Enjoy the toolbar!!!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;New&amp;quot; is a reserved word ergo you can&#039;t have a function called &amp;quot;new&amp;quot; you will get a syntax error that wont go away. So you need to change the name of the &amp;quot;task&amp;quot; &amp;quot;new&amp;quot; to something like &amp;quot;mynew&amp;quot; and then the function to &amp;quot;mynew&amp;quot; also.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hey, something is not working with the function name new(): &lt;br /&gt;
&lt;br /&gt;
function new() &lt;br /&gt;
   {&lt;br /&gt;
      JRequest::setVar(&#039;view&#039; , &#039;new&#039;);&lt;br /&gt;
      parent::display();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parse error: syntax error, unexpected T_NEW, expecting T_STRING in D:\htdocs\cattleinfo\components\com_breed\controller.php on line 7&lt;br /&gt;
&lt;br /&gt;
so..we need to change the function name first, or yu guys have other option to solve this problem.&lt;br /&gt;
&lt;br /&gt;
Its quite confussing where to insert the following form, is it inside default.php&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;form action = &amp;quot;index.php&amp;quot; method =  &amp;quot;post&amp;quot; id = &amp;quot;adminForm&amp;quot; name = &amp;quot;adminForm&amp;quot; /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;task&amp;quot; value = &amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;option&amp;quot; value = &amp;quot;com_yourcom&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thukten dendup&lt;br /&gt;
&lt;br /&gt;
== Problem with toolbar and SEO ==&lt;br /&gt;
&lt;br /&gt;
Hi&lt;br /&gt;
&lt;br /&gt;
I was very happy when I saw the chapter on using JToolBar in 1.6 – everything looked so easy! But, although the description is very good and nothing is missing, I needed a long time until it worked as expected in my tests. &lt;br /&gt;
&lt;br /&gt;
My problem was: In my installation, I had SEO (Search Engine Friendly URLs) set to „Yes“ – and this somehow mixed up the parameters sent by the edit form (but not in the list form - these buttons worked): option, task and all the other parameters somehow got lost and were never seen by a controller, so „save“ and „cancel“ never worked correctly. After changing this setting, almost everything worked on first try. &lt;br /&gt;
&lt;br /&gt;
The one exception ist the toolbar title: it is never displayed in the front end. Is this the same for everybody or just another problem with my site only?&lt;br /&gt;
&lt;br /&gt;
Many thanks for this article – having all the toolbar functionality easily available in the frontend helps me a lot.&lt;br /&gt;
&lt;br /&gt;
--[[User:Rolfz|Rolfz]] 13:56, 21 August 2011 (CDT)&lt;br /&gt;
&#039;&#039;&#039;Added a section on this. The fix is to define your own &#039;standard&#039; button with a changed HTML function.&lt;br /&gt;
--[[User:Daimonie|Daimonie]] 18:07, 8 Octobre 2012 (GMT+1)&lt;br /&gt;
&lt;br /&gt;
== Javascript and Forms ==&lt;br /&gt;
&lt;br /&gt;
You can add the form in the default.php since Joomla builds the view and appends the toolbars from the controller onto one page. When a button on the toolbar is clicked, it submits the form via javascript. To verify view your HTML source. You should see the HTML rendering the toolbars javascript and the form definition on the same page.&lt;br /&gt;
&lt;br /&gt;
The new keyword is reserved. I changed mine to add&lt;br /&gt;
&lt;br /&gt;
--[[User:EduOngeso|EduOngeso]] 17:34, 28 September 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== id of adminForm is misleading ==&lt;br /&gt;
&lt;br /&gt;
This documentation helped me show the toolbar on the front end, but when I tried to save the form it just didn&#039;t pass any data to the save function in the controller. The cancel button worked well. After days of frustration, the answer turned out to be really simple.&lt;br /&gt;
&lt;br /&gt;
The following comment is very misleading:&lt;br /&gt;
&amp;quot;the toolbar MUST be in a form with the id of &amp;quot;adminForm&amp;quot; in order for it to work.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In fact, I found that the form that you need to submit needs to have id=&amp;quot;adminForm&amp;quot;, and the toolbar itself needs to have a different id (I called mine id=&amp;quot;adminForm2&amp;quot;). Now my form actually saves the data, and doesn&#039;t just complain about mandatory fields which already have data in them. Hopefully this tip can save someone else hours of frustration.&lt;/div&gt;</summary>
		<author><name>Daimonie</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Using_the_JToolBar_class_in_the_frontend&amp;diff=71145</id>
		<title>J1.5 talk:Using the JToolBar class in the frontend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Using_the_JToolBar_class_in_the_frontend&amp;diff=71145"/>
		<updated>2012-08-10T16:08:02Z</updated>

		<summary type="html">&lt;p&gt;Daimonie: /* Problem with toolbar and SEO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== javascript ==&lt;br /&gt;
&lt;br /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
This is a great article :) However I had a small problem due to my lack of experience... I propose a small change in the javascript part:&lt;br /&gt;
Instead of &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;includes/js/joomla.javascript.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&#039;&#039;&#039;, &lt;br /&gt;
shouldn&#039;t it be:&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;includes/js/joomla.javascript.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
?&lt;br /&gt;
&lt;br /&gt;
Since I am quite new to web development (including html and php) it took me some time to understand that the reason behind my buttons inactivity was the language attribute... I do not know if this is a general feature or if it depends on the developer&#039;s configurations... either way, probably this should be mentioned on the article.&lt;br /&gt;
&lt;br /&gt;
--[[User:Sbrandao|Sbrandao]] 13:20, 2 March 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Complete the toolbar look and feel ==&lt;br /&gt;
&lt;br /&gt;
Thanks to the original contributor; very nice piece explaining how we can add the menu to the front end. I would like to add the following to give a more complete picture.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Changes to CSS&#039;&#039;&#039;&lt;br /&gt;
Copy the contents from the following CSS into the new CSS you are creating for your component.&lt;br /&gt;
&lt;br /&gt;
From directory /joomla/administrator/templates/khepri/css&lt;br /&gt;
#  rounded.css or norounded.css as needed (you can copy both if you could be using either of them)&lt;br /&gt;
#  general.css &lt;br /&gt;
#  you can ignore the additions for &#039;&#039;table.toolbar a&#039;&#039; and &#039;&#039;table.toolbar a:hover&#039;&#039; they are already in general.css. However, you need to have the code for icons&lt;br /&gt;
&lt;br /&gt;
The code copied from general.css has the styles for &#039;&#039;div.header&#039;&#039;. By default the color is #0B55C4, change this to your color of choice&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Changes to com_yourcomponent.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;&amp;lt;div id=\&amp;quot;toolbar-box\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;t\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;t\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;t\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;m\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo yourcomponentHelperToolbar::getToolbar( );&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;header\&amp;quot;&amp;gt;menu header&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;clr\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;b\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;b\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;div class=\&amp;quot;b\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
echo &amp;quot;&amp;lt;/div&amp;gt;\n&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will make sure that the look and feel is exactly like the backend.&lt;br /&gt;
&lt;br /&gt;
Enjoy the toolbar!!!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;New&amp;quot; is a reserved word ergo you can&#039;t have a function called &amp;quot;new&amp;quot; you will get a syntax error that wont go away. So you need to change the name of the &amp;quot;task&amp;quot; &amp;quot;new&amp;quot; to something like &amp;quot;mynew&amp;quot; and then the function to &amp;quot;mynew&amp;quot; also.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hey, something is not working with the function name new(): &lt;br /&gt;
&lt;br /&gt;
function new() &lt;br /&gt;
   {&lt;br /&gt;
      JRequest::setVar(&#039;view&#039; , &#039;new&#039;);&lt;br /&gt;
      parent::display();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parse error: syntax error, unexpected T_NEW, expecting T_STRING in D:\htdocs\cattleinfo\components\com_breed\controller.php on line 7&lt;br /&gt;
&lt;br /&gt;
so..we need to change the function name first, or yu guys have other option to solve this problem.&lt;br /&gt;
&lt;br /&gt;
Its quite confussing where to insert the following form, is it inside default.php&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;form action = &amp;quot;index.php&amp;quot; method =  &amp;quot;post&amp;quot; id = &amp;quot;adminForm&amp;quot; name = &amp;quot;adminForm&amp;quot; /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;task&amp;quot; value = &amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;option&amp;quot; value = &amp;quot;com_yourcom&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thukten dendup&lt;br /&gt;
&lt;br /&gt;
== Problem with toolbar and SEO ==&lt;br /&gt;
&lt;br /&gt;
Hi&lt;br /&gt;
&lt;br /&gt;
I was very happy when I saw the chapter on using JToolBar in 1.6 – everything looked so easy! But, although the description is very good and nothing is missing, I needed a long time until it worked as expected in my tests. &lt;br /&gt;
&lt;br /&gt;
My problem was: In my installation, I had SEO (Search Engine Friendly URLs) set to „Yes“ – and this somehow mixed up the parameters sent by the edit form (but not in the list form - these buttons worked): option, task and all the other parameters somehow got lost and were never seen by a controller, so „save“ and „cancel“ never worked correctly. After changing this setting, almost everything worked on first try. &lt;br /&gt;
&lt;br /&gt;
The one exception ist the toolbar title: it is never displayed in the front end. Is this the same for everybody or just another problem with my site only?&lt;br /&gt;
&lt;br /&gt;
Many thanks for this article – having all the toolbar functionality easily available in the frontend helps me a lot.&lt;br /&gt;
&lt;br /&gt;
--[[User:Rolfz|Rolfz]] 13:56, 21 August 2011 (CDT)&lt;br /&gt;
&#039;&#039;&#039;Added a section on this. The fix is to define your own &#039;standard&#039; button with a changed HTML function.&lt;br /&gt;
--[[User:Daimonie|Daimonie]] 18:07, 8 Octobre 2012 (GMT+1)&lt;br /&gt;
&lt;br /&gt;
== Javascript and Forms ==&lt;br /&gt;
&lt;br /&gt;
You can add the form in the default.php since Joomla builds the view and appends the toolbars from the controller onto one page. When a button on the toolbar is clicked, it submits the form via javascript. To verify view your HTML source. You should see the HTML rendering the toolbars javascript and the form definition on the same page.&lt;br /&gt;
&lt;br /&gt;
The new keyword is reserved. I changed mine to add&lt;br /&gt;
&lt;br /&gt;
--[[User:EduOngeso|EduOngeso]] 17:34, 28 September 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== id of adminForm is misleading ==&lt;br /&gt;
&lt;br /&gt;
This documentation helped me show the toolbar on the front end, but when I tried to save the form it just didn&#039;t pass any data to the save function in the controller. The cancel button worked well. After days of frustration, the answer turned out to be really simple.&lt;br /&gt;
&lt;br /&gt;
The following comment is very misleading:&lt;br /&gt;
&amp;quot;the toolbar MUST be in a form with the id of &amp;quot;adminForm&amp;quot; in order for it to work.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In fact, I found that the form that you need to submit needs to have id=&amp;quot;adminForm&amp;quot;, and the toolbar itself needs to have a different id (I called mine id=&amp;quot;adminForm2&amp;quot;). Now my form actually saves the data, and doesn&#039;t just complain about mandatory fields which already have data in them. Hopefully this tip can save someone else hours of frustration.&lt;/div&gt;</summary>
		<author><name>Daimonie</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JToolBar_class_in_the_frontend&amp;diff=71144</id>
		<title>J1.5:Using the JToolBar class in the frontend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JToolBar_class_in_the_frontend&amp;diff=71144"/>
		<updated>2012-08-10T16:06:47Z</updated>

		<summary type="html">&lt;p&gt;Daimonie: /* Using JToolBar in 1.6 and newer with Search Engine Friendly enabled (SEF) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using JToolBar in 1.6 and newer with Search Engine Friendly enabled (SEF)==&lt;br /&gt;
When using the toolbar on the frontend,the standard buttons will sometimes bug out. This is usually because Search Engine Friendly urls is defined.&lt;br /&gt;
&lt;br /&gt;
What happens is that instead of going to index.php?option=com_yourcom&amp;amp;view=&amp;amp;...#, it will go to index.php/friendlyurl# . This bugs out many users.&lt;br /&gt;
&lt;br /&gt;
Using these two together can be done,however. There&#039;s two tricks to it. First, make a class called JButtonFrontend and extend JButton. For this, jimport(&#039;joomla.html.toolbar&#039;) has to be done,because this includes the standard button classes.&lt;br /&gt;
&lt;br /&gt;
Just copy over the content of joomla.html.toolbar.button standard.php; then, change the fetchbutton function&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
//Goes inside JButtonFrontend class definition.&lt;br /&gt;
	public function fetchButton($type = &#039;Standard&#039;, $name = &#039;&#039;, $text = &#039;&#039;, $task = &#039;&#039;, $list = true)&lt;br /&gt;
	{&lt;br /&gt;
		$i18n_text = JText::_($text);&lt;br /&gt;
		$class = $this-&amp;gt;fetchIconClass($name);&lt;br /&gt;
		$doTask = $this-&amp;gt;_getCommand($text, $task, $list);&lt;br /&gt;
&lt;br /&gt;
		$html = &amp;quot;&amp;lt;a href=\&amp;quot;javascript: void( $doTask);\&amp;quot; onclick=\&amp;quot;$doTask\&amp;quot; class=\&amp;quot;toolbar\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
		$html .= &amp;quot;&amp;lt;span class=\&amp;quot;$class\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
		$html .= &amp;quot;&amp;lt;/span&amp;gt;\n&amp;quot;;&lt;br /&gt;
		$html .= &amp;quot;$i18n_text\n&amp;quot;;&lt;br /&gt;
		$html .= &amp;quot;&amp;lt;/a&amp;gt;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		return $html;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, in your mainfile (site/yourcom.php), use this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JLoader::register(&#039;JButtonFrontend&#039;, dirname(__FILE__) . DS . &#039;buttons&#039; . DS . &#039;frontend.php&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, I made a directory called &#039;buttons&#039;  in my /site directory. If you do so, don&#039;t forget to add it to your package xml file! (yourcom.xml).&lt;br /&gt;
&lt;br /&gt;
You can now use the &#039;Frontend&#039; button:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;bar-&amp;gt;appendButton( &#039;Frontend&#039;, &#039;name&#039;, &#039;label&#039;, &#039;subcontroller.method&#039;, false );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using JToolBar in 1.6 and newer==&lt;br /&gt;
{{JVer|1.6}}{{JVer|1.7}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s even simpler to use JToolBar in the front end, as it only requires two steps.&lt;br /&gt;
First (Using the MVC architecture of 1.6), add a function definition to view.html.php file in the view you wish to add the toolbar to.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;gt;&lt;br /&gt;
	function getToolbar() {&lt;br /&gt;
		// add required stylesheets from admin template&lt;br /&gt;
		$document    = &amp;amp; JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;addStyleSheet(&#039;administrator/templates/system/css/system.css&#039;);&lt;br /&gt;
		//now we add the necessary stylesheets from the administrator template&lt;br /&gt;
		//in this case i make reference to the bluestork default administrator template in joomla 1.6&lt;br /&gt;
		$document-&amp;gt;addCustomTag(&lt;br /&gt;
			&#039;&amp;lt;link href=&amp;quot;administrator/templates/bluestork/css/template.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&#039;.&amp;quot;\n\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;!--[if IE 7]&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;link href=&amp;quot;administrator/templates/bluestork/css/ie7.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;![endif]--&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;!--[if gte IE 8]&amp;gt;&#039;.&amp;quot;\n\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;link href=&amp;quot;administrator/templates/bluestork/css/ie8.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;![endif]--&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;administrator/templates/bluestork/css/rounded.css&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&#039;.&amp;quot;\n&amp;quot;&lt;br /&gt;
			);&lt;br /&gt;
		//load the JToolBar library and create a toolbar&lt;br /&gt;
		jimport(&#039;joomla.html.toolbar&#039;);&lt;br /&gt;
		$bar =&amp;amp; new JToolBar( &#039;toolbar&#039; );&lt;br /&gt;
		//and make whatever calls you require&lt;br /&gt;
		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;save&#039;, &#039;Save&#039;, &#039;savetask&#039;, false );&lt;br /&gt;
		$bar-&amp;gt;appendButton( &#039;Separator&#039; );&lt;br /&gt;
		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;cancel&#039;, &#039;Cancel&#039;, &#039;canceltask&#039;, false );&lt;br /&gt;
		//generate the html and return&lt;br /&gt;
		return $bar-&amp;gt;render();&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now in the corresponding tmpl file, you simply need to add code like the following (added here to a default.php file in the tmpl folder of the view to which the code above was added to the view.html.php file.&lt;br /&gt;
Note I say &amp;quot;like&amp;quot; the following, changes may be required. I&#039;m including the &amp;lt;form&amp;gt; declaration html (the toolbar MUST be in a form with the id of &amp;quot;adminForm&amp;quot; in order for it to work.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;adminForm&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo $this-&amp;gt;getToolbar(); ?&amp;gt;&lt;br /&gt;
	&amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;task&amp;quot; value = &amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;option&amp;quot; value = &amp;quot;com_yourcom&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You&#039;ll note the [div class=&amp;quot;clr&amp;quot;] which you may or may not need depending on your own design requirements. If you don&#039;t add the div tag, slapping this code into an existing component front end will place the buttons to the right and level with the content on the left.&lt;br /&gt;
Also, and as explained above, you&#039;ll need to add functions within the controller that is called when one of the toolbar buttons is pressed, to process the request gracefully.&lt;br /&gt;
&lt;br /&gt;
== Using JToolBar in 1.5 ==&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Anyone whom has used the very useful JToolbarHelper class in an administration component has probably already realised that there is nothing quite so useful for the frontend. The good news is that we can create our own very simply using the JToolbar class.&lt;br /&gt;
&lt;br /&gt;
First lets create the helper class. I tend to make a different helper class for each component as they will each have a different toolbar. I like to keep all my helpers in the administration end as they can often be used for both sides of the component. So firstly create a helpers directory in your component.&lt;br /&gt;
&lt;br /&gt;
/administrator/components/com_yourcom/helpers&lt;br /&gt;
&lt;br /&gt;
and create a file called toolbar.php&lt;br /&gt;
&lt;br /&gt;
The following is an example of a very simple toolbar helper class. Copy and paste this into your toolbar.php file. Don&#039;t forget to change &#039;yourcom&#039; to the name of your component. Notice also that we&#039;ve included the Jtoolbar class at the top of the file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 // no direct access&lt;br /&gt;
 defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 jimport(&#039;joomla.html.toolbar&#039;);&lt;br /&gt;
 &lt;br /&gt;
 class YourcomHelperToolbar extends JObject&lt;br /&gt;
 {	&lt;br /&gt;
 	function getToolbar() {&lt;br /&gt;
 		&lt;br /&gt;
 		&lt;br /&gt;
 		$bar =&amp;amp; new JToolBar( &#039;My Toolbar&#039; );&lt;br /&gt;
 		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;new&#039;, &#039;New Record&#039;, &#039;new&#039;, false );&lt;br /&gt;
 		$bar-&amp;gt;appendButton( &#039;Separator&#039; );&lt;br /&gt;
 		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;delete&#039;, &#039;Delete Record&#039;, &#039;delete&#039;, false );&lt;br /&gt;
 		&lt;br /&gt;
 		&lt;br /&gt;
 		return $bar-&amp;gt;render();&lt;br /&gt;
 	&lt;br /&gt;
 	}&lt;br /&gt;
 	&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Lets look at this code. When the &#039;getToolbar&#039; function is called it creates a new instance of the JToolbar class.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $bar =&amp;amp; new JToolBar( &#039;Associations Toolbar&#039; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We can then add buttons to this object.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;new&#039;, &#039;New Record&#039;, &#039;new&#039;, false );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The first parameter is the button type. have a look a the JToolbar or JButton docs for a full list of these.&lt;br /&gt;
&lt;br /&gt;
The second parameter is the class to apply to the button ( this will help us to apply an image to it as in the backend )&lt;br /&gt;
&lt;br /&gt;
The third parameter is the text to display on the button.&lt;br /&gt;
&lt;br /&gt;
The fourth is the task to set. When the button is pressed the javascript submitButton function is called and the hidden field &#039;task&#039; is set to this value. We will see this later in our template file.&lt;br /&gt;
&lt;br /&gt;
The fifth states whether a selection must be made from an admin list before continuing.&lt;br /&gt;
&lt;br /&gt;
we then simply return our bar object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now have a choice of where to render this bar object. You can create it in a view and apply it to a template if you wish. I personally prefer to render it in the entry point file. In this example this would be yourcom.php and would look something like this. Notice that we have also included our helper file here.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 // no direct access&lt;br /&gt;
 defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
 // Require the base controller&lt;br /&gt;
 require_once (JPATH_COMPONENT.DS.&#039;controller.php&#039;);&lt;br /&gt;
 &lt;br /&gt;
 // Require specific controller if requested&lt;br /&gt;
 if($controller = JRequest::getVar(&#039;controller&#039;)) {&lt;br /&gt;
 	require_once (JPATH_COMPONENT.DS.&#039;controllers&#039;.DS.$controller.&#039;.php&#039;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // Component Helper&lt;br /&gt;
 jimport(&#039;joomla.application.component.helper&#039;);&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // Load the toolbar helper&lt;br /&gt;
 require_once( JPATH_COMPONENT_ADMINISTRATOR.DS.&#039;helpers&#039;.DS.&#039;toolbar.php&#039; );&lt;br /&gt;
 &lt;br /&gt;
 // render the toolbar on the page. rendering it here means that it is displayed on every view of your component.&lt;br /&gt;
 echo YourcomHelperToolbar::getToolbar();&lt;br /&gt;
 &lt;br /&gt;
 // Create the controller&lt;br /&gt;
 $classname	= &#039;YourcomController&#039;.$controller;&lt;br /&gt;
 $controller = new $classname( );&lt;br /&gt;
 &lt;br /&gt;
 // Perform the Request task&lt;br /&gt;
 $controller-&amp;gt;execute( JRequest::getVar(&#039;task&#039;));&lt;br /&gt;
 &lt;br /&gt;
 // Redirect if set by the controller&lt;br /&gt;
 $controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Having created this the toolbar you created should render on the page but there are a few more things we need to do to make it work. We need to ensure that every view template page has an admin form for the submitButton function to work.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;form action = &amp;quot;index.php&amp;quot; method =  &amp;quot;post&amp;quot; id = &amp;quot;adminForm&amp;quot; name = &amp;quot;adminForm&amp;quot; /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;task&amp;quot; value = &amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;option&amp;quot; value = &amp;quot;com_yourcom&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now when one of the buttons is clicked the submitbutton function will set the hidden field &#039;task&#039; to the task identifier you specified in the toolbar class.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;delete&#039;, &#039;Delete Record&#039;, &#039;new&#039;, false );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In the above button the task would be &#039;new&#039; ( the fourth parameter );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If this task is going to be run we had better make sure that it&#039;s available in our controller. Open up your controller.php and add the following.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 function new() &lt;br /&gt;
 	{&lt;br /&gt;
 		JRequest::setVar(&#039;view&#039; , &#039;new&#039;);&lt;br /&gt;
 		&lt;br /&gt;
 		parent::display();&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will display your &#039;new&#039; view assuming you&#039;ve already created one. You could put any code in here you like.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There we go that should create a nice easy to use toolbar class. There is one last thing though. You may have noticed that the icons are not displaying as they do in the backend. To make this work we have to &#039;steal&#039; some images and some CSS from the backend.&lt;br /&gt;
&lt;br /&gt;
open up the folder &lt;br /&gt;
&lt;br /&gt;
 administrator/templates/khepri/images &lt;br /&gt;
&lt;br /&gt;
and copy the directory &#039;toolbar&#039; directory to your frontend templates/rhuk_milkyway/images folder&lt;br /&gt;
&lt;br /&gt;
It should now look like this&lt;br /&gt;
&lt;br /&gt;
 templates/rhuk_milkyway/images/toolbar&lt;br /&gt;
&lt;br /&gt;
and be filled with png images&lt;br /&gt;
&lt;br /&gt;
Now you could hunt around through the backend css to find the correct code to display the buttons but I&#039;ve saved you the trouble. In your templates/css folder create a file called icon.css and paste in the following code.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 /* toolbar */&lt;br /&gt;
 div.toolbar { float: right; text-align: right; padding: 0; }&lt;br /&gt;
 &lt;br /&gt;
 table.toolbar    			 { border-collapse: collapse; padding: 0; margin: 0;	 }&lt;br /&gt;
 table.toolbar td 			 { padding: 1px 1px 1px 4px; text-align: center; color: #666; height: 48px; }&lt;br /&gt;
 table.toolbar td.spacer  { width: 10px; }&lt;br /&gt;
 table.toolbar td.divider { border-right: 1px solid #eee; width: 5px; } &lt;br /&gt;
 &lt;br /&gt;
 table.toolbar span { float: none; width: 32px; height: 32px; margin: 0 auto; display: block; }&lt;br /&gt;
 &lt;br /&gt;
 table.toolbar a {&lt;br /&gt;
    display: block; float: left;&lt;br /&gt;
 	white-space: nowrap;&lt;br /&gt;
 	border: 1px solid #fbfbfb;&lt;br /&gt;
 	padding: 1px 5px;&lt;br /&gt;
 	cursor: pointer;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 table.toolbar a:hover {&lt;br /&gt;
 	border-left: 1px solid #eee;&lt;br /&gt;
 	border-top: 1px solid #eee;&lt;br /&gt;
 	border-right: 1px solid #ccc;&lt;br /&gt;
 	border-bottom: 1px solid #ccc;&lt;br /&gt;
 	text-decoration: none;&lt;br /&gt;
 	color: #0B55C4;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /** toolbar icons **/&lt;br /&gt;
 .icon-32-send 			{ background-image: url(../images/toolbar/icon-32-send.png); }&lt;br /&gt;
 .icon-32-delete 		{ background-image: url(../images/toolbar/icon-32-delete.png); }&lt;br /&gt;
 .icon-32-help 			{ background-image: url(../images/toolbar/icon-32-help.png); }&lt;br /&gt;
 .icon-32-cancel 		{ background-image: url(../images/toolbar/icon-32-cancel.png); }&lt;br /&gt;
 .icon-32-config 		{ background-image: url(../images/toolbar/icon-32-config.png); }&lt;br /&gt;
 .icon-32-apply 		{ background-image: url(../images/toolbar/icon-32-apply.png); }&lt;br /&gt;
 .icon-32-back			{ background-image: url(../images/toolbar/icon-32-back.png); }&lt;br /&gt;
 .icon-32-forward		{ background-image: url(../images/toolbar/icon-32-forward.png); }&lt;br /&gt;
 .icon-32-save 			{ background-image: url(../images/toolbar/icon-32-save.png); }&lt;br /&gt;
 .icon-32-edit 			{ background-image: url(../images/toolbar/icon-32-edit.png); }&lt;br /&gt;
 .icon-32-copy 			{ background-image: url(../images/toolbar/icon-32-copy.png); }&lt;br /&gt;
 .icon-32-move 			{ background-image: url(../images/toolbar/icon-32-move.png); }&lt;br /&gt;
 .icon-32-new 			{ background-image: url(../images/toolbar/icon-32-new.png); }&lt;br /&gt;
 .icon-32-upload 		{ background-image: url(../images/toolbar/icon-32-upload.png); }&lt;br /&gt;
 .icon-32-assign 		{ background-image: url(../images/toolbar/icon-32-publish.png); }&lt;br /&gt;
 .icon-32-html 			{ background-image: url(../images/toolbar/icon-32-html.png); }&lt;br /&gt;
 .icon-32-css 			{ background-image: url(../images/toolbar/icon-32-css.png); }&lt;br /&gt;
 .icon-32-menus 			{ background-image: url(../images/toolbar/icon-32-menu.png); }&lt;br /&gt;
 .icon-32-publish 		{ background-image: url(../images/toolbar/icon-32-publish.png); }&lt;br /&gt;
 .icon-32-unpublish 	{ background-image: url(../images/toolbar/icon-32-unpublish.png);}&lt;br /&gt;
 .icon-32-restore		{ background-image: url(../images/toolbar/icon-32-revert.png); }&lt;br /&gt;
 .icon-32-trash 		{ background-image: url(../images/toolbar/icon-32-trash.png); }&lt;br /&gt;
 .icon-32-archive 		{ background-image: url(../images/toolbar/icon-32-archive.png); }&lt;br /&gt;
 .icon-32-unarchive 	{ background-image: url(../images/toolbar/icon-32-unarchive.png); }&lt;br /&gt;
 .icon-32-preview 		{ background-image: url(../images/toolbar/icon-32-preview.png); }&lt;br /&gt;
 .icon-32-default 		{ background-image: url(../images/toolbar/icon-32-default.png); }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We now have to include this css in to your template so add the following line to the top of your template index.php&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;baseurl ?&amp;gt;/templates/rhuk_milkyway/css/icon.css&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(if you are using the toolbar on a component that other people will be installing it would be better to use: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mainframe-&amp;gt;addCustomHeadTag (&#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&#039;.$this-&amp;gt;baseurl.&#039;/components/com_**yourcomponent**/filename.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot; /&amp;gt;&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And finally - you will require the javascript file used in the backend to enable the buttons to work ;-)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mainframe-&amp;gt;addCustomHeadTag (&#039;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/includes/js/joomla.javascript.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And that&#039;s it. your toolbar should now render exactly as it does in the backend. This is a very simple toolbar helper. You could equally copy the JToolbarHelper class exactly in to your toolbar helper and use the functions in the same way as the backend. This would allow you to reuse your jtoolbar helper in multiple components.&lt;br /&gt;
&lt;br /&gt;
To use JToolbarHelper Class in frontend section of your component, add this code to your component&#039;s entry point ( components/com_yourcom/yourcom.php )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
require_once(JPATH_ADMINISTRATOR.DS.&#039;includes&#039;.DS.&#039;toolbar.php&#039;);&lt;br /&gt;
$doc =&amp;amp; JFactory::getDocument();&lt;br /&gt;
$doc-&amp;gt;addScript(&amp;quot;includes/js/joomla.javascript.js&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Development]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daimonie</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JToolBar_class_in_the_frontend&amp;diff=71143</id>
		<title>J1.5:Using the JToolBar class in the frontend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JToolBar_class_in_the_frontend&amp;diff=71143"/>
		<updated>2012-08-10T16:00:58Z</updated>

		<summary type="html">&lt;p&gt;Daimonie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using JToolBar in 1.6 and newer with Search Engine Friendly enabled (SEF)==&lt;br /&gt;
&lt;br /&gt;
== Using JToolBar in 1.6 and newer==&lt;br /&gt;
{{JVer|1.6}}{{JVer|1.7}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s even simpler to use JToolBar in the front end, as it only requires two steps.&lt;br /&gt;
First (Using the MVC architecture of 1.6), add a function definition to view.html.php file in the view you wish to add the toolbar to.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;gt;&lt;br /&gt;
	function getToolbar() {&lt;br /&gt;
		// add required stylesheets from admin template&lt;br /&gt;
		$document    = &amp;amp; JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;addStyleSheet(&#039;administrator/templates/system/css/system.css&#039;);&lt;br /&gt;
		//now we add the necessary stylesheets from the administrator template&lt;br /&gt;
		//in this case i make reference to the bluestork default administrator template in joomla 1.6&lt;br /&gt;
		$document-&amp;gt;addCustomTag(&lt;br /&gt;
			&#039;&amp;lt;link href=&amp;quot;administrator/templates/bluestork/css/template.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&#039;.&amp;quot;\n\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;!--[if IE 7]&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;link href=&amp;quot;administrator/templates/bluestork/css/ie7.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;![endif]--&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;!--[if gte IE 8]&amp;gt;&#039;.&amp;quot;\n\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;link href=&amp;quot;administrator/templates/bluestork/css/ie8.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;![endif]--&amp;gt;&#039;.&amp;quot;\n&amp;quot;.&lt;br /&gt;
			&#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;administrator/templates/bluestork/css/rounded.css&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&#039;.&amp;quot;\n&amp;quot;&lt;br /&gt;
			);&lt;br /&gt;
		//load the JToolBar library and create a toolbar&lt;br /&gt;
		jimport(&#039;joomla.html.toolbar&#039;);&lt;br /&gt;
		$bar =&amp;amp; new JToolBar( &#039;toolbar&#039; );&lt;br /&gt;
		//and make whatever calls you require&lt;br /&gt;
		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;save&#039;, &#039;Save&#039;, &#039;savetask&#039;, false );&lt;br /&gt;
		$bar-&amp;gt;appendButton( &#039;Separator&#039; );&lt;br /&gt;
		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;cancel&#039;, &#039;Cancel&#039;, &#039;canceltask&#039;, false );&lt;br /&gt;
		//generate the html and return&lt;br /&gt;
		return $bar-&amp;gt;render();&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now in the corresponding tmpl file, you simply need to add code like the following (added here to a default.php file in the tmpl folder of the view to which the code above was added to the view.html.php file.&lt;br /&gt;
Note I say &amp;quot;like&amp;quot; the following, changes may be required. I&#039;m including the &amp;lt;form&amp;gt; declaration html (the toolbar MUST be in a form with the id of &amp;quot;adminForm&amp;quot; in order for it to work.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;adminForm&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo $this-&amp;gt;getToolbar(); ?&amp;gt;&lt;br /&gt;
	&amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;task&amp;quot; value = &amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;option&amp;quot; value = &amp;quot;com_yourcom&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You&#039;ll note the [div class=&amp;quot;clr&amp;quot;] which you may or may not need depending on your own design requirements. If you don&#039;t add the div tag, slapping this code into an existing component front end will place the buttons to the right and level with the content on the left.&lt;br /&gt;
Also, and as explained above, you&#039;ll need to add functions within the controller that is called when one of the toolbar buttons is pressed, to process the request gracefully.&lt;br /&gt;
&lt;br /&gt;
== Using JToolBar in 1.5 ==&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Anyone whom has used the very useful JToolbarHelper class in an administration component has probably already realised that there is nothing quite so useful for the frontend. The good news is that we can create our own very simply using the JToolbar class.&lt;br /&gt;
&lt;br /&gt;
First lets create the helper class. I tend to make a different helper class for each component as they will each have a different toolbar. I like to keep all my helpers in the administration end as they can often be used for both sides of the component. So firstly create a helpers directory in your component.&lt;br /&gt;
&lt;br /&gt;
/administrator/components/com_yourcom/helpers&lt;br /&gt;
&lt;br /&gt;
and create a file called toolbar.php&lt;br /&gt;
&lt;br /&gt;
The following is an example of a very simple toolbar helper class. Copy and paste this into your toolbar.php file. Don&#039;t forget to change &#039;yourcom&#039; to the name of your component. Notice also that we&#039;ve included the Jtoolbar class at the top of the file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 // no direct access&lt;br /&gt;
 defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 jimport(&#039;joomla.html.toolbar&#039;);&lt;br /&gt;
 &lt;br /&gt;
 class YourcomHelperToolbar extends JObject&lt;br /&gt;
 {	&lt;br /&gt;
 	function getToolbar() {&lt;br /&gt;
 		&lt;br /&gt;
 		&lt;br /&gt;
 		$bar =&amp;amp; new JToolBar( &#039;My Toolbar&#039; );&lt;br /&gt;
 		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;new&#039;, &#039;New Record&#039;, &#039;new&#039;, false );&lt;br /&gt;
 		$bar-&amp;gt;appendButton( &#039;Separator&#039; );&lt;br /&gt;
 		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;delete&#039;, &#039;Delete Record&#039;, &#039;delete&#039;, false );&lt;br /&gt;
 		&lt;br /&gt;
 		&lt;br /&gt;
 		return $bar-&amp;gt;render();&lt;br /&gt;
 	&lt;br /&gt;
 	}&lt;br /&gt;
 	&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Lets look at this code. When the &#039;getToolbar&#039; function is called it creates a new instance of the JToolbar class.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $bar =&amp;amp; new JToolBar( &#039;Associations Toolbar&#039; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We can then add buttons to this object.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;new&#039;, &#039;New Record&#039;, &#039;new&#039;, false );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The first parameter is the button type. have a look a the JToolbar or JButton docs for a full list of these.&lt;br /&gt;
&lt;br /&gt;
The second parameter is the class to apply to the button ( this will help us to apply an image to it as in the backend )&lt;br /&gt;
&lt;br /&gt;
The third parameter is the text to display on the button.&lt;br /&gt;
&lt;br /&gt;
The fourth is the task to set. When the button is pressed the javascript submitButton function is called and the hidden field &#039;task&#039; is set to this value. We will see this later in our template file.&lt;br /&gt;
&lt;br /&gt;
The fifth states whether a selection must be made from an admin list before continuing.&lt;br /&gt;
&lt;br /&gt;
we then simply return our bar object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now have a choice of where to render this bar object. You can create it in a view and apply it to a template if you wish. I personally prefer to render it in the entry point file. In this example this would be yourcom.php and would look something like this. Notice that we have also included our helper file here.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 // no direct access&lt;br /&gt;
 defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
 // Require the base controller&lt;br /&gt;
 require_once (JPATH_COMPONENT.DS.&#039;controller.php&#039;);&lt;br /&gt;
 &lt;br /&gt;
 // Require specific controller if requested&lt;br /&gt;
 if($controller = JRequest::getVar(&#039;controller&#039;)) {&lt;br /&gt;
 	require_once (JPATH_COMPONENT.DS.&#039;controllers&#039;.DS.$controller.&#039;.php&#039;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // Component Helper&lt;br /&gt;
 jimport(&#039;joomla.application.component.helper&#039;);&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // Load the toolbar helper&lt;br /&gt;
 require_once( JPATH_COMPONENT_ADMINISTRATOR.DS.&#039;helpers&#039;.DS.&#039;toolbar.php&#039; );&lt;br /&gt;
 &lt;br /&gt;
 // render the toolbar on the page. rendering it here means that it is displayed on every view of your component.&lt;br /&gt;
 echo YourcomHelperToolbar::getToolbar();&lt;br /&gt;
 &lt;br /&gt;
 // Create the controller&lt;br /&gt;
 $classname	= &#039;YourcomController&#039;.$controller;&lt;br /&gt;
 $controller = new $classname( );&lt;br /&gt;
 &lt;br /&gt;
 // Perform the Request task&lt;br /&gt;
 $controller-&amp;gt;execute( JRequest::getVar(&#039;task&#039;));&lt;br /&gt;
 &lt;br /&gt;
 // Redirect if set by the controller&lt;br /&gt;
 $controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Having created this the toolbar you created should render on the page but there are a few more things we need to do to make it work. We need to ensure that every view template page has an admin form for the submitButton function to work.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;form action = &amp;quot;index.php&amp;quot; method =  &amp;quot;post&amp;quot; id = &amp;quot;adminForm&amp;quot; name = &amp;quot;adminForm&amp;quot; /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;task&amp;quot; value = &amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;option&amp;quot; value = &amp;quot;com_yourcom&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now when one of the buttons is clicked the submitbutton function will set the hidden field &#039;task&#039; to the task identifier you specified in the toolbar class.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;delete&#039;, &#039;Delete Record&#039;, &#039;new&#039;, false );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In the above button the task would be &#039;new&#039; ( the fourth parameter );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If this task is going to be run we had better make sure that it&#039;s available in our controller. Open up your controller.php and add the following.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 function new() &lt;br /&gt;
 	{&lt;br /&gt;
 		JRequest::setVar(&#039;view&#039; , &#039;new&#039;);&lt;br /&gt;
 		&lt;br /&gt;
 		parent::display();&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will display your &#039;new&#039; view assuming you&#039;ve already created one. You could put any code in here you like.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There we go that should create a nice easy to use toolbar class. There is one last thing though. You may have noticed that the icons are not displaying as they do in the backend. To make this work we have to &#039;steal&#039; some images and some CSS from the backend.&lt;br /&gt;
&lt;br /&gt;
open up the folder &lt;br /&gt;
&lt;br /&gt;
 administrator/templates/khepri/images &lt;br /&gt;
&lt;br /&gt;
and copy the directory &#039;toolbar&#039; directory to your frontend templates/rhuk_milkyway/images folder&lt;br /&gt;
&lt;br /&gt;
It should now look like this&lt;br /&gt;
&lt;br /&gt;
 templates/rhuk_milkyway/images/toolbar&lt;br /&gt;
&lt;br /&gt;
and be filled with png images&lt;br /&gt;
&lt;br /&gt;
Now you could hunt around through the backend css to find the correct code to display the buttons but I&#039;ve saved you the trouble. In your templates/css folder create a file called icon.css and paste in the following code.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 /* toolbar */&lt;br /&gt;
 div.toolbar { float: right; text-align: right; padding: 0; }&lt;br /&gt;
 &lt;br /&gt;
 table.toolbar    			 { border-collapse: collapse; padding: 0; margin: 0;	 }&lt;br /&gt;
 table.toolbar td 			 { padding: 1px 1px 1px 4px; text-align: center; color: #666; height: 48px; }&lt;br /&gt;
 table.toolbar td.spacer  { width: 10px; }&lt;br /&gt;
 table.toolbar td.divider { border-right: 1px solid #eee; width: 5px; } &lt;br /&gt;
 &lt;br /&gt;
 table.toolbar span { float: none; width: 32px; height: 32px; margin: 0 auto; display: block; }&lt;br /&gt;
 &lt;br /&gt;
 table.toolbar a {&lt;br /&gt;
    display: block; float: left;&lt;br /&gt;
 	white-space: nowrap;&lt;br /&gt;
 	border: 1px solid #fbfbfb;&lt;br /&gt;
 	padding: 1px 5px;&lt;br /&gt;
 	cursor: pointer;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 table.toolbar a:hover {&lt;br /&gt;
 	border-left: 1px solid #eee;&lt;br /&gt;
 	border-top: 1px solid #eee;&lt;br /&gt;
 	border-right: 1px solid #ccc;&lt;br /&gt;
 	border-bottom: 1px solid #ccc;&lt;br /&gt;
 	text-decoration: none;&lt;br /&gt;
 	color: #0B55C4;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /** toolbar icons **/&lt;br /&gt;
 .icon-32-send 			{ background-image: url(../images/toolbar/icon-32-send.png); }&lt;br /&gt;
 .icon-32-delete 		{ background-image: url(../images/toolbar/icon-32-delete.png); }&lt;br /&gt;
 .icon-32-help 			{ background-image: url(../images/toolbar/icon-32-help.png); }&lt;br /&gt;
 .icon-32-cancel 		{ background-image: url(../images/toolbar/icon-32-cancel.png); }&lt;br /&gt;
 .icon-32-config 		{ background-image: url(../images/toolbar/icon-32-config.png); }&lt;br /&gt;
 .icon-32-apply 		{ background-image: url(../images/toolbar/icon-32-apply.png); }&lt;br /&gt;
 .icon-32-back			{ background-image: url(../images/toolbar/icon-32-back.png); }&lt;br /&gt;
 .icon-32-forward		{ background-image: url(../images/toolbar/icon-32-forward.png); }&lt;br /&gt;
 .icon-32-save 			{ background-image: url(../images/toolbar/icon-32-save.png); }&lt;br /&gt;
 .icon-32-edit 			{ background-image: url(../images/toolbar/icon-32-edit.png); }&lt;br /&gt;
 .icon-32-copy 			{ background-image: url(../images/toolbar/icon-32-copy.png); }&lt;br /&gt;
 .icon-32-move 			{ background-image: url(../images/toolbar/icon-32-move.png); }&lt;br /&gt;
 .icon-32-new 			{ background-image: url(../images/toolbar/icon-32-new.png); }&lt;br /&gt;
 .icon-32-upload 		{ background-image: url(../images/toolbar/icon-32-upload.png); }&lt;br /&gt;
 .icon-32-assign 		{ background-image: url(../images/toolbar/icon-32-publish.png); }&lt;br /&gt;
 .icon-32-html 			{ background-image: url(../images/toolbar/icon-32-html.png); }&lt;br /&gt;
 .icon-32-css 			{ background-image: url(../images/toolbar/icon-32-css.png); }&lt;br /&gt;
 .icon-32-menus 			{ background-image: url(../images/toolbar/icon-32-menu.png); }&lt;br /&gt;
 .icon-32-publish 		{ background-image: url(../images/toolbar/icon-32-publish.png); }&lt;br /&gt;
 .icon-32-unpublish 	{ background-image: url(../images/toolbar/icon-32-unpublish.png);}&lt;br /&gt;
 .icon-32-restore		{ background-image: url(../images/toolbar/icon-32-revert.png); }&lt;br /&gt;
 .icon-32-trash 		{ background-image: url(../images/toolbar/icon-32-trash.png); }&lt;br /&gt;
 .icon-32-archive 		{ background-image: url(../images/toolbar/icon-32-archive.png); }&lt;br /&gt;
 .icon-32-unarchive 	{ background-image: url(../images/toolbar/icon-32-unarchive.png); }&lt;br /&gt;
 .icon-32-preview 		{ background-image: url(../images/toolbar/icon-32-preview.png); }&lt;br /&gt;
 .icon-32-default 		{ background-image: url(../images/toolbar/icon-32-default.png); }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We now have to include this css in to your template so add the following line to the top of your template index.php&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;baseurl ?&amp;gt;/templates/rhuk_milkyway/css/icon.css&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(if you are using the toolbar on a component that other people will be installing it would be better to use: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mainframe-&amp;gt;addCustomHeadTag (&#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&#039;.$this-&amp;gt;baseurl.&#039;/components/com_**yourcomponent**/filename.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot; /&amp;gt;&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And finally - you will require the javascript file used in the backend to enable the buttons to work ;-)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mainframe-&amp;gt;addCustomHeadTag (&#039;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/includes/js/joomla.javascript.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And that&#039;s it. your toolbar should now render exactly as it does in the backend. This is a very simple toolbar helper. You could equally copy the JToolbarHelper class exactly in to your toolbar helper and use the functions in the same way as the backend. This would allow you to reuse your jtoolbar helper in multiple components.&lt;br /&gt;
&lt;br /&gt;
To use JToolbarHelper Class in frontend section of your component, add this code to your component&#039;s entry point ( components/com_yourcom/yourcom.php )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
require_once(JPATH_ADMINISTRATOR.DS.&#039;includes&#039;.DS.&#039;toolbar.php&#039;);&lt;br /&gt;
$doc =&amp;amp; JFactory::getDocument();&lt;br /&gt;
$doc-&amp;gt;addScript(&amp;quot;includes/js/joomla.javascript.js&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Development]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daimonie</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Basic_backend&amp;diff=70789</id>
		<title>Archived talk:Developing a MVC Component/Basic backend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Basic_backend&amp;diff=70789"/>
		<updated>2012-08-08T13:13:39Z</updated>

		<summary type="html">&lt;p&gt;Daimonie: /* How to access backend component &amp;amp; task icons not displaying */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Items to be adding/changed on this page:&lt;br /&gt;
&lt;br /&gt;
Note that if using core J! javascript in a form, id=&amp;quot;adminForm&amp;quot; must also be included.&lt;br /&gt;
&lt;br /&gt;
Shouldn&#039;t references to $db-&amp;gt;getDBO() be changed to $db-&amp;gt;getDbo() ?&lt;br /&gt;
&lt;br /&gt;
And what is this comment referring to?  &amp;quot;The _populateState method is, by default, automatically called when a state is read by the getState method.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[User:Radiant tech|Radiant tech]] 06:37, 1 September 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Admin Forms in J2.5 ==&lt;br /&gt;
&lt;br /&gt;
Aparently, for the JToolbar Icons to work properly in J2.5, the form elements need the id &amp;quot;adminForm&amp;quot; to be assigned to them. I changed this in &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039;. However, it also needs to be changed in the packages...&lt;br /&gt;
&lt;br /&gt;
== JController::display ==&lt;br /&gt;
The function declaration has been changed from &lt;br /&gt;
&lt;br /&gt;
public function display($cachable=false)&lt;br /&gt;
&lt;br /&gt;
TO&lt;br /&gt;
&lt;br /&gt;
public function display($cachable=false,$urlparams=false)&lt;br /&gt;
&lt;br /&gt;
== How to access backend component &amp;amp; task icons not displaying ==&lt;br /&gt;
&lt;br /&gt;
The tutorial is unclear on how to access the backend component.  I believe it would be helpful to explain that the component can be accessed in 2 ways:&lt;br /&gt;
&lt;br /&gt;
1) URL e.g. &lt;br /&gt;
http://localhost/joomla/administrator/index.php?option=com_helloworld&lt;br /&gt;
&lt;br /&gt;
2) The &amp;quot;hello-world&amp;quot; menu item under &amp;quot;Components&amp;quot; of the Administration application&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe it would also be helpful to note that this component only does 2 things:&lt;br /&gt;
&lt;br /&gt;
a) lists the two options stored in the database: id 1 (Hello World!) and id2 (Good bye World!)&lt;br /&gt;
&lt;br /&gt;
b) allows us to use checkboxes to select one or both options before selecting a task from the toolbar&lt;br /&gt;
&lt;br /&gt;
But this model does not give us a toolbar (i.e. the toolbar is empty without icons) so that we can not do anything with the option item(s) we select.  So I can &amp;quot;check&amp;quot; id 1 (Hello World!) and/or id2 (Good bye World!), but then cannot &amp;quot;Delete&amp;quot; them or &amp;quot;Edit&amp;quot; them since there are no task icons.  &lt;br /&gt;
&lt;br /&gt;
It was also not clear to me that the option items we create with this backend component are the options that will then be available in the &amp;quot;Required Settings&amp;quot; section when Editing a Menu Item.  i.e. when I add a Menu Item and select &amp;quot;Menu Item Type&amp;quot;: &amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot; (part 06 site component), the &amp;quot;Required Settings&amp;quot; drop-down box will contain the options that were created/edited with this backend component (well, at least that WILL be the case when we have a toolbar that gives us a &amp;quot;New&amp;quot; and &amp;quot;Delete&amp;quot; task icons which Part 09 shows us how to do)&lt;br /&gt;
SAbboushi 6/25/2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Populatestate ==&lt;br /&gt;
I&#039;m not sure on how to add to the discussion.&lt;br /&gt;
&lt;br /&gt;
The weird comment here about _populateState() seems to be the introduction to a paragraph about this method; from my understanding, what it will do is be able to select specific fields, limits, additional where clauses,etc (Say, I want this table to display things only from a specific category - that should be done with populate state, it seems).&lt;br /&gt;
&lt;br /&gt;
Taken from com_content/site/models/articles.php if you were wondering,that&#039;s what i can read there.&lt;/div&gt;</summary>
		<author><name>Daimonie</name></author>
	</entry>
</feed>