<?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=Mike+dowler</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=Mike+dowler"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Mike_dowler"/>
	<updated>2026-09-04T04:45:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Adding_view_layout_configuration_parameters&amp;diff=13278</id>
		<title>J1.5:Adding view layout configuration parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Adding_view_layout_configuration_parameters&amp;diff=13278"/>
		<updated>2009-02-22T22:42:41Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Fixed typo &amp;amp; corrected name-&amp;gt;title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
==Background==&lt;br /&gt;
When creating views for a custom component, you can create a series of .xml files that will both describe the view and allow administrators to configure the view as they require.  The .xml files are used by the com_menu core component (ilink.php) to create the menu trees that are shown when an administrator creates a new menu item.  &lt;br /&gt;
&lt;br /&gt;
==View title and description==&lt;br /&gt;
First give a title and description to your view.  This is done by including a metadata.xml file in the view directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;view title=&amp;quot;CAST_VIEW&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;&amp;lt;![CDATA[CAST_VIEW_DESC]]&amp;gt;&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/view&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;title&#039; element is shown as the 1st level entry under your component name when a new menu item is created.  The &#039;message&#039; element is the descriptive tool tip that is shown when the mouse hovers over the &#039;title&#039; element.  The example is using JText placeholders for the title and message.  Just add the corresponding tags to your language definition files.  You did create them didn&#039;t you?&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want this view to be selectable for a new menu item, then add the hidden=&amp;quot;true&amp;quot; parameter to the view element (e.g. &amp;lt;view title=&amp;quot;CAST_VIEW&amp;quot; hidden=&amp;quot;true&amp;quot;&amp;gt;).  You can also hide a view by using an underscore &#039;_&#039; in the name.  Be careful with naming your views or you can spend hours trying to figure out why it doesn&#039;t appear in the new menu item tree!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Template names, description, parameters&amp;lt;/h2&amp;gt;&lt;br /&gt;
You can also create .xml files for the individual files in the tmpl folders.  This is a cool way to have a name other than &#039;default&#039; show up in the new menu item tree.&lt;br /&gt;
Make sure that the name of the .xml file is the same as the name of your template file.  I.E. if your file name is default.php, then your xml file name is default.xml.  Its probably more productive to name your template files something other than default.  That way, when you have 10 of them open in your favorite IDE, you won&#039;t get totally confused as to which file you are editing.  That also avoids the nightmare of uploading the wrong file to the wrong directory!&lt;br /&gt;
&lt;br /&gt;
The .xml file for the template can be very simple with just a title and message or very complex with basic and/or advanced parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;STANDARD_CATEGORY_LAYOUT&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;&lt;br /&gt;
			&amp;lt;![CDATA[STANDARD_CATEGORY_LAYOUT DESC]]&amp;gt;&lt;br /&gt;
		&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;state&amp;gt;&lt;br /&gt;
		&amp;lt;name&amp;gt;STANDARD_CATEGORY_LAYOUT&amp;lt;/name&amp;gt;&lt;br /&gt;
		&amp;lt;description&amp;gt;STANDARD_CATEGORY_LAYOUT_DESC&amp;lt;/description&amp;gt;&lt;br /&gt;
		&amp;lt;url&amp;gt;&lt;br /&gt;
		&amp;lt;/url&amp;gt;&lt;br /&gt;
		&amp;lt;params&amp;gt;&lt;br /&gt;
		&amp;lt;/params&amp;gt;&lt;br /&gt;
		&amp;lt;advanced&amp;gt;&lt;br /&gt;
		&amp;lt;/advanced&amp;gt;&lt;br /&gt;
	&amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See components\com_content\views\frontpage\tmpl\default.xml, or components\com_content\views\section\tmpl\default.xml for examples of how to specify both basic and advanced parameters for your views.  See also [[Standard parameter types]] for information on defining parameters.&lt;br /&gt;
&lt;br /&gt;
You can also add the hidden=&amp;quot;true&amp;quot; to the layout element if you don&#039;t want this particular template file to be selected as a new menu item.&lt;br /&gt;
&lt;br /&gt;
==Final touches==&lt;br /&gt;
Remember to create JText language definitions for your titles and messages so they can be easily translated.  Have fun giving your views cool names and descriptions for that final bit of polish on your custom component!&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Components:xml_installfile&amp;diff=13245</id>
		<title>J1.5:Components:xml installfile</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Components:xml_installfile&amp;diff=13245"/>
		<updated>2009-02-17T21:55:49Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Added example folder tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;install type=&amp;quot;component&amp;quot; version=&amp;quot;1.5.0&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;hello_world&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;2007 01 17&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;Component Version String&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Custom Install Script to execute --&amp;gt;&lt;br /&gt;
	&amp;lt;installfile&amp;gt;install.eventlist.php&amp;lt;/installfile&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- Custom Uninstall Script to execute --&amp;gt;&lt;br /&gt;
	&amp;lt;uninstallfile&amp;gt;uninstall.eventlist.php&amp;lt;/uninstallfile&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Install Database Section --&amp;gt;&lt;br /&gt;
	&amp;lt;install&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot;&amp;gt;install.mysql.nonutf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- Uninstall Database Section --&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot;&amp;gt;uninstall.mysql.nonutf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;files&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;test.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
                &amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- Site Main Language File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;languages&amp;gt;&lt;br /&gt;
		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.com_test.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;language tag=&amp;quot;de-DE&amp;quot;&amp;gt;de-DE.com_test.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;language tag=&amp;quot;nl-NL&amp;quot;&amp;gt;nl-NL.com_test.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
	&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- Site Main Media File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_test&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;image.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;flash.swf&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;components/com_test/assets/test-16.png&amp;quot;&amp;gt;EventList&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;submenu&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Note that all &amp;amp; must be escaped to &amp;amp;amp; for the file to be valid XML and be parsed by the installer --&amp;gt;&lt;br /&gt;
			&amp;lt;menu link=&amp;quot;option=com_helloworld&amp;amp;amp;task=hello&amp;amp;amp;who=world&amp;quot;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Instead of link you can specify individual link attributes --&amp;gt;&lt;br /&gt;
			&amp;lt;menu img=&amp;quot;icon&amp;quot; task=&amp;quot;hello&amp;quot; controller=&amp;quot;z&amp;quot; view=&amp;quot;a&amp;quot; layout=&amp;quot;b&amp;quot; sub=&amp;quot;c&amp;quot;&amp;gt;Hello Again!&amp;lt;/menu&amp;gt;&lt;br /&gt;
			&amp;lt;menu view=&amp;quot;test&amp;quot; layout=&amp;quot;foo&amp;quot;&amp;gt;Testing Foo Layout&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;/submenu&amp;gt;&lt;br /&gt;
		&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;admin.test.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
		&lt;br /&gt;
		&amp;lt;!-- Administration Language File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.com_test.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;de-DE&amp;quot;&amp;gt;de-DE.com_test.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;nl-NL&amp;quot;&amp;gt;nl-NL.com_test.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
		&lt;br /&gt;
		&amp;lt;!-- Administration Main Media File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;media folder=&amp;quot;admin&amp;quot; destination=&amp;quot;com_test&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;admin-image.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;admin-flash.swf&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;/media&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[Category:Development]][[Category:Extensions]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=13244</id>
		<title>J1.5 talk:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=13244"/>
		<updated>2009-02-17T21:54:45Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Explanation for deleting text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I find the terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; confusing when applied in this context.&lt;br /&gt;
&lt;br /&gt;
also, links to the standard parameter types would be extremely useful.&lt;br /&gt;
http://docs.joomla.org/Standard_parameter_types&lt;br /&gt;
&lt;br /&gt;
Overall, I found the article extremely useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commercemeister, thanks for your comments.  Could you please explain what you find confusing about frontend and backend?  They are commonly used to refer to the main site and the administration parts of a Joomla! website, respectively.  It would be helpful to know how you think they should be clarified (or you could even just do it yourself - that&#039;s the beauty of a wiki!).  Thanks too for the note about parameter types - the article did originally link to a page with this information, but then that page was changed.  I will update it.&lt;br /&gt;
&lt;br /&gt;
One final point - please sign your comments using the four tildes at the end (&amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt;).  Thanks, [[User:Mike dowler|Mike]] 16:18, 3 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
I&#039;m confused about the differences between the types of parameters.&lt;br /&gt;
So you&#039;ve got Parameters (Basic), (Advanced), (Component) and (System).&lt;br /&gt;
&lt;br /&gt;
Now what kind of parameters would you put in (basic) and what in (component) if both can be overriden in the menu you create for the component ?&lt;br /&gt;
I just don&#039;t see the distinction between the two...&lt;br /&gt;
[[User:Alfred|Alfred]] 14:12, 25 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Alfred,  &#039;Basic&#039; and &#039;Advanced&#039; parameters are just &#039;article-specific&#039; parameters - the only difference between &#039;basic&#039; and &#039;advanced&#039; is in how they are displayed in the back end.  &#039;Article-specific&#039; parameters are those that are only ever going to apply to that article, whereas &#039;Component&#039; parameters are set for the component as a whole. As you point out, both types can be overridden for a particular menu link;  administrators using your component will thank you if such overrides are the exception rather than the rule!&lt;br /&gt;
&lt;br /&gt;
So, in the screenshot shown, there is the basic parameter &#039;Description text&#039; field which (IIRC) provides a description of the article.  It would make no sense to have this as a component parameter, since you would need to override it almost every time you use it.  Note that there is no &#039;right&#039; or &#039;wrong&#039; here, just common sense.  If a parameter is likely to be the same across the site (e.g. choosing whether or not to display the name of the author, which is likely to be fixed to maintain a consistent feel to a site), then put it in the component params.  If it&#039;s likely to change in each case, make it an article param.  If both would be useful, then use both. (Just make sure that you give the article param a &#039;Use global&#039; (i.e. empty string) option as default, so that the component parameter works as expected.) [[User:Mike dowler|Mike]] 18:23, 28 October 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Component level params must be saved before they show up ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve seen this effect in several extensions, and it was very confusing and not obvious at first. Perhaps a note can be added.  The issue is that the default params for the component, usually accessed by &amp;quot;Preferences&amp;quot; may not have been actually entered into the database.&lt;br /&gt;
&lt;br /&gt;
It would be nice to just have a note, especially in the overrides section, that you need to make sure the component params are actually saved.  It would also be nice if 3rd party components that use these config params either place a notice to the user that params must be saved, or make sure that the default params are entered into the database during the installation process, if these params do not yet exist.&lt;br /&gt;
&lt;br /&gt;
Hope this makes some sense.  I&#039;m not really sure the best solution to this problem, but more documentation about this potential pitfall I&#039;m sure would be helpful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snellcode, good point.  Tbh, I think the whole parameters subject is a little difficult to get hold of - my main reason for writing this was so that I could get everything straight in my own head.  The way it &#039;&#039;should&#039;&#039; work is that the &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt; installation file creates the parameters in the database, so that the component defaults are already set.  If this is &#039;&#039;&#039;not&#039;&#039;&#039; done, then you are right - it is necessary to open the &#039;parameters&#039; window, choose the values, and save, so that the parameters are created.  The wrong way to do things, which may be what is going on, is to try to combine both steps (ignoring the installation file) and give the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values.  These will show up in the parameters window, but do not appear in the database until they are saved.  The article does kind of refer to this, but I will think about how to make it more explicit.  &lt;br /&gt;
&lt;br /&gt;
You could try point the 3PDs to this article, or simply vote with your feet and use a different extension!   [[User:Mike dowler|Mike]] 21:36, 17 February 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Referencing the parameters XML file in the install file ==&lt;br /&gt;
I have deleted Jmgonet&#039;s paragraph about adding a reference to the install file, as I think it is outside the scope of this article (which tbh is already complicated enough!)  The article is aimed at those developing components, who should be aware of the need to ensure that all necessary files are installed (covered adequately elsewhere).  In any case, the best option is to use a &amp;lt;code&amp;gt;&amp;lt;folder /&amp;gt;&amp;lt;/code&amp;gt; tag in the install file, rather than lots of &amp;lt;code&amp;gt;&amp;lt;filename /&amp;gt;&amp;lt;/code&amp;gt; tags; that way, there is no need to list every single file, and less risk of a file being missed.  Hope that&#039;s ok!  [[User:Mike dowler|Mike]] 21:54, 17 February 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=13243</id>
		<title>J1.5:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=13243"/>
		<updated>2009-02-17T21:41:13Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Removed paragraph re file reference in install file - see talk page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! Components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A Component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; Component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the Back-end.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of Component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole Component, and are generally used to provide the &#039;default&#039; parameter settings for the Component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual Component item (e.g. an article) can also have parameters associated with it, which can affect the way the Component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the Component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same Component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the Component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that Component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each Component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the Component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding Component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the Component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - Back-end==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the Back-end of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the Back-end.  A list of the available form elements is given [[Standard_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the Component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the Component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field &lt;br /&gt;
    reading &#039;font_size=16\n&#039;: --&amp;gt;&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param type=&amp;quot;type&amp;quot; name=&amp;quot;name&amp;quot; description=&amp;quot;description&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  &lt;br /&gt;
    When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the &lt;br /&gt;
    required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; &lt;br /&gt;
    parameter value. --&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the Back-end of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the Back-end output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the Component.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your Component&#039;s Front-end - following the menu link in the Front-end will display that view.  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  In addition, you can also choose to override the Component-wide default parameters defined as above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;Front-end&#039;&#039; view output template (not to be confused with the site Template, which is different!) directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A list of parameter types can be found here: [http://help.joomla.org/content/view/28/125/]&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (at least when viewed using the default Khepri backend site Template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows the menu admin page for the Category &#039;List&#039; layout.  You can see that the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane is open, and contains form elements for five parameters.  There are no &#039;Advanced&#039; parameters for this view, and so the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane is not shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu items edit.png]]&lt;br /&gt;
&lt;br /&gt;
For the override of the Component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any &amp;lt;code&amp;gt;&amp;lt;param type=&amp;quot;radio&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt; parameter is shown not as a radio button form field, but by a drop-down list.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is set as the default option for the list.  Thus, by default, these parameters will use the Component-wide default values, rather than overriding them.  (However, note that any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value, and so will override the component-wide default value if that is different).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the Component Back-end (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the Back-end of your Component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = JPATH_COMPONENT.DS.&#039;models&#039;.DS.&#039;MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&lt;br /&gt;
$this-&amp;gt;assignRef(&#039;params&#039;, $params);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item Back-end), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In order to save the parameters to the database you have to overload the bind() function which can be found in &lt;br /&gt;
&amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/tables/COMPONENT_NAME.php&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function bind($array, $ignore = &#039;&#039;)&lt;br /&gt;
{&lt;br /&gt;
	if (key_exists( &#039;params&#039;, $array ) &amp;amp;&amp;amp; is_array( $array[&#039;params&#039;] ))&lt;br /&gt;
	{&lt;br /&gt;
		$registry = new JRegistry();&lt;br /&gt;
		$registry-&amp;gt;loadArray($array[&#039;params&#039;]);&lt;br /&gt;
		$array[&#039;params&#039;] = $registry-&amp;gt;toString();&lt;br /&gt;
	}&lt;br /&gt;
	return parent::bind($array, $ignore);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;br /&gt;
&lt;br /&gt;
The Front-end situation is a bit more complex than the Back-end.  The &#039;standard&#039; way to deal with parameters in the Front-end is to set up a cascade of overrides, as described above:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Item-specific &#039;&#039;overrides&#039;&#039; Menu-specific &#039;&#039;overrides&#039;&#039; Component-default&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want to do this, then a little extra work is required&lt;br /&gt;
&lt;br /&gt;
===With overrides===&lt;br /&gt;
&lt;br /&gt;
The following code will access the Component-wide default parameters, &#039;&#039;already overridden&#039;&#039; with those for the menu item (if applicable):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. for the com_weblinks component, you would use:&lt;br /&gt;
  // $params = &amp;amp;JComponentHelper::getParams( &#039;com_weblinks&#039; )&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an MVC structure, this code would be placed in the &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field, and that the particular item has been loaded into the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; object by the method, you would then add in the item parameters to the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;merge( &amp;amp;$row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, in both cases (i.e. overrides by menu-specific parameters, and overrides by item-specific parameters), we aren&#039;t &#039;&#039;just&#039;&#039; doing overrides - we also add in any new parameters that weren&#039;t found in the defaults.  In other words, the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object ends up with all the parameters we need!&lt;br /&gt;
&lt;br /&gt;
To access the value of a specific parameter, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. to obtain the value of &#039;parameter1&#039;, we use:&lt;br /&gt;
  // $params-&amp;gt;get( &#039;parameter1&#039; );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to realise that any &amp;lt;code&amp;gt;merge&amp;lt;/code&amp;gt; carried out is persistent, so the following code (where for example you have an array containing the parameters sets for several items, and you want the parameters for each item to individually override the defaults) would not produce the result you might expect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  foreach ($itemparamsgroup as $itemparams)&lt;br /&gt;
  {&lt;br /&gt;
    $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
    $params-&amp;gt;merge( $itemparams );&lt;br /&gt;
    echo $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such cases, you will need to use the non-override method, and then force the overrides manually, as described below.&lt;br /&gt;
&lt;br /&gt;
===Without overrides===&lt;br /&gt;
&lt;br /&gt;
There will be cases where you don&#039;t want to use the default override pattern. For example, you may want to ignore the menu-specific parameters, and have only the item-specific parameters overriding the defaults. This is a little more difficult to accomplish, although it can still be done.&lt;br /&gt;
&lt;br /&gt;
You can access the Component-wide default parameter values, &#039;&#039;without the menu overrides&#039;&#039;, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $component = JComponentHelper::getComponent( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
  $params = new JParameter( $component-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override these with the menu parameters, but &#039;&#039;without&#039;&#039; the &#039;persistence&#039; effect described above, you can:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $menuitemid = JRequest::getInt( &#039;Itemid&#039; );&lt;br /&gt;
  if ($menuitemid)&lt;br /&gt;
  {&lt;br /&gt;
    $menu = JSite::getMenu();&lt;br /&gt;
    $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
    $params-&amp;gt;merge( $menuparams );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the item parameters as before, and choose whether to merge them in using the code above, or simply store them in a separate object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $itemparams = new JParameter( $row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can combine this code to achieve the effect that you want.  For example, you could override the Component-wide defaults with the item-specific parameters, but ignore those for the menu.  Or you could use the menu-specific parameters in some circumstances, and the item-specific ones in others.  [Whenever you depart from the standard approach, though, you should be careful that you inform your users how your Component works.  Users will expect your component to work the same way as those from the Joomla! core, so you should have a good reason for departing from this approach.]&lt;br /&gt;
&lt;br /&gt;
Accessing the value of a particular parameter is done in the same way as described above.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=13242</id>
		<title>J1.5 talk:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=13242"/>
		<updated>2009-02-17T21:37:08Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I find the terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; confusing when applied in this context.&lt;br /&gt;
&lt;br /&gt;
also, links to the standard parameter types would be extremely useful.&lt;br /&gt;
http://docs.joomla.org/Standard_parameter_types&lt;br /&gt;
&lt;br /&gt;
Overall, I found the article extremely useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commercemeister, thanks for your comments.  Could you please explain what you find confusing about frontend and backend?  They are commonly used to refer to the main site and the administration parts of a Joomla! website, respectively.  It would be helpful to know how you think they should be clarified (or you could even just do it yourself - that&#039;s the beauty of a wiki!).  Thanks too for the note about parameter types - the article did originally link to a page with this information, but then that page was changed.  I will update it.&lt;br /&gt;
&lt;br /&gt;
One final point - please sign your comments using the four tildes at the end (&amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt;).  Thanks, [[User:Mike dowler|Mike]] 16:18, 3 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
I&#039;m confused about the differences between the types of parameters.&lt;br /&gt;
So you&#039;ve got Parameters (Basic), (Advanced), (Component) and (System).&lt;br /&gt;
&lt;br /&gt;
Now what kind of parameters would you put in (basic) and what in (component) if both can be overriden in the menu you create for the component ?&lt;br /&gt;
I just don&#039;t see the distinction between the two...&lt;br /&gt;
[[User:Alfred|Alfred]] 14:12, 25 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Alfred,  &#039;Basic&#039; and &#039;Advanced&#039; parameters are just &#039;article-specific&#039; parameters - the only difference between &#039;basic&#039; and &#039;advanced&#039; is in how they are displayed in the back end.  &#039;Article-specific&#039; parameters are those that are only ever going to apply to that article, whereas &#039;Component&#039; parameters are set for the component as a whole. As you point out, both types can be overridden for a particular menu link;  administrators using your component will thank you if such overrides are the exception rather than the rule!&lt;br /&gt;
&lt;br /&gt;
So, in the screenshot shown, there is the basic parameter &#039;Description text&#039; field which (IIRC) provides a description of the article.  It would make no sense to have this as a component parameter, since you would need to override it almost every time you use it.  Note that there is no &#039;right&#039; or &#039;wrong&#039; here, just common sense.  If a parameter is likely to be the same across the site (e.g. choosing whether or not to display the name of the author, which is likely to be fixed to maintain a consistent feel to a site), then put it in the component params.  If it&#039;s likely to change in each case, make it an article param.  If both would be useful, then use both. (Just make sure that you give the article param a &#039;Use global&#039; (i.e. empty string) option as default, so that the component parameter works as expected.) [[User:Mike dowler|Mike]] 18:23, 28 October 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Component level params must be saved before they show up ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve seen this effect in several extensions, and it was very confusing and not obvious at first. Perhaps a note can be added.  The issue is that the default params for the component, usually accessed by &amp;quot;Preferences&amp;quot; may not have been actually entered into the database.&lt;br /&gt;
&lt;br /&gt;
It would be nice to just have a note, especially in the overrides section, that you need to make sure the component params are actually saved.  It would also be nice if 3rd party components that use these config params either place a notice to the user that params must be saved, or make sure that the default params are entered into the database during the installation process, if these params do not yet exist.&lt;br /&gt;
&lt;br /&gt;
Hope this makes some sense.  I&#039;m not really sure the best solution to this problem, but more documentation about this potential pitfall I&#039;m sure would be helpful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snellcode, good point.  Tbh, I think the whole parameters subject is a little difficult to get hold of - my main reason for writing this was so that I could get everything straight in my own head.  The way it &#039;&#039;should&#039;&#039; work is that the &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt; installation file creates the parameters in the database, so that the component defaults are already set.  If this is &#039;&#039;&#039;not&#039;&#039;&#039; done, then you are right - it is necessary to open the &#039;parameters&#039; window, choose the values, and save, so that the parameters are created.  The wrong way to do things, which may be what is going on, is to try to combine both steps (ignoring the installation file) and give the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values.  These will show up in the parameters window, but do not appear in the database until they are saved.  The article does kind of refer to this, but I will think about how to make it more explicit.  &lt;br /&gt;
&lt;br /&gt;
You could try point the 3PDs to this article, or simply vote with your feet and use a different extension!   [[User:Mike dowler|Mike]] 21:36, 17 February 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=13241</id>
		<title>J1.5 talk:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=13241"/>
		<updated>2009-02-17T21:36:21Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Responded to Snellcode&amp;#039;s comments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I find the terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; confusing when applied in this context.&lt;br /&gt;
&lt;br /&gt;
also, links to the standard parameter types would be extremely useful.&lt;br /&gt;
http://docs.joomla.org/Standard_parameter_types&lt;br /&gt;
&lt;br /&gt;
Overall, I found the article extremely useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commercemeister, thanks for your comments.  Could you please explain what you find confusing about frontend and backend?  They are commonly used to refer to the main site and the administration parts of a Joomla! website, respectively.  It would be helpful to know how you think they should be clarified (or you could even just do it yourself - that&#039;s the beauty of a wiki!).  Thanks too for the note about parameter types - the article did originally link to a page with this information, but then that page was changed.  I will update it.&lt;br /&gt;
&lt;br /&gt;
One final point - please sign your comments using the four tildes at the end (&amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt;).  Thanks, [[User:Mike dowler|Mike]] 16:18, 3 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
I&#039;m confused about the differences between the types of parameters.&lt;br /&gt;
So you&#039;ve got Parameters (Basic), (Advanced), (Component) and (System).&lt;br /&gt;
&lt;br /&gt;
Now what kind of parameters would you put in (basic) and what in (component) if both can be overriden in the menu you create for the component ?&lt;br /&gt;
I just don&#039;t see the distinction between the two...&lt;br /&gt;
[[User:Alfred|Alfred]] 14:12, 25 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Alfred,  &#039;Basic&#039; and &#039;Advanced&#039; parameters are just &#039;article-specific&#039; parameters - the only difference between &#039;basic&#039; and &#039;advanced&#039; is in how they are displayed in the back end.  &#039;Article-specific&#039; parameters are those that are only ever going to apply to that article, whereas &#039;Component&#039; parameters are set for the component as a whole. As you point out, both types can be overridden for a particular menu link;  administrators using your component will thank you if such overrides are the exception rather than the rule!&lt;br /&gt;
&lt;br /&gt;
So, in the screenshot shown, there is the basic parameter &#039;Description text&#039; field which (IIRC) provides a description of the article.  It would make no sense to have this as a component parameter, since you would need to override it almost every time you use it.  Note that there is no &#039;right&#039; or &#039;wrong&#039; here, just common sense.  If a parameter is likely to be the same across the site (e.g. choosing whether or not to display the name of the author, which is likely to be fixed to maintain a consistent feel to a site), then put it in the component params.  If it&#039;s likely to change in each case, make it an article param.  If both would be useful, then use both. (Just make sure that you give the article param a &#039;Use global&#039; (i.e. empty string) option as default, so that the component parameter works as expected.) [[User:Mike dowler|Mike]] 18:23, 28 October 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Component level params must be saved before they show up ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve seen this effect in several extensions, and it was very confusing and not obvious at first. Perhaps a note can be added.  The issue is that the default params for the component, usually accessed by &amp;quot;Preferences&amp;quot; may not have been actually entered into the database.&lt;br /&gt;
&lt;br /&gt;
It would be nice to just have a note, especially in the overrides section, that you need to make sure the component params are actually saved.  It would also be nice if 3rd party components that use these config params either place a notice to the user that params must be saved, or make sure that the default params are entered into the database during the installation process, if these params do not yet exist.&lt;br /&gt;
&lt;br /&gt;
Hope this makes some sense.  I&#039;m not really sure the best solution to this problem, but more documentation about this potential pitfall I&#039;m sure would be helpful.&lt;br /&gt;
&lt;br /&gt;
Snellcode, good point.  Tbh, I think the whole parameters subject is a little difficult to get hold of - my main reason for writing this was so that I could get everything straight in my own head.  The way it &#039;&#039;should&#039;&#039; work is that the &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt; installation file creates the parameters in the database, so that the component defaults are already set.  If this is &#039;&#039;&#039;not&#039;&#039;&#039; done, then you are right - it is necessary to open the &#039;parameters&#039; window, choose the values, and save, so that the parameters are created.  The wrong way to do things, which may be what is going on, is to try to combine both steps (ignoring the installation file) and give the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values.  These will show up in the parameters window, but do not appear in the database until they are saved.  The article does kind of refer to this, but I will think about how to make it more explicit.  &lt;br /&gt;
&lt;br /&gt;
You could try point the 3PDs to this article, or simply vote with your feet and use a different extension!   [[User:Mike dowler|Mike]] 21:36, 17 February 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x_talk:Adding_JavaScript_and_CSS_to_the_page&amp;diff=13240</id>
		<title>J3.x talk:Adding JavaScript and CSS to the page</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x_talk:Adding_JavaScript_and_CSS_to_the_page&amp;diff=13240"/>
		<updated>2009-02-17T21:24:20Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello there.. I was about to pitch in and add on a whole other section on basically doing the exact same thing you did with $document.. except using the JHTML class.  I wasn&#039;t exactly sure why you&#039;d use one over the other and thought I&#039;d ask if you knew why this redunacy exists and if one is in some way more helpful.  Any ideas?  &lt;br /&gt;
[[User:Haelix|Haelix]] 23:45, 8 November 2008 (EST)&lt;br /&gt;
&lt;br /&gt;
Haelix, I agree.  It appears that the JHTML classes wrap the $document methods, and take care of anything else you might need (like mootools).  I have updated the article to reflect this.[[User:Mike dowler|Mike]] 21:24, 17 February 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Adding_JavaScript_and_CSS_to_the_page&amp;diff=13239</id>
		<title>J3.x:Adding JavaScript and CSS to the page</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Adding_JavaScript_and_CSS_to_the_page&amp;diff=13239"/>
		<updated>2009-02-17T21:22:26Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
&lt;br /&gt;
To have a well-formed XHTML document, you must put all references to Javascript and CSS files within the &amp;lt;code&amp;gt;&amp;lt;head&amp;gt;&amp;lt;/code&amp;gt; portion. Since Joomla! generates all of the HTML that makes up a page before output, it is possible to add these references to the &amp;lt;head&amp;gt; tag from your extension. The simplest way to do this is to make use of the functionality built in to Joomla!:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Add a reference to a javascript file&lt;br /&gt;
// The default path is &#039;media/system/js/&#039;&lt;br /&gt;
JHTML::script($filename, $path, $mootools);&lt;br /&gt;
&lt;br /&gt;
// Add a reference to a CSS file&lt;br /&gt;
// The default path is &#039;media/system/css/&#039;&lt;br /&gt;
JHTML::stylesheet($filename, $path);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using these functions, Joomla! will take care of any additional requirements.  For example, if your javascript requires Mootools, setting &amp;lt;code&amp;gt;$mootools = true&amp;lt;/code&amp;gt; will automatically ensure that Mootools is loaded, if it has not already been done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, the above functions will not be flexible enough for every scenario, and so it is possible to tap into the underlying functionality instead.  (Of course, this means that you will also need to manually code some of the steps that would be done automatically using the functions above!)&lt;br /&gt;
&lt;br /&gt;
Firstly, you will need to get a reference to the current document object:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document =&amp;amp; JFactory::getDocument();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a javascript file, use this code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document-&amp;gt;addScript($url);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that this will &#039;&#039;&#039;not&#039;&#039;&#039; automatically include Mootools.  If your script requires Mootools, you should also include the line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JHTML::_(behavior.mootools);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a stylesheet, use this code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document-&amp;gt;addStyleSheet($url);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, your javascript or CSS might not be located in a separate file - you might want to generate them using PHP.  In this case you can write the script/stylesheet directly into the head of your document:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Add javascript&lt;br /&gt;
$document-&amp;gt;addScriptDeclaration($javascript, $type);&lt;br /&gt;
&lt;br /&gt;
// Add styles&lt;br /&gt;
$document-&amp;gt;addStyleDeclaration($styles, $type);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, the following code is used to define a custom tool tip that takes advantage of mootools.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function getToolTipJS($toolTipVarName, $toolTipClassName){&lt;br /&gt;
    $javascript = &#039;window.addEvent(\&amp;quot;domready\&amp;quot;, function(){&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t&amp;quot;  .&#039;var $toolTipVarName = new Tips($$(&amp;quot;&#039; . $toolTipVarName .&#039;&amp;quot;), {&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;className: &amp;quot;&#039; .$toolTipClassName .&#039;&amp;quot;,&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;initialize: function(){&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t\t&amp;quot;    .&#039;this.fx = new Fx.Style(this.toolTip, &amp;quot;opacity&amp;quot;, {duration: 500, wait: false}).set(0);&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;},&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;onShow: function(toolTip){&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t\t&amp;quot;    .&#039;this.fx.start(1);&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;},&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;onHide: function(toolTip) {&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t\t&amp;quot;    .&#039;this.fx.start(0);&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;}&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t&amp;quot;  .&#039;});&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &#039;});&#039; .&amp;quot;\n\n&amp;quot;;&lt;br /&gt;
    return $javascript;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$document =&amp;amp; JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addStyleSheet(&amp;quot;/joomla/components/com_mycustomcomponent/css/mytooltip.css&amp;quot;,&#039;text/css&#039;,&amp;quot;screen&amp;quot;);&lt;br /&gt;
$document-&amp;gt;addScriptDeclaration(getToolTipJS(&amp;quot;mytool&amp;quot;,&amp;quot;MyToolTip&amp;quot;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(Note that, in order for this javascript to be functionally useful, it would be necessary to include the appropriate class name in the HTML, as well as providing the &amp;lt;code&amp;gt;mytooltip.css&amp;lt;/code&amp;gt; file.  Both are outside the scope of this article.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There will be some occasions where even these functions are not flexible enough, as they are limited to writing the contents of &amp;lt;code&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;style /&amp;gt;&amp;lt;/code&amp;gt; tags, and cannot add anything outside those tags.  One example would be the inclusion of a stylesheet link within conditional comments, so that it is picked up only by Internet Explorer 6 and earlier.  To do this, we can use &amp;lt;code&amp;gt;$document-&amp;gt;addCustomTag&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$stylelink = &#039;&amp;lt;!--[if lte IE 6]&amp;gt;&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
$stylelink .= &#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;../css/IEonly.css&amp;quot; /&amp;gt;&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
$stylelink .= &#039;&amp;lt;![endif]--&amp;gt;&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
$document =&amp;amp; JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addCustomTag($stylelink);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Adding_JavaScript_and_CSS_to_the_page&amp;diff=13238</id>
		<title>J3.x:Adding JavaScript and CSS to the page</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Adding_JavaScript_and_CSS_to_the_page&amp;diff=13238"/>
		<updated>2009-02-17T21:20:31Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Added addScriptDeclaration, addStyleDeclaration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
&lt;br /&gt;
To have a well-formed XHTML document, you must put all references to Javascript and CSS files within the &amp;lt;head&amp;gt; portion. Since Joomla! generates all of the HTML that makes up a page before output, it is possible to add these references to the &amp;lt;head&amp;gt; tag from your extension. The simplest way to do this is to make use of the functionality built in to Joomla!:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Add a reference to a javascript file&lt;br /&gt;
// The default path is &#039;media/system/js/&#039;&lt;br /&gt;
JHTML::script($filename, $path, $mootools);&lt;br /&gt;
&lt;br /&gt;
// Add a reference to a CSS file&lt;br /&gt;
// The default path is &#039;media/system/css/&#039;&lt;br /&gt;
JHTML::stylesheet($filename, $path);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using these functions, Joomla! will take care of any additional requirements.  For example, if your javascript requires Mootools, setting &amp;lt;code&amp;gt;$mootools = true&amp;lt;/code&amp;gt; will automatically ensure that Mootools is loaded, if it has not already been done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, the above functions will not be flexible enough for every scenario, and so it is possible to tap into the underlying functionality instead.  (Of course, this means that you will also need to manually code some of the steps that would be done automatically using the functions above!)&lt;br /&gt;
&lt;br /&gt;
Firstly, you will need to get a reference to the current document object:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document =&amp;amp; JFactory::getDocument();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a javascript file, use this code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document-&amp;gt;addScript($url);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that this will &#039;&#039;&#039;not&#039;&#039;&#039; automatically include Mootools.  If your script requires Mootools, you should also include the line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JHTML::_(behavior.mootools);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a stylesheet, use this code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document-&amp;gt;addStyleSheet($url);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, your javascript or CSS might not be located in a separate file - you might want to generate them using PHP.  In this case you can write the script/stylesheet directly into the head of your document:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Add javascript&lt;br /&gt;
$document-&amp;gt;addScriptDeclaration($javascript, $type);&lt;br /&gt;
&lt;br /&gt;
// Add styles&lt;br /&gt;
$document-&amp;gt;addStyleDeclaration($styles, $type)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, the following code is used to define a custom tool tip that takes advantage of mootools.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function getToolTipJS($toolTipVarName, $toolTipClassName){&lt;br /&gt;
    $javascript = &#039;window.addEvent(\&amp;quot;domready\&amp;quot;, function(){&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t&amp;quot;  .&#039;var $toolTipVarName = new Tips($$(&amp;quot;&#039; . $toolTipVarName .&#039;&amp;quot;), {&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;className: &amp;quot;&#039; .$toolTipClassName .&#039;&amp;quot;,&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;initialize: function(){&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t\t&amp;quot;    .&#039;this.fx = new Fx.Style(this.toolTip, &amp;quot;opacity&amp;quot;, {duration: 500, wait: false}).set(0);&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;},&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;onShow: function(toolTip){&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t\t&amp;quot;    .&#039;this.fx.start(1);&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;},&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;onHide: function(toolTip) {&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t\t&amp;quot;    .&#039;this.fx.start(0);&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;}&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t&amp;quot;  .&#039;});&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &#039;});&#039; .&amp;quot;\n\n&amp;quot;;&lt;br /&gt;
    return $javascript;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$document =&amp;amp; JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addStyleSheet(&amp;quot;/joomla/components/com_mycustomcomponent/css/mytooltip.css&amp;quot;,&#039;text/css&#039;,&amp;quot;screen&amp;quot;);&lt;br /&gt;
$document-&amp;gt;addScriptDeclaration(getToolTipJS(&amp;quot;mytool&amp;quot;,&amp;quot;MyToolTip&amp;quot;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(Note that, in order for this javascript to be functionally useful, it would be necessary to include the appropriate class name in the HTML, as well as providing the &amp;lt;code&amp;gt;mytooltip.css&amp;lt;/code&amp;gt; file.  Both are outside the scope of this article.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There will be some occasions where even these functions are not flexible enough, as they are limited to writing the contents of &amp;lt;code&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;style /&amp;gt;&amp;lt;/code&amp;gt; tags, and cannot add anything outside those tags.  One example would be the inclusion of a stylesheet link within conditional comments, so that it is picked up only by Internet Explorer 6 and earlier.  To do this, we can use &amp;lt;code&amp;gt;$document-&amp;gt;addCustomTag&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$stylelink = &#039;&amp;lt;!--[if lte IE 6]&amp;gt;&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
$stylelink .= &#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;../css/IEonly.css&amp;quot; /&amp;gt;&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
$stylelink .= &#039;&amp;lt;![endif]--&amp;gt;&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
$document =&amp;amp; JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addCustomTag($stylelink);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Module_chrome&amp;diff=12382</id>
		<title>Module chrome</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Module_chrome&amp;diff=12382"/>
		<updated>2009-01-02T00:16:25Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;==What is Module chrome?==&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Module chrome allows template designers to have a certain amount of control over the way the output from a Module is displayed in their template.  Essentially, it consists of a small amount of predefined HTML which is inserted before, after, or around the output from each module, and which can then be styled using CSS.  Module chrome is commonly used to provide borders around modules, especially with rounded corners, but it can be used for much more than that.&lt;br /&gt;
&lt;br /&gt;
Module chrome is determined by using the &#039;&amp;lt;tt&amp;gt;style&amp;lt;/tt&amp;gt;&#039; attribute in the statement calling the module.  For example, the following statement may be used in the &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; file of a template to insert the Modules in the &#039;&amp;lt;tt&amp;gt;user1&amp;lt;/tt&amp;gt;&#039; position and apply the &#039;&amp;lt;tt&amp;gt;custom&amp;lt;/tt&amp;gt;&#039; Module chrome:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;custom&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It can be seen that the same Module chrome is applied to every Module in that position - in other words, if you want to have two Modules in a column, but want them to have different Module chrome, then they would need to be set up as two different &#039;positions&#039; (e.g. &#039;&amp;lt;tt&amp;gt;user1&amp;lt;/tt&amp;gt;&#039; and &#039;&amp;lt;tt&amp;gt;user2&amp;lt;/tt&amp;gt;&#039;).&lt;br /&gt;
&lt;br /&gt;
The standard Joomla! 1.5 package includes six default Module chrome styles.  However, the flexibility of the template system means that you are not limited to these styles - it&#039;s very easy to create as many new styles as you want!&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Comparison of the Joomla! 1.5 standard Module chromes&#039;&#039;&#039;&lt;br /&gt;
!Style&lt;br /&gt;
!Output&lt;br /&gt;
!width=&amp;quot;204&amp;quot; | Appearance&lt;br /&gt;
|-&lt;br /&gt;
!rounded&amp;lt;br /&amp;gt;(default for menus on milkyway)&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;module_menu&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
      &amp;lt;div&amp;gt;&lt;br /&gt;
        &amp;lt;h3&amp;gt;Main Menu&amp;lt;/h3&amp;gt;&lt;br /&gt;
        &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;/ul&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_rounded.png]]&lt;br /&gt;
|-&lt;br /&gt;
!none&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_none.png]]&lt;br /&gt;
|-&lt;br /&gt;
!table&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;moduletable_menu&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th valign=&amp;quot;top&amp;quot;&amp;gt;Main Menu&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_table.png]]&lt;br /&gt;
|-&lt;br /&gt;
!horz&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;1&amp;quot; cellpadding=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;table cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;moduletable_menu&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;th valign=&amp;quot;top&amp;quot;&amp;gt;Main Menu&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;/ul&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;/table&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_horz.png]]&lt;br /&gt;
|-&lt;br /&gt;
!xhtml&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;moduletable_menu&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Main Menu&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_xhtml.png]]&lt;br /&gt;
|-&lt;br /&gt;
!outline&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mod-preview&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;mod-preview-info&amp;quot;&amp;gt;left[outline]&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;mod-preview-wrapper&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_outline.png]]&lt;br /&gt;
|}&lt;br /&gt;
Note that the Module chrome doesn&#039;t necessarily change the appearance all that much - this depends on the CSS used in the template. For example, the &#039;&amp;lt;tt&amp;gt;none&amp;lt;/tt&amp;gt;&#039; and &#039;&amp;lt;tt&amp;gt;horz&amp;lt;/tt&amp;gt;&#039; chromes look very similar, although the underlying HTML code is very different.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Advanced|Chrome]]&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:Topics]]&lt;br /&gt;
[[Category:Template FAQ]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Creating_rounded_corners&amp;diff=12064</id>
		<title>Talk:Creating rounded corners</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Creating_rounded_corners&amp;diff=12064"/>
		<updated>2008-12-07T14:46:15Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Where have my images gone?? --[[User:Mike dowler|Mike]] 15:43, 14 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
We&#039;re currently having problems with some images following an upgrade to the latest PHP, MySQL and Apache versions.  The images are still there but MediaWiki is having trouble getting access to them.  Please bear with us while we try to figure out where the problem is. [[User:Chris Davenport|Chris Davenport]] 17:37, 14 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Hello. Thanks for this tutorial, I just tried to create rounded corners with it. First I must tell you that I didn&#039;t test it inside Joomla, but with a simple html and css code copied from your tutorial. I noticed two little problems.&lt;br /&gt;
The first one is transparency with corner images. Image 2 covers image 1, but as image 1 is higher and because of image 2 transparency, image 1 remains visible under image 2. Same problem with images 2 &amp;amp; 3,  images 3 &amp;amp; 4. The result is really a mess ! So my solution was to add with Inkscape a 800x600 white filled rectangle in the background.&lt;br /&gt;
The second problem is with div content. Module title and content sticked up from rounded area. So I had to add a &amp;lt;nowiki&amp;gt;&amp;lt;div&amp;gt;&amp;lt;/nowiki&amp;gt; around title and content (starting before &amp;lt;nowiki&amp;gt;&amp;lt;h3&amp;gt;&amp;lt;/nowiki&amp;gt; and ending after &amp;lt;nowiki&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/nowiki&amp;gt;), and add a padding rule to the last style. My last css style is as follow :&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
div.module_menu div div div div{&lt;br /&gt;
  background: none;&lt;br /&gt;
  padding: 3px 15px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know if these changes are required inside Joomla. I think I will try soon. But it could be useful to report my changes for people who want to use this method outside of Joomla. I don&#039;t know if I can edit the article for that. Can you tell me if it is a good idea ?&lt;br /&gt;
&lt;br /&gt;
--[[User:Ptigrouick|Ptigrouick]] 22:17, 23 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Hi Ptgrouick! Yep, you are absoultely right on the transparency issue.  You don&#039;t need to create a separate rectangle though - you can tell Inkscape to set a background colour when exporting to PNG.  I will update the tutorial to reflect this.  I&#039;ll look into your second issue and see if the page needs updating (or you are welcome to update it yourself!) --[[User:Mike dowler|Mike]] 18:34, 29 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Can someone post the x0/y0 and x1/y1 coordinates that would be used to create all 4 images (assuming we are using the 800x600 format as noted in the tutorial)? Thanks in advance. ----[[User:Rostom|Rostom]] 19:51, 13 November 2008 (EST)&lt;br /&gt;
&lt;br /&gt;
@Rostom: You can use the following coordinates:&lt;br /&gt;
:Top left: x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=0, x&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=785, y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=15, y&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=600&lt;br /&gt;
:Top right: x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=785, x&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=800 y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=15 y&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=600&lt;br /&gt;
:Bottom left: x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=0, x&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=785, y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=0, y&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=15&lt;br /&gt;
:Bottom right: x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=785, x&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=800, y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=0, y&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=15&lt;br /&gt;
The value &#039;15&#039; comes from the distance between the edge of the image and the end of the curve at the rounded corner.  The other (non-zero) values are the difference between 15 and the dimensions of the image.&lt;br /&gt;
[[User:Mike dowler|Mike]] 14:36, 15 November 2008 (EST)&lt;br /&gt;
&lt;br /&gt;
Still having trouble getting this to work....&lt;br /&gt;
&lt;br /&gt;
1. Can you please elaborate on the x/y coordinates. It takes an X and a Y coordinate to represent one single point. So I would imagine that you need four total points to designate where to cut from. But obviously this is not the case. How do you come up with just two points to tell Inkscape how to crop the image?&lt;br /&gt;
&lt;br /&gt;
2. Using your coordinates, I was able to make four images (not sure if they are right; it would help if you had attached sample GIF/PNG images of what they are supposed to look like in the article). But this doesn&#039;t work as the box comes out very awkward looking--especially if I resize the window. I am using the exact same CSS as you have provided.  I imagine I need to constrain the width and height on some of the Div tags maybe?&lt;br /&gt;
&lt;br /&gt;
Thanks in advance. --[[User:Rostom|Rostom]] 18:22, 3 December 2008 (EST)&lt;br /&gt;
&lt;br /&gt;
@Rostom,&lt;br /&gt;
&lt;br /&gt;
1.  Inkscape can only export a rectangular section of the image, so you only need to specify the minimum and maximum x and y values.  x0,y0 and x1,y1 define opposite corners of the rectangle.&lt;br /&gt;
&lt;br /&gt;
2. I have placed PNGS of the sample images in the article.  Note that the rounded corners will break if they are used for divs that are bigger than the size of your original image - as stated in the article, you need to make sure this original image is large enough to cater for your needs.&lt;br /&gt;
&lt;br /&gt;
Also, the CSS indicated relates only to the rounded corners - you may need some other CSS depending on your content.  I will try to have a play later and see.&lt;br /&gt;
&lt;br /&gt;
[[User:Mike dowler|Mike]] 09:46, 7 December 2008 (EST)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Creating_rounded_corners&amp;diff=11745</id>
		<title>Talk:Creating rounded corners</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Creating_rounded_corners&amp;diff=11745"/>
		<updated>2008-11-15T19:36:16Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Where have my images gone?? --[[User:Mike dowler|Mike]] 15:43, 14 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
We&#039;re currently having problems with some images following an upgrade to the latest PHP, MySQL and Apache versions.  The images are still there but MediaWiki is having trouble getting access to them.  Please bear with us while we try to figure out where the problem is. [[User:Chris Davenport|Chris Davenport]] 17:37, 14 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Hello. Thanks for this tutorial, I just tried to create rounded corners with it. First I must tell you that I didn&#039;t test it inside Joomla, but with a simple html and css code copied from your tutorial. I noticed two little problems.&lt;br /&gt;
The first one is transparency with corner images. Image 2 covers image 1, but as image 1 is higher and because of image 2 transparency, image 1 remains visible under image 2. Same problem with images 2 &amp;amp; 3,  images 3 &amp;amp; 4. The result is really a mess ! So my solution was to add with Inkscape a 800x600 white filled rectangle in the background.&lt;br /&gt;
The second problem is with div content. Module title and content sticked up from rounded area. So I had to add a &amp;lt;nowiki&amp;gt;&amp;lt;div&amp;gt;&amp;lt;/nowiki&amp;gt; around title and content (starting before &amp;lt;nowiki&amp;gt;&amp;lt;h3&amp;gt;&amp;lt;/nowiki&amp;gt; and ending after &amp;lt;nowiki&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/nowiki&amp;gt;), and add a padding rule to the last style. My last css style is as follow :&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
div.module_menu div div div div{&lt;br /&gt;
  background: none;&lt;br /&gt;
  padding: 3px 15px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know if these changes are required inside Joomla. I think I will try soon. But it could be useful to report my changes for people who want to use this method outside of Joomla. I don&#039;t know if I can edit the article for that. Can you tell me if it is a good idea ?&lt;br /&gt;
&lt;br /&gt;
--[[User:Ptigrouick|Ptigrouick]] 22:17, 23 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Hi Ptgrouick! Yep, you are absoultely right on the transparency issue.  You don&#039;t need to create a separate rectangle though - you can tell Inkscape to set a background colour when exporting to PNG.  I will update the tutorial to reflect this.  I&#039;ll look into your second issue and see if the page needs updating (or you are welcome to update it yourself!) --[[User:Mike dowler|Mike]] 18:34, 29 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Can someone post the x0/y0 and x1/y1 coordinates that would be used to create all 4 images (assuming we are using the 800x600 format as noted in the tutorial)? Thanks in advance. ----[[User:Rostom|Rostom]] 19:51, 13 November 2008 (EST)&lt;br /&gt;
&lt;br /&gt;
@Rostom: You can use the following coordinates:&lt;br /&gt;
:Top left: x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=0, x&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=785, y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=15, y&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=600&lt;br /&gt;
:Top right: x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=785, x&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=800 y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=15 y&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=600&lt;br /&gt;
:Bottom left: x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=0, x&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=785, y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=0, y&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=15&lt;br /&gt;
:Bottom right: x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=785, x&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=800, y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;=0, y&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;=15&lt;br /&gt;
The value &#039;15&#039; comes from the distance between the edge of the image and the end of the curve at the rounded corner.  The other (non-zero) values are the difference between 15 and the dimensions of the image.&lt;br /&gt;
[[User:Mike dowler|Mike]] 14:36, 15 November 2008 (EST)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=11407</id>
		<title>J1.5 talk:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=11407"/>
		<updated>2008-10-28T22:23:25Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I find the terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; confusing when applied in this context.&lt;br /&gt;
&lt;br /&gt;
also, links to the standard parameter types would be extremely useful.&lt;br /&gt;
http://docs.joomla.org/Standard_parameter_types&lt;br /&gt;
&lt;br /&gt;
Overall, I found the article extremely useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commercemeister, thanks for your comments.  Could you please explain what you find confusing about frontend and backend?  They are commonly used to refer to the main site and the administration parts of a Joomla! website, respectively.  It would be helpful to know how you think they should be clarified (or you could even just do it yourself - that&#039;s the beauty of a wiki!).  Thanks too for the note about parameter types - the article did originally link to a page with this information, but then that page was changed.  I will update it.&lt;br /&gt;
&lt;br /&gt;
One final point - please sign your comments using the four tildes at the end (&amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt;).  Thanks, [[User:Mike dowler|Mike]] 16:18, 3 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
I&#039;m confused about the differences between the types of parameters.&lt;br /&gt;
So you&#039;ve got Parameters (Basic), (Advanced), (Component) and (System).&lt;br /&gt;
&lt;br /&gt;
Now what kind of parameters would you put in (basic) and what in (component) if both can be overriden in the menu you create for the component ?&lt;br /&gt;
I just don&#039;t see the distinction between the two...&lt;br /&gt;
[[User:Alfred|Alfred]] 14:12, 25 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Alfred,  &#039;Basic&#039; and &#039;Advanced&#039; parameters are just &#039;article-specific&#039; parameters - the only difference between &#039;basic&#039; and &#039;advanced&#039; is in how they are displayed in the back end.  &#039;Article-specific&#039; parameters are those that are only ever going to apply to that article, whereas &#039;Component&#039; parameters are set for the component as a whole. As you point out, both types can be overridden for a particular menu link;  administrators using your component will thank you if such overrides are the exception rather than the rule!&lt;br /&gt;
&lt;br /&gt;
So, in the screenshot shown, there is the basic parameter &#039;Description text&#039; field which (IIRC) provides a description of the article.  It would make no sense to have this as a component parameter, since you would need to override it almost every time you use it.  Note that there is no &#039;right&#039; or &#039;wrong&#039; here, just common sense.  If a parameter is likely to be the same across the site (e.g. choosing whether or not to display the name of the author, which is likely to be fixed to maintain a consistent feel to a site), then put it in the component params.  If it&#039;s likely to change in each case, make it an article param.  If both would be useful, then use both. (Just make sure that you give the article param a &#039;Use global&#039; (i.e. empty string) option as default, so that the component parameter works as expected.) [[User:Mike dowler|Mike]] 18:23, 28 October 2008 (EDT)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=10487</id>
		<title>J1.5:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=10487"/>
		<updated>2008-09-03T20:33:40Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Changed capitalisation in line with policy doc (I hope!)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! Components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A Component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; Component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the Back-end.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of Component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole Component, and are generally used to provide the &#039;default&#039; parameter settings for the Component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual Component item (e.g. an article) can also have parameters associated with it, which can affect the way the Component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the Component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same Component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the Component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that Component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each Component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the Component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding Component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the Component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - Back-end==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the Back-end of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the Back-end.  A list of the available form elements is given [[Standard_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the Component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the Component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field &lt;br /&gt;
    reading &#039;font_size=16\n&#039;: --&amp;gt;&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param type=&amp;quot;type&amp;quot; name=&amp;quot;name&amp;quot; description=&amp;quot;description&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  &lt;br /&gt;
    When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the &lt;br /&gt;
    required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; &lt;br /&gt;
    parameter value. --&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the Back-end of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the Back-end output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the Component.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your Component&#039;s Front-end - following the menu link in the Front-end will display that view.  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  In addition, you can also choose to override the Component-wide default parameters defined as above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;Front-end&#039;&#039; view output template (not to be confused with the site Template, which is different!) directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (at least when viewed using the default Khepri backend site Template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows the menu admin page for the Category &#039;List&#039; layout.  You can see that the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane is open, and contains form elements for five parameters.  There are no &#039;Advanced&#039; parameters for this view, and so the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane is not shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu items edit.png]]&lt;br /&gt;
&lt;br /&gt;
For the override of the Component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any &amp;lt;code&amp;gt;&amp;lt;param type=&amp;quot;radio&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt; parameter is shown not as a radio button form field, but by a drop-down list.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is set as the default option for the list.  Thus, by default, these parameters will use the Component-wide default values, rather than overriding them.  (However, note that any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value, and so will override the component-wide default value if that is different).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the Component Back-end (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the Back-end of your Component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item Back-end), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;br /&gt;
&lt;br /&gt;
The Front-end situation is a bit more complex than the Back-end.  The &#039;standard&#039; way to deal with parameters in the Front-end is to set up a cascade of overrides, as described above:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Item-specific &#039;&#039;overrides&#039;&#039; Menu-specific &#039;&#039;overrides&#039;&#039; Component-default&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want to do this, then a little extra work is required&lt;br /&gt;
&lt;br /&gt;
===With overrides===&lt;br /&gt;
&lt;br /&gt;
The following code will access the Component-wide default parameters, &#039;&#039;already overridden&#039;&#039; with those for the menu item (if applicable):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. for the com_weblinks component, you would use:&lt;br /&gt;
  // $params = &amp;amp;JComponentHelper::getParams( &#039;com_weblinks&#039; )&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an MVC structure, this code would be placed in the &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field, and that the particular item has been loaded into the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; object by the method, you would then add in the item parameters to the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;merge( &amp;amp;$row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, in both cases (i.e. overrides by menu-specific parameters, and overrides by item-specific parameters), we aren&#039;t &#039;&#039;just&#039;&#039; doing overrides - we also add in any new parameters that weren&#039;t found in the defaults.  In other words, the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object ends up with all the parameters we need!&lt;br /&gt;
&lt;br /&gt;
To access the value of a specific parameter, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. to obtain the value of &#039;parameter1&#039;, we use:&lt;br /&gt;
  // $params-&amp;gt;get( &#039;parameter1&#039; );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to realise that any &amp;lt;code&amp;gt;merge&amp;lt;/code&amp;gt; carried out is persistent, so the following code (where for example you have an array containing the parameters sets for several items, and you want the parameters for each item to individually override the defaults) would not produce the result you might expect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  foreach ($itemparamsgroup as $itemparams)&lt;br /&gt;
  {&lt;br /&gt;
    $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
    $params-&amp;gt;merge( $itemparams );&lt;br /&gt;
    echo $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such cases, you will need to use the non-override method, and then force the overrides manually, as described below.&lt;br /&gt;
&lt;br /&gt;
===Without overrides===&lt;br /&gt;
&lt;br /&gt;
There will be cases where you don&#039;t want to use the default override pattern. For example, you may want to ignore the menu-specific parameters, and have only the item-specific parameters overriding the defaults. This is a little more difficult to accomplish, although it can still be done.&lt;br /&gt;
&lt;br /&gt;
You can access the Component-wide default parameter values, &#039;&#039;without the menu overrides&#039;&#039;, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $component = JComponentHelper::getComponent( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
  $params = new JParameter( $component-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override these with the menu parameters, but &#039;&#039;without&#039;&#039; the &#039;persistence&#039; effect described above, you can:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $menuitemid = JRequest::getInt( &#039;Itemid&#039; );&lt;br /&gt;
  if ($menuitemid)&lt;br /&gt;
  {&lt;br /&gt;
    $menu = JSite::getMenu();&lt;br /&gt;
    $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
    $params-&amp;gt;merge( $menuparams );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the item parameters as before, and choose whether to merge them in using the code above, or simply store them in a separate object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $itemparams = new JParameter( $row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can combine this code to achieve the effect that you want.  For example, you could override the Component-wide defaults with the item-specific parameters, but ignore those for the menu.  Or you could use the menu-specific parameters in some circumstances, and the item-specific ones in others.  [Whenever you depart from the standard approach, though, you should be careful that you inform your users how your Component works.  Users will expect your component to work the same way as those from the Joomla! core, so you should have a good reason for departing from this approach.]&lt;br /&gt;
&lt;br /&gt;
Accessing the value of a particular parameter is done in the same way as described above.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=10486</id>
		<title>J1.5:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=10486"/>
		<updated>2008-09-03T20:21:59Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Updated link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - backend==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Standard_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field &lt;br /&gt;
    reading &#039;font_size=16\n&#039;: --&amp;gt;&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param type=&amp;quot;type&amp;quot; name=&amp;quot;name&amp;quot; description=&amp;quot;description&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  &lt;br /&gt;
    When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the &lt;br /&gt;
    required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; &lt;br /&gt;
    parameter value. --&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the component.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view.  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  In addition, you can also choose to override the component-wide default parameters defined as above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; view output template (not to be confused with the site Template, which is different!) directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (at least when viewed using the default Khepri backend site Template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows the menu admin page for the Category &#039;List&#039; layout.  You can see that the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane is open, and contains form elements for five parameters.  There are no &#039;Advanced&#039; parameters for this view, and so the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane is not shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu items edit.png]]&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any &amp;lt;code&amp;gt;&amp;lt;param type=&amp;quot;radio&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt; parameter is shown not as a radio button form field, but by a drop-down list.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is set as the default option for the list.  Thus, by default, these parameters will use the component-wide default values, rather than overriding them.  (However, note that any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value, and so will override the component-wide default value if that is different).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;br /&gt;
&lt;br /&gt;
The front-end situation is a bit more complex than the back-end.  The &#039;standard&#039; way to deal with parameters in the frontend is to set up a cascade of overrides, as described above:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Item-specific &#039;&#039;overrides&#039;&#039; Menu-specific &#039;&#039;overrides&#039;&#039; Component-default&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want to do this, then a little extra work is required&lt;br /&gt;
&lt;br /&gt;
===With overrides===&lt;br /&gt;
&lt;br /&gt;
The following code will access the component-wide default parameters, &#039;&#039;already overridden&#039;&#039; with those for the menu item (if applicable):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. for the com_weblinks component, you would use:&lt;br /&gt;
  // $params = &amp;amp;JComponentHelper::getParams( &#039;com_weblinks&#039; )&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an MVC structure, this code would be placed in the &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field, and that the particular item has been loaded into the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; object by the method, you would then add in the item parameters to the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;merge( &amp;amp;$row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, in both cases (i.e. overrides by menu-specific parameters, and overrides by item-specific parameters), we aren&#039;t &#039;&#039;just&#039;&#039; doing overrides - we also add in any new parameters that weren&#039;t found in the defaults.  In other words, the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object ends up with all the parameters we need!&lt;br /&gt;
&lt;br /&gt;
To access the value of a specific parameter, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. to obtain the value of &#039;parameter1&#039;, we use:&lt;br /&gt;
  // $params-&amp;gt;get( &#039;parameter1&#039; );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to realise that any &amp;lt;code&amp;gt;merge&amp;lt;/code&amp;gt; carried out is persistent, so the following code (where for example you have an array containing the parameters sets for several items, and you want the parameters for each item to individually override the defaults) would not produce the result you might expect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  foreach ($itemparamsgroup as $itemparams)&lt;br /&gt;
  {&lt;br /&gt;
    $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
    $params-&amp;gt;merge( $itemparams );&lt;br /&gt;
    echo $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such cases, you will need to use the non-override method, and then force the overrides manually, as described below.&lt;br /&gt;
&lt;br /&gt;
===Without overrides===&lt;br /&gt;
&lt;br /&gt;
There will be cases where you don&#039;t want to use the default override pattern. For example, you may want to ignore the menu-specific parameters, and have only the item-specific parameters overriding the defaults. This is a little more difficult to accomplish, although it can still be done.&lt;br /&gt;
&lt;br /&gt;
You can access the component-wide default parameter values, &#039;&#039;without the menu overrides&#039;&#039;, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $component = JComponentHelper::getComponent( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
  $params = new JParameter( $component-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override these with the menu parameters, but &#039;&#039;without&#039;&#039; the &#039;persistence&#039; effect described above, you can:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $menuitemid = JRequest::getInt( &#039;Itemid&#039; );&lt;br /&gt;
  if ($menuitemid)&lt;br /&gt;
  {&lt;br /&gt;
    $menu = JSite::getMenu();&lt;br /&gt;
    $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
    $params-&amp;gt;merge( $menuparams );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the item parameters as before, and choose whether to merge them in using the code above, or simply store them in a separate object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $itemparams = new JParameter( $row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can combine this code to achieve the effect that you want.  For example, you could override the component-wide defaults with the item-specific parameters, but ignore those for the menu.  Or you could use the menu-specific parameters in some circumstances, and the item-specific ones in others.  [Whenever you depart from the standard approach, though, you should be careful that you inform your users how your component works.  Users will expect your component to work the same way as those from the Joomla! core, so you should have a good reason for departing from this approach.]&lt;br /&gt;
&lt;br /&gt;
Accessing the value of a particular parameter is done in the same way as described above.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=10485</id>
		<title>J1.5 talk:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=10485"/>
		<updated>2008-09-03T20:18:31Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I find the terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; confusing when applied in this context.&lt;br /&gt;
&lt;br /&gt;
also, links to the standard parameter types would be extremely useful.&lt;br /&gt;
http://docs.joomla.org/Standard_parameter_types&lt;br /&gt;
&lt;br /&gt;
Overall, I found the article extremely useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commercemeister, thanks for your comments.  Could you please explain what you find confusing about frontend and backend?  They are commonly used to refer to the main site and the administration parts of a Joomla! website, respectively.  It would be helpful to know how you think they should be clarified (or you could even just do it yourself - that&#039;s the beauty of a wiki!).  Thanks too for the note about parameter types - the article did originally link to a page with this information, but then that page was changed.  I will update it.&lt;br /&gt;
&lt;br /&gt;
One final point - please sign your comments using the four tildes at the end (&amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt;).  Thanks, [[User:Mike dowler|Mike]] 16:18, 3 September 2008 (EDT)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Storing_template_parameter_values&amp;diff=10255</id>
		<title>J1.5 talk:Storing template parameter values</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Storing_template_parameter_values&amp;diff=10255"/>
		<updated>2008-08-19T21:01:59Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: New page: Chris, again, this page is template-specific but the title isn&amp;#039;t. I suspect this one &amp;#039;&amp;#039;really&amp;#039;&amp;#039; is template-specific, and it is the title that needs to change. :-)  ~~~~&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Chris, again, this page is template-specific but the title isn&#039;t. I suspect this one &#039;&#039;really&#039;&#039; is template-specific, and it is the title that needs to change. :-)  [[User:Mike dowler|Mike]] 17:01, 19 August 2008 (EDT)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Creating_custom_template_parameter_types&amp;diff=10248</id>
		<title>J1.5 talk:Creating custom template parameter types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Creating_custom_template_parameter_types&amp;diff=10248"/>
		<updated>2008-08-19T19:41:52Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: New page: Chris, this page seems to be template-specific, but this is not clear from the title.  Parameters can also be used with other extensions.  Would you object to mentioning templates in the t...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Chris, this page seems to be template-specific, but this is not clear from the title.  Parameters can also be used with other extensions.  Would you object to mentioning templates in the title?&lt;br /&gt;
&lt;br /&gt;
Also, I am not entirely clear where the files should be stored - you seem to mention both &amp;lt;code&amp;gt;elements&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;html/parameters&amp;lt;/code&amp;gt; folders.  I think that the references to &amp;lt;code&amp;gt;templateDetails.xml&amp;lt;/code&amp;gt; may be a bit of a red herring.  Could we perhaps just remind people that they need to consider this when creating new files for a template, and link to another page specifying how this can be done (i.e. using &amp;lt;code&amp;gt;&amp;lt;file&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;folder&amp;gt;&amp;lt;/code&amp;gt;)? [[User:Mike dowler|Mike]] 15:41, 19 August 2008 (EDT)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:User_Group_Access_levels_explained_in_simple_terms&amp;diff=10246</id>
		<title>J1.5:User Group Access levels explained in simple terms</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:User_Group_Access_levels_explained_in_simple_terms&amp;diff=10246"/>
		<updated>2008-08-19T19:30:05Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Fixed typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Foreword ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve never been able to locate a &amp;quot;Plain Talk&amp;quot; version of how Joomla&#039;s access groups work, so I thought I&#039;d attempt to create one myself.  I created this in the process of doing training documentation for a client.  I hope this helps out those of you who have had a hard time finding resources to explain the concept, and I&#039;d appreciate comments and corrections.  Note: I am NOT a core dev, just a developer who wants to give something back to the community. &lt;br /&gt;
&lt;br /&gt;
== Audience ==&lt;br /&gt;
&lt;br /&gt;
This document is targeted at new users who have successfully completed a Joomla install and have accessed the Admin Backend, and upon creating their first, users wondered what the heck those Group levels mean!&lt;br /&gt;
&lt;br /&gt;
== Access Levels ==&lt;br /&gt;
&lt;br /&gt;
Joomla controls access to certain areas and features of a site through use of a basic ACL, or Access Control Level mechanism called Groups.  Certain groups have certain access level features and they are directly related to the creation, editing and publishing of content (through the Frontend and Backend interfaces) as well as to access to the Administrative (Backend) interface.&lt;br /&gt;
&lt;br /&gt;
Each group has different levels of access control and once a user is made a member of that group, they inherit those rights. Note that the &#039;Public Front-end&#039; and &#039;Public Back-end&#039; groups are merely placeholders at this point in time. They are not valid group selections at this time, but in the future, they will define the default access levels for anonymous users in the Front-end and Back-end systems.  The Joomla ACL is currently undergoing further development to allow greater control over aspects and access to the site.  Future ACL enhancements are outlined in the “Joomla Roadmap”, (among other future plans) and is available at http://www.joomla.org/content/view/14/28/.&lt;br /&gt;
&lt;br /&gt;
There are four (4) Front-end groups available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Registered&#039;&#039;&#039; - This group allows the user to login to the Frontend interface.  Registered users can&#039;t contribute content, but this may allow them access to other areas, like a forum or download section if your site has one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Author&#039;&#039;&#039; - This group allows a user to post content, usually via a link in the User Menu. They can submit new content, select options to show the item on the front page and select dates for publishing but they cannot directly publish any content.  When content is submitted by an Author level user, they receive the message, “Thanks for your submission. Your submission will now be reviewed before being posted to the site.”  They can edit only their own articles but only when that article has been published and is visible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Editor&#039;&#039;&#039; - This group allows a user to post and edit any (not just their own) content item from the Frontend. They can also edit content that has not been published.  If your site uses the default installation’s menu option “News”, which is a Table List – Content Section type, Editors will see unpublished articles in the list that they can select for editing, where as an Author or Public (unregistered) user will not even see the unpublished items in the list.  Still, Editor users cannot, publish or change the publishing status of any articles, even their own.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Publisher&#039;&#039;&#039; - This group allows a user to post, edit and publish any (not just their own) content item from the Front-end.  Publishers can review all articles, edit and change publishing options but the can also determine when an article is ready for publication, making it visible to Registered, Author and the Unregistered Public (depending on what visibility was chosen in the article, of course!)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are three (3) Administration section groups that allow access to Joomla:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Manager&#039;&#039;&#039; - This group allows access to content creation and other system information from the Backend. Think of Manager users as Publishers, with Backend access.  They can log in through the Administrator interface, but their rights and access are generally restricted to content management.  They can create or edit any content, access to some Backend only features like adding, deleting and editing Sections and Categories, editing the Front Page and Menus, but they don’t have any access to the “Mechanics” of Joomla, like user management or the ability to install components or modules.  Note that if a Manager logs in through the Frontend interface, they’re treated just like a Publisher, with the same rights and access.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administrator&#039;&#039;&#039; - This group allows access to most administration functions.  An Administrator user has all the privileges on the back end of a Manager, but they also have access to set options on, and install/delete components, modules and bots, User Manager access and can view the site statistics.  What they cannot do however is change, edit or install Site Templates or make any changes to the sites Global configuration options.  On login through the Frontend, they are treated as Publishers, just like the Manger users.  Interesting to note; when an Administrator accesses the User Manager list, they will see all users at their access level or below; in other words they can modify any user EXCEPT a Super Administrator – in fact, they will not even see Super Administrator accounts in the list!  Also, they cannot create additional Super Administrator level accounts, only a Super Admin can do that.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Super Administrator&#039;&#039;&#039; - This group allows access to all administration functions.  Only another Super Administrator can create or edit a Super Administrator user account. Full access to ALL AREAS is given to Super Administrators, and once created they cannot be deleted – EVEN BY ANOTHER SUPER ADMIN!   (Users with access directly to the MySQL database may be able to manually delete these users, but it is not for the timid and can result in a full lockout!)&lt;br /&gt;
&lt;br /&gt;
Because of this, give a bit of thought to who you need to grant this highest level of access to.  Super Admins, while they cannot delete another SA can block the user from logging in or change the password on another SA account.  Like the other Backend user accounts, SA’s are treated as Publishers when they login through the Frontend interface.&lt;br /&gt;
&lt;br /&gt;
== Summation ==&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, the Joomla ACL is currently in further development as of the writing of this document and will provide new features and greater control.  However these enhancements won’t be seen until Joomla 1.2, currently expected sometime in Q3 2006, so the previous overview will be what most users and administrators will see for the foreseeable future.&lt;br /&gt;
&lt;br /&gt;
Components have recently been made available to extend the Joomla ACL, including JACLPlus by BYOSTECH (http://www.byostech.com) which seems to be the most complete and popular, but due diligence should be exercised with ANY ACL extension – not only in how it affects currently available add ons for Joomla, but also how it may affect any new core versions that will be released in the future.  This is not an endorsement of any specific project or an indictment; merely a bit of advice to use common sense.  There are other posts in the forum that deal with ACL extensions, and it would be a good idea to read them and ask questions before embarking on any changes.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tips and tricks]]&lt;br /&gt;
[[Category:Tips and tricks 1.0]]&lt;br /&gt;
[[Category:Tips and tricks 1.5]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Regular_expressions_in_parameter_arguments&amp;diff=10243</id>
		<title>J1.5:Regular expressions in parameter arguments</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Regular_expressions_in_parameter_arguments&amp;diff=10243"/>
		<updated>2008-08-19T11:46:24Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Fixed typo in source tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some parameter arguments take regular expressions as values.  For example, the &#039;&#039;&#039;filter&#039;&#039;&#039; and &#039;&#039;&#039;exclude&#039;&#039;&#039; arguments for the &#039;&#039;&#039;filelist&#039;&#039;&#039; and &#039;&#039;&#039;imagelist&#039;&#039;&#039; parameter types.  This is enormously powerful, but it requires you to know at least a little regular expression syntax to be able to use it effectively.&lt;br /&gt;
&lt;br /&gt;
Described here are some examples of simple regular expressions that you might want to use in the context of template parameters.  A complete reference to regular expression syntax is beyond the scope of this book, but can be found online at http://www.php.net/manual/en/book.pcre.php&lt;br /&gt;
&lt;br /&gt;
=== Simple filter string ===&lt;br /&gt;
Suppose you want to use the &#039;&#039;&#039;filelist&#039;&#039;&#039; parameter type to list the files in a given directory.  There are many files in the directory but you only want those with a &#039;.php&#039; extension to be listed.  Then you would use this argument in the &amp;lt;tt&amp;gt;&amp;lt;param&amp;gt;&amp;lt;/tt&amp;gt; element&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “\.php”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first thing to note is the leading backslash character.  This is needed because the “.” character has a special meaning in regular expressions and that is not what is intended here.  The backslash character tells the regular expression parser to treat the next character (which is the “.”) as just an ordinary character and not to give it the special meaning that it normally does.&lt;br /&gt;
&lt;br /&gt;
The effect of this filter string is to only include those files that have the characters “.”, “p”, “h” and “p”, in that order, anywhere in the file name.&lt;br /&gt;
&lt;br /&gt;
=== Anchoring to the end of the string ===&lt;br /&gt;
In the above example, if there is a file called &#039;&#039;configuration.php-dist&#039;&#039; then it would be included in the list because “.php” occurs in the middle of the string.  Perhaps you don&#039;t want that, in which case you can use this instead&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “\.php$”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The “$” tells the regular expression parser that the string “.php” must occur at the end of the file name.  So &#039;&#039;configuration.php&#039;&#039; will be included, but &#039;&#039;configuration.php-dist&#039;&#039; will not.&lt;br /&gt;
&lt;br /&gt;
=== Anchoring to the start of the string ===&lt;br /&gt;
Suppose you want to list those files which start with the string “joomla” then you would use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “^joomla”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The “^” tells the regular expression parser that the string following must occur at the start of the file name.&lt;br /&gt;
&lt;br /&gt;
=== Anchoring to both ends of the string ===&lt;br /&gt;
Suppose you want to list all those files whose names begin with “joomla” and end with “.php”, but you don&#039;t care about what is in between.  Then you can use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “^joomla(.*)\.php$”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here you will recognise the “^” character as anchoring the start of the string, and the “$” as anchoring the end of the string.  The “(.*)” indicates that any number of characters, including no characters at all, are acceptable in that position.  Breaking this down a little, the “.” will match any single character; the “*” indicates that the preceding character (in this the “.”) can occur any number of times, including zero; and the brackets serve to separate the substring from the rest of the string.&lt;br /&gt;
&lt;br /&gt;
=== Case sensitivity ===&lt;br /&gt;
It is important to note that regular expression strings are case sensitive.  Suppose you have some file names that begin with “Joomla” instead of “joomla”.  These would not be included if you used the string in the previous example.  To allow for the first character of the file name to be either upper or lower case you can use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “^[Jj]oomla”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the “[Jj]” indicates that either “J” or “j” should be matched.  The brackets (“[]”) indicate a “character class” and should contain list of characters that are to be matched.  If you want to include all filenames beginning with the letters “s”, “t”, “u” or “v” then you could use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “^[stuv]”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actually you can shorten this a little by using a range specification&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “^[s-v]”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to make this case insensitive then use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “^[s-vS-V]”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Filtering a list of extensions ===&lt;br /&gt;
Suppose you want to filter your list of files so that only those files with specific extensions are included.  For a single extension you can just use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “\.php$”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But what if you want to filter several different extensions?  For example, to only include file names ending in “.php”, “.html” or “.txt” you can use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “\.php$|\.html$|\.txt$”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The “|” character indicates an alternative, so “this|that” will match with “this” or “that”.&lt;br /&gt;
&lt;br /&gt;
You might notice that the &#039;&#039;&#039;imagelist&#039;&#039;&#039; parameter type is exactly the same as the &#039;&#039;&#039;filelist&#039;&#039;&#039; parameter type with this filter string&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
filter = “\.png$|\.gif$|\.jpg$|\.bmp$|\.ico$”&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[Category:Templates]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Usergroup_parameter_type&amp;diff=10231</id>
		<title>J1.5 talk:Usergroup parameter type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Usergroup_parameter_type&amp;diff=10231"/>
		<updated>2008-08-18T20:21:54Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: New page: Is the required type &amp;quot;usergroups&amp;quot; (with &amp;#039;s&amp;#039;) or &amp;quot;usergroup&amp;quot; (without &amp;#039;s&amp;#039;)?  The text says one thing, but the XML example code says the other. ~~~~&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is the required type &amp;quot;usergroups&amp;quot; (with &#039;s&#039;) or &amp;quot;usergroup&amp;quot; (without &#039;s&#039;)?  The text says one thing, but the XML example code says the other. [[User:Mike dowler|Mike]] 16:21, 18 August 2008 (EDT)&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=7360</id>
		<title>J1.5:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=7360"/>
		<updated>2008-05-26T21:40:51Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Added review tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - backend==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field reading &#039;font_size=16\n&#039;:&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param type=&amp;quot;type&amp;quot; name=&amp;quot;name&amp;quot; description=&amp;quot;description&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; parameter value.&lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the component.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view.  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  In addition, you can also choose to override the component-wide default parameters defined as above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; view output template (not to be confused with the site Template, which is different!) directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (at least when viewed using the default Khepri backend site Template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows the menu admin page for the Category &#039;List&#039; layout.  You can see that the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane is open, and contains form elements for five parameters.  There are no &#039;Advanced&#039; parameters for this view, and so the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane is not shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu items edit.png]]&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any &amp;lt;code&amp;gt;&amp;lt;param type=&amp;quot;radio&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt; parameter is shown not as a radio button form field, but by a drop-down list.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is set as the default option for the list.  Thus, by default, these parameters will use the component-wide default values, rather than overriding them.  (However, note that any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value, and so will override the component-wide default value if that is different).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;br /&gt;
&lt;br /&gt;
The front-end situation is a bit more complex than the back-end.  The &#039;standard&#039; way to deal with parameters in the frontend is to set up a cascade of overrides, as described above:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Item-specific &#039;&#039;overrides&#039;&#039; Menu-specific &#039;&#039;overrides&#039;&#039; Component-default&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want to do this, then a little extra work is required&lt;br /&gt;
&lt;br /&gt;
===With overrides===&lt;br /&gt;
&lt;br /&gt;
The following code will access the component-wide default parameters, &#039;&#039;already overridden&#039;&#039; with those for the menu item (if applicable):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. for the com_weblinks component, you would use:&lt;br /&gt;
  // $params = &amp;amp;JComponentHelper::getParams( &#039;com_weblinks&#039; )&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an MVC structure, this code would be placed in the &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field, and that the particular item has been loaded into the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; object by the method, you would then add in the item parameters to the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;merge( &amp;amp;$row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, in both cases (i.e. overrides by menu-specific parameters, and overrides by item-specific parameters), we aren&#039;t &#039;&#039;just&#039;&#039; doing overrides - we also add in any new parameters that weren&#039;t found in the defaults.  In other words, the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object ends up with all the parameters we need!&lt;br /&gt;
&lt;br /&gt;
To access the value of a specific parameter, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. to obtain the value of &#039;parameter1&#039;, we use:&lt;br /&gt;
  // $params-&amp;gt;get( &#039;parameter1&#039; );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to realise that any &amp;lt;code&amp;gt;merge&amp;lt;/code&amp;gt; carried out is persistent, so the following code (where for example you have an array containing the parameters sets for several items, and you want the parameters for each item to individually override the defaults) would not produce the result you might expect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  foreach ($itemparamsgroup as $itemparams)&lt;br /&gt;
  {&lt;br /&gt;
    $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
    $params-&amp;gt;merge( $itemparams );&lt;br /&gt;
    echo $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such cases, you will need to use the non-override method, and then force the overrides manually, as described below.&lt;br /&gt;
&lt;br /&gt;
===Without overrides===&lt;br /&gt;
&lt;br /&gt;
There will be cases where you don&#039;t want to use the default override pattern. For example, you may want to ignore the menu-specific parameters, and have only the item-specific parameters overriding the defaults. This is a little more difficult to accomplish, although it can still be done.&lt;br /&gt;
&lt;br /&gt;
You can access the component-wide default parameter values, &#039;&#039;without the menu overrides&#039;&#039;, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $component = JComponentHelper::getComponent( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
  $params = new JParameter( $component-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override these with the menu parameters, but &#039;&#039;without&#039;&#039; the &#039;persistence&#039; effect described above, you can:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $menuitemid = JRequest::getInt( &#039;Itemid&#039; );&lt;br /&gt;
  if ($menuitemid)&lt;br /&gt;
  {&lt;br /&gt;
    $menu = JSite::getMenu();&lt;br /&gt;
    $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
    $params-&amp;gt;merge( $menuparams );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the item parameters as before, and choose whether to merge them in using the code above, or simply store them in a separate object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $itemparams = new JParameter( $row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can combine this code to achieve the effect that you want.  For example, you could override the component-wide defaults with the item-specific parameters, but ignore those for the menu.  Or you could use the menu-specific parameters in some circumstances, and the item-specific ones in others.  [Whenever you depart from the standard approach, though, you should be careful that you inform your users how your component works.  Users will expect your component to work the same way as those from the Joomla! core, so you should have a good reason for departing from this approach.]&lt;br /&gt;
&lt;br /&gt;
Accessing the value of a particular parameter is done in the same way as described above.&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7358</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7358"/>
		<updated>2008-05-26T21:36:37Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Removing all content from page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=7357</id>
		<title>J1.5:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Component_parameters&amp;diff=7357"/>
		<updated>2008-05-26T21:36:29Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background==&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - backend==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field reading &#039;font_size=16\n&#039;:&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param type=&amp;quot;type&amp;quot; name=&amp;quot;name&amp;quot; description=&amp;quot;description&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; parameter value.&lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the component.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view.  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  In addition, you can also choose to override the component-wide default parameters defined as above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; view output template (not to be confused with the site Template, which is different!) directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (at least when viewed using the default Khepri backend site Template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows the menu admin page for the Category &#039;List&#039; layout.  You can see that the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane is open, and contains form elements for five parameters.  There are no &#039;Advanced&#039; parameters for this view, and so the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane is not shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu items edit.png]]&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any &amp;lt;code&amp;gt;&amp;lt;param type=&amp;quot;radio&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt; parameter is shown not as a radio button form field, but by a drop-down list.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is set as the default option for the list.  Thus, by default, these parameters will use the component-wide default values, rather than overriding them.  (However, note that any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value, and so will override the component-wide default value if that is different).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;br /&gt;
&lt;br /&gt;
The front-end situation is a bit more complex than the back-end.  The &#039;standard&#039; way to deal with parameters in the frontend is to set up a cascade of overrides, as described above:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Item-specific &#039;&#039;overrides&#039;&#039; Menu-specific &#039;&#039;overrides&#039;&#039; Component-default&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want to do this, then a little extra work is required&lt;br /&gt;
&lt;br /&gt;
===With overrides===&lt;br /&gt;
&lt;br /&gt;
The following code will access the component-wide default parameters, &#039;&#039;already overridden&#039;&#039; with those for the menu item (if applicable):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. for the com_weblinks component, you would use:&lt;br /&gt;
  // $params = &amp;amp;JComponentHelper::getParams( &#039;com_weblinks&#039; )&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an MVC structure, this code would be placed in the &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field, and that the particular item has been loaded into the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; object by the method, you would then add in the item parameters to the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;merge( &amp;amp;$row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, in both cases (i.e. overrides by menu-specific parameters, and overrides by item-specific parameters), we aren&#039;t &#039;&#039;just&#039;&#039; doing overrides - we also add in any new parameters that weren&#039;t found in the defaults.  In other words, the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object ends up with all the parameters we need!&lt;br /&gt;
&lt;br /&gt;
To access the value of a specific parameter, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. to obtain the value of &#039;parameter1&#039;, we use:&lt;br /&gt;
  // $params-&amp;gt;get( &#039;parameter1&#039; );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to realise that any &amp;lt;code&amp;gt;merge&amp;lt;/code&amp;gt; carried out is persistent, so the following code (where for example you have an array containing the parameters sets for several items, and you want the parameters for each item to individually override the defaults) would not produce the result you might expect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  foreach ($itemparamsgroup as $itemparams)&lt;br /&gt;
  {&lt;br /&gt;
    $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
    $params-&amp;gt;merge( $itemparams );&lt;br /&gt;
    echo $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such cases, you will need to use the non-override method, and then force the overrides manually, as described below.&lt;br /&gt;
&lt;br /&gt;
===Without overrides===&lt;br /&gt;
&lt;br /&gt;
There will be cases where you don&#039;t want to use the default override pattern. For example, you may want to ignore the menu-specific parameters, and have only the item-specific parameters overriding the defaults. This is a little more difficult to accomplish, although it can still be done.&lt;br /&gt;
&lt;br /&gt;
You can access the component-wide default parameter values, &#039;&#039;without the menu overrides&#039;&#039;, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $component = JComponentHelper::getComponent( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
  $params = new JParameter( $component-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override these with the menu parameters, but &#039;&#039;without&#039;&#039; the &#039;persistence&#039; effect described above, you can:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $menuitemid = JRequest::getInt( &#039;Itemid&#039; );&lt;br /&gt;
  if ($menuitemid)&lt;br /&gt;
  {&lt;br /&gt;
    $menu = JSite::getMenu();&lt;br /&gt;
    $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
    $params-&amp;gt;merge( $menuparams );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the item parameters as before, and choose whether to merge them in using the code above, or simply store them in a separate object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $itemparams = new JParameter( $row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can combine this code to achieve the effect that you want.  For example, you could override the component-wide defaults with the item-specific parameters, but ignore those for the menu.  Or you could use the menu-specific parameters in some circumstances, and the item-specific ones in others.  [Whenever you depart from the standard approach, though, you should be careful that you inform your users how your component works.  Users will expect your component to work the same way as those from the Joomla! core, so you should have a good reason for departing from this approach.]&lt;br /&gt;
&lt;br /&gt;
Accessing the value of a particular parameter is done in the same way as described above.&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7356</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7356"/>
		<updated>2008-05-26T21:31:38Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: /* With overrides */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using parameters with a component=&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
===Types of component parameter===&lt;br /&gt;
&lt;br /&gt;
====1. Component-wide default parameters====&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
====2. Menu item specific parameters====&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
====3. &#039;Article&#039; specific parameters====&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
===Storing the parameters and their values.===&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
====1. Component-wide default parameters====&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
====2. Menu item specific parameters====&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
====3. &#039;Article&#039; specific parameters====&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Accessing the parameters - backend===&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
====1. Component-wide default parameters====&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field reading &#039;font_size=16\n&#039;:&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param type=&amp;quot;type&amp;quot; name=&amp;quot;name&amp;quot; description=&amp;quot;description&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; parameter value.&lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the component.&lt;br /&gt;
&lt;br /&gt;
====2. Menu item specific parameters====&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view.  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  In addition, you can also choose to override the component-wide default parameters defined as above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; view output template (not to be confused with the site Template, which is different!) directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (at least when viewed using the default Khepri backend site Template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows the menu admin page for the Category &#039;List&#039; layout.  You can see that the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane is open, and contains form elements for five parameters.  There are no &#039;Advanced&#039; parameters for this view, and so the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane is not shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu items edit.png]]&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any &amp;lt;code&amp;gt;&amp;lt;param type=&amp;quot;radio&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt; parameter is shown not as a radio button form field, but by a drop-down list.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is set as the default option for the list.  Thus, by default, these parameters will use the component-wide default values, rather than overriding them.  (However, note that any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value, and so will override the component-wide default value if that is different).&lt;br /&gt;
&lt;br /&gt;
====3. &#039;Article&#039; specific parameters====&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Accessing the parameters - frontend===&lt;br /&gt;
&lt;br /&gt;
The front-end situation is a bit more complex than the back-end.  The &#039;standard&#039; way to deal with parameters in the frontend is to set up a cascade of overrides, as described above:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Item-specific &#039;&#039;overrides&#039;&#039; Menu-specific &#039;&#039;overrides&#039;&#039; Component-default&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want to do this, then a little extra work is required&lt;br /&gt;
&lt;br /&gt;
====With overrides====&lt;br /&gt;
&lt;br /&gt;
The following code will access the component-wide default parameters, &#039;&#039;already overridden&#039;&#039; with those for the menu item (if applicable):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. for the com_weblinks component, you would use:&lt;br /&gt;
  // $params = &amp;amp;JComponentHelper::getParams( &#039;com_weblinks&#039; )&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an MVC structure, this code would be placed in the &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field, and that the particular item has been loaded into the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; object by the method, you would then add in the item parameters to the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;merge( &amp;amp;$row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, in both cases (i.e. overrides by menu-specific parameters, and overrides by item-specific parameters), we aren&#039;t &#039;&#039;just&#039;&#039; doing overrides - we also add in any new parameters that weren&#039;t found in the defaults.  In other words, the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object ends up with all the parameters we need!&lt;br /&gt;
&lt;br /&gt;
To access the value of a specific parameter, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. to obtain the value of &#039;parameter1&#039;, we use:&lt;br /&gt;
  // $params-&amp;gt;get( &#039;parameter1&#039; );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to realise that any &amp;lt;code&amp;gt;merge&amp;lt;/code&amp;gt; carried out is persistent, so the following code (where for example you have an array containing the parameters sets for several items, and you want the parameters for each item to individually override the defaults) would not produce the result you might expect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  foreach ($itemparamsgroup as $itemparams)&lt;br /&gt;
  {&lt;br /&gt;
    $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
    $params-&amp;gt;merge( $itemparams );&lt;br /&gt;
    echo $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such cases, you will need to use the non-override method, and then force the overrides manually, as described below.&lt;br /&gt;
&lt;br /&gt;
====Without overrides====&lt;br /&gt;
&lt;br /&gt;
There will be cases where you don&#039;t want to use the default override pattern. For example, you may want to ignore the menu-specific parameters, and have only the item-specific parameters overriding the defaults. This is a little more difficult to accomplish, although it can still be done.&lt;br /&gt;
&lt;br /&gt;
You can access the component-wide default parameter values, &#039;&#039;without the menu overrides&#039;&#039;, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $component = JComponentHelper::getComponent( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
  $params = new JParameter( $component-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override these with the menu parameters, but &#039;&#039;without&#039;&#039; the &#039;persistence&#039; effect described above, you can:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $menuitemid = JRequest::getInt( &#039;Itemid&#039; );&lt;br /&gt;
  if ($menuitemid)&lt;br /&gt;
  {&lt;br /&gt;
    $menu = JSite::getMenu();&lt;br /&gt;
    $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
    $params-&amp;gt;merge( $menuparams );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the item parameters as before, and choose whether to merge them in using the code above, or simply store them in a separate object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $itemparams = new JParameter( $row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can combine this code to achieve the effect that you want.  For example, you could override the component-wide defaults with the item-specific parameters, but ignore those for the menu.  Or you could use the menu-specific parameters in some circumstances, and the item-specific ones in others.  [Whenever you depart from the standard approach, though, you should be careful that you inform your users how your component works.  Users will expect your component to work the same way as those from the Joomla! core, so you should have a good reason for departing from this approach.]&lt;br /&gt;
&lt;br /&gt;
Accessing the value of a particular parameter is done in the same way as described above.&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7355</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7355"/>
		<updated>2008-05-26T20:17:19Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: /* Without overrides */  Added further detail&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using parameters with a component=&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
===Types of component parameter===&lt;br /&gt;
&lt;br /&gt;
====1. Component-wide default parameters====&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
====2. Menu item specific parameters====&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
====3. &#039;Article&#039; specific parameters====&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
===Storing the parameters and their values.===&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
====1. Component-wide default parameters====&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
====2. Menu item specific parameters====&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
====3. &#039;Article&#039; specific parameters====&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Accessing the parameters - backend===&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
====1. Component-wide default parameters====&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field reading &#039;font_size=16\n&#039;:&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param type=&amp;quot;type&amp;quot; name=&amp;quot;name&amp;quot; description=&amp;quot;description&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; parameter value.&lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the component.&lt;br /&gt;
&lt;br /&gt;
====2. Menu item specific parameters====&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view.  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  In addition, you can also choose to override the component-wide default parameters defined as above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; view output template (not to be confused with the site Template, which is different!) directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (at least when viewed using the default Khepri backend site Template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows the menu admin page for the Category &#039;List&#039; layout.  You can see that the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane is open, and contains form elements for five parameters.  There are no &#039;Advanced&#039; parameters for this view, and so the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane is not shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu items edit.png]]&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any &amp;lt;code&amp;gt;&amp;lt;param type=&amp;quot;radio&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt; parameter is shown not as a radio button form field, but by a drop-down list.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is set as the default option for the list.  Thus, by default, these parameters will use the component-wide default values, rather than overriding them.  (However, note that any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value, and so will override the component-wide default value if that is different).&lt;br /&gt;
&lt;br /&gt;
====3. &#039;Article&#039; specific parameters====&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Accessing the parameters - frontend===&lt;br /&gt;
&lt;br /&gt;
The front-end situation is a bit more complex than the back-end.  The &#039;standard&#039; way to deal with parameters in the frontend is to set up a cascade of overrides, as described above:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Item-specific &#039;&#039;overrides&#039;&#039; Menu-specific &#039;&#039;overrides&#039;&#039; Component-default&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want to do this, then a little extra work is required&lt;br /&gt;
&lt;br /&gt;
====With overrides====&lt;br /&gt;
&lt;br /&gt;
The following code will access the component-wide default parameters, &#039;&#039;already overridden&#039;&#039; with those for the menu item (if applicable):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. for the com_weblinks component, you would use:&lt;br /&gt;
  // $params = &amp;amp;JComponentHelper::getParams( &#039;com_weblinks&#039; )&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an MVC structure, this code would be placed in the &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field, and that the particular item has been loaded into the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; object by the method, you would then add in the item parameters to the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;merge( &amp;amp;$row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, in both cases (i.e. overrides by menu-specific parameters, and overrides by item-specific parameters), we aren&#039;t &#039;&#039;just&#039;&#039; doing overrides - we also add in any new parameters that weren&#039;t found in the defaults.  In other words, the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object ends up with all the parameters we need!&lt;br /&gt;
&lt;br /&gt;
To access the value of a specific parameter, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. to obtain the value of &#039;parameter1&#039;, we use:&lt;br /&gt;
  // $params-&amp;gt;get( &#039;parameter1&#039; );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to realise that and &amp;lt;code&amp;gt;merge&amp;lt;/code&amp;gt; carried out is persistent, so the following code (where for example you have an array containing the parameters sets for several items, and you want the parameters for each item to individually override the defaults) would not produce the result you might expect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  foreach ($itemparamsgroup as $itemparams)&lt;br /&gt;
  {&lt;br /&gt;
    $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
    $params-&amp;gt;merge( $itemparams );&lt;br /&gt;
    echo $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such cases, you will need to use the non-override method, and then force the overrides manually, as described below.&lt;br /&gt;
&lt;br /&gt;
====Without overrides====&lt;br /&gt;
&lt;br /&gt;
There will be cases where you don&#039;t want to use the default override pattern. For example, you may want to ignore the menu-specific parameters, and have only the item-specific parameters overriding the defaults. This is a little more difficult to accomplish, although it can still be done.&lt;br /&gt;
&lt;br /&gt;
You can access the component-wide default parameter values, &#039;&#039;without the menu overrides&#039;&#039;, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $component = JComponentHelper::getComponent( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
  $params = new JParameter( $component-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override these with the menu parameters, but &#039;&#039;without&#039;&#039; the &#039;persistence&#039; effect described above, you can:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $menuitemid = JRequest::getInt( &#039;Itemid&#039; );&lt;br /&gt;
  if ($menuitemid)&lt;br /&gt;
  {&lt;br /&gt;
    $menu = JSite::getMenu();&lt;br /&gt;
    $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
    $params-&amp;gt;merge( $menuparams );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the item parameters as before, and choose whether to merge them in using the code above, or simply store them in a separate object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $itemparams = new JParameter( $row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can combine this code to achieve the effect that you want.  For example, you could override the component-wide defaults with the item-specific parameters, but ignore those for the menu.  Or you could use the menu-specific parameters in some circumstances, and the item-specific ones in others.  [Whenever you depart from the standard approach, though, you should be careful that you inform your users how your component works.  Users will expect your component to work the same way as those from the Joomla! core, so you should have a good reason for departing from this approach.]&lt;br /&gt;
&lt;br /&gt;
Accessing the value of a particular parameter is done in the same way as described above.&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7311</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7311"/>
		<updated>2008-05-23T20:25:21Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using parameters with a component=&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
===Types of component parameter===&lt;br /&gt;
&lt;br /&gt;
====1. Component-wide default parameters====&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
====2. Menu item specific parameters====&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
====3. &#039;Article&#039; specific parameters====&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
===Storing the parameters and their values.===&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
====1. Component-wide default parameters====&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
====2. Menu item specific parameters====&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
====3. &#039;Article&#039; specific parameters====&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Accessing the parameters - backend===&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
====1. Component-wide default parameters====&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field reading &#039;font_size=16\n&#039;:&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param type=&amp;quot;type&amp;quot; name=&amp;quot;name&amp;quot; description=&amp;quot;description&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; parameter value.&lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the component.&lt;br /&gt;
&lt;br /&gt;
====2. Menu item specific parameters====&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view.  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  In addition, you can also choose to override the component-wide default parameters defined as above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; view output template (not to be confused with the site Template, which is different!) directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (at least when viewed using the default Khepri backend site Template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows the menu admin page for the Category &#039;List&#039; layout.  You can see that the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane is open, and contains form elements for five parameters.  There are no &#039;Advanced&#039; parameters for this view, and so the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane is not shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu items edit.png]]&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any &amp;lt;code&amp;gt;&amp;lt;param type=&amp;quot;radio&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt; parameter is shown not as a radio button form field, but by a drop-down list.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is set as the default option for the list.  Thus, by default, these parameters will use the component-wide default values, rather than overriding them.  (However, note that any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value, and so will override the component-wide default value if that is different).&lt;br /&gt;
&lt;br /&gt;
====3. &#039;Article&#039; specific parameters====&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Accessing the parameters - frontend===&lt;br /&gt;
&lt;br /&gt;
The front-end situation is a bit more complex than the back-end.  The &#039;standard&#039; way to deal with parameters in the frontend is to set up a cascade of overrides, as described above:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Item-specific &#039;&#039;overrides&#039;&#039; Menu-specific &#039;&#039;overrides&#039;&#039; Component-default&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want to do this, then a little extra work is required&lt;br /&gt;
&lt;br /&gt;
====With overrides====&lt;br /&gt;
&lt;br /&gt;
The following code will access the component-wide default parameters, &#039;&#039;already overridden&#039;&#039; with those for the menu item (if applicable):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. for the com_weblinks component, you would use:&lt;br /&gt;
  // $params = &amp;amp;JComponentHelper::getParams( &#039;com_weblinks&#039; )&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an MVC structure, this code would be placed in the &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field, and that the particular item has been loaded into the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; object by the method, you would then add in the item parameters to the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;merge( &amp;amp;$row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, in both cases (i.e. overrides by menu-specific parameters, and overrides by item-specific parameters), we aren&#039;t &#039;&#039;just&#039;&#039; doing overrides - we also add in any new parameters that weren&#039;t found in the defaults.  In other words, the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object ends up with all the parameters we need!&lt;br /&gt;
&lt;br /&gt;
To access the value of a specific parameter, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
&lt;br /&gt;
  // e.g. to obtain the value of &#039;parameter1&#039;, we use:&lt;br /&gt;
  // $params-&amp;gt;get( &#039;parameter1&#039; );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to realise that and &amp;lt;code&amp;gt;merge&amp;lt;/code&amp;gt; carried out is persistent, so the following code (where for example you have an array containing the parameters sets for several items, and you want the parameters for each item to individually override the defaults) would not produce the result you might expect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  foreach ($itemparamsgroup as $itemparams)&lt;br /&gt;
  {&lt;br /&gt;
    $params = &amp;amp;JComponentHelper::getParams( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
    $params-&amp;gt;merge( $itemparams );&lt;br /&gt;
    echo $params-&amp;gt;get( &#039;PARAMETER_NAME&#039; );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such cases, you will need to use the non-override method, and then force the overrides manually, as described below.&lt;br /&gt;
&lt;br /&gt;
====Without overrides====&lt;br /&gt;
&lt;br /&gt;
There will be cases where you don&#039;t want to use the default override pattern. For example, you may want to ignore the menu-specific parameters, and have only the item-specific parameters overriding the defaults. This is a little more difficult to accomplish, although it can still be done.&lt;br /&gt;
&lt;br /&gt;
You can access the component-wide default parameter values, &#039;&#039;without the menu overrides&#039;&#039;, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $component = JComponentHelper::getComponent( &#039;COMPONENT_NAME&#039; );&lt;br /&gt;
  $params = new JParameter( $component-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to override these with the menu parameters, but &#039;&#039;without&#039;&#039; the &#039;persistence&#039; effect described above, you can:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $menuitemid = JRequest::getInt( &#039;Itemid&#039; );&lt;br /&gt;
  if ($menuitemid)&lt;br /&gt;
  {&lt;br /&gt;
    $menu = JSite::getMenu();&lt;br /&gt;
    $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
    $params-&amp;gt;merge( $menuparams );&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the item parameters as before, and choose whether to merge them in using the code above, or simply store them in a separate object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $itemparams = new JParameter( $row-&amp;gt;params );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:How_to_override_the_output_from_the_Joomla!_core&amp;diff=7310</id>
		<title>Archived:How to override the output from the Joomla! core</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:How_to_override_the_output_from_the_Joomla!_core&amp;diff=7310"/>
		<updated>2008-05-23T19:10:15Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There may be occasions where you would like to change the way a Joomla! Extension (such as a Component or Module, whether from the Joomla! core or produced by a third party) is displayed on your site.  Of course, you could recode the Extension from scratch, but that may be a bit ambitious for you! Thankfully, there is another way.  &lt;br /&gt;
&lt;br /&gt;
The standard output from any Joomla! Module or Component can be overridden by adding code to the &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; directory of your template. It is also possible to override two aspects of core functionality: Module chrome, and pagination.&lt;br /&gt;
&lt;br /&gt;
=== Getting a head-start with overrides ===&lt;br /&gt;
If you are new to Joomla! development, then it is probably easiest to start with an existing view, and try modifying it to get what you want.  To do this, you should make a copy of the existing view in the &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; directory of your template, and then modify the copy.  The directory structure you need is &amp;lt;code&amp;gt;TEMPLATE_NAME/html/EXTENSION_NAME/VIEW_NAME/FILE_NAME.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to change the way that the &#039;&amp;lt;code&amp;gt;Article&amp;lt;/code&amp;gt;&#039; view displays a &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; article, then you should copy the file at &amp;lt;code&amp;gt;PATH_TO_JOOMLA/components/com_content/views/article/tmpl/default.php&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TEMPLATE_NAME/html/com_content/article/default.php&amp;lt;/code&amp;gt; (note the slight difference in directory structure).  Similarly, if you want to change how the &amp;lt;code&amp;gt;mod_login&amp;lt;/code&amp;gt; Module is displayed, then you should copy &amp;lt;code&amp;gt;PATH_TO_JOOMLA/modules/mod_login/tmpl/default.php&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TEMPLATE_NAME/html/mod_login/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Joomla! comes pre-packaged with a frontend template called [[Beez]]. Beez utilizes template overrides to produce a table-less layout for faster, smoother, and semantically correct markup. To see how it&#039;s done, locate your Joomla! installation&#039;s &amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt; directory, and you&#039;ll notice the Beez template. Inside the Beez template directory, you&#039;ll find a directory named &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; (the entire directory structure is as follows: &amp;lt;code&amp;gt;/your_joomla/templates/Beez/html/&amp;lt;/code&amp;gt;).  If you want to try modifying the overrides used in Beez, you could simply copy and paste the Beez &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; directory into your own template&#039;s main directory. &lt;br /&gt;
&lt;br /&gt;
However you choose to make your override files, you will need to ensure that they are correctly installed with your template.  To do this, you should add the following code to your template&#039;s &amp;lt;code&amp;gt;templateDetails.xml&amp;lt;/code&amp;gt; file (in between the &amp;lt;code&amp;gt;&amp;lt;files&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;/files&amp;gt;&amp;lt;/code&amp;gt; tags):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;folder&amp;gt;html&amp;lt;/folder&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code in essence lets the Joomla! [[Installer|package installer]] know that there are files to extract, and that they are part of the template as a whole.&lt;br /&gt;
&lt;br /&gt;
===Further tips===&lt;br /&gt;
Template overrides are almost limitless. They allow you to add, edit, and remove the components of the Joomla! core output. &lt;br /&gt;
Note: For the FireFox web browser, an extension is available called [https://addons.mozilla.org/en-US/firefox/addon/1843 Firebug], which is useful for browsing a page&#039;s HTML source and matching it up with the PHP code used in template overrides.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:How_to_override_the_output_from_the_Joomla!_core&amp;diff=7309</id>
		<title>Archived:How to override the output from the Joomla! core</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:How_to_override_the_output_from_the_Joomla!_core&amp;diff=7309"/>
		<updated>2008-05-23T19:09:25Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Tidied up text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
There may be occasions where you would like to change the way a Joomla! Extension (such as a Component or Module, whether from the Joomla! core or produced by a third party) is displayed on your site.  Of course, you could recode the Extension from scratch, but that may be a bit ambitious for you! Thankfully, there is another way.  &lt;br /&gt;
&lt;br /&gt;
The standard output from any Joomla! Module or Component can be overridden by adding code to the &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; directory of your template. It is also possible to override two aspects of core functionality: Module chrome, and pagination.&lt;br /&gt;
&lt;br /&gt;
=== Getting a head-start with overrides ===&lt;br /&gt;
If you are new to Joomla! development, then it is probably easiest to start with an existing view, and try modifying it to get what you want.  To do this, you should make a copy of the existing view in the &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; directory of your template, and then modify the copy.  The directory structure you need is &amp;lt;code&amp;gt;TEMPLATE_NAME/html/EXTENSION_NAME/VIEW_NAME/FILE_NAME.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to change the way that the &#039;&amp;lt;code&amp;gt;Article&amp;lt;/code&amp;gt;&#039; view displays a &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; article, then you should copy the file at &amp;lt;code&amp;gt;PATH_TO_JOOMLA/components/com_content/views/article/tmpl/default.php&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TEMPLATE_NAME/html/com_content/article/default.php&amp;lt;/code&amp;gt; (note the slight difference in directory structure).  Similarly, if you want to change how the &amp;lt;code&amp;gt;mod_login&amp;lt;/code&amp;gt; Module is displayed, then you should copy &amp;lt;code&amp;gt;PATH_TO_JOOMLA/modules/mod_login/tmpl/default.php&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TEMPLATE_NAME/html/mod_login/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Joomla! comes pre-packaged with a frontend template called [[Beez]]. Beez utilizes template overrides to produce a table-less layout for faster, smoother, and semantically correct markup. To see how it&#039;s done, locate your Joomla! installation&#039;s &amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt; directory, and you&#039;ll notice the Beez template. Inside the Beez template directory, you&#039;ll find a directory named &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; (the entire directory structure is as follows: &amp;lt;code&amp;gt;/your_joomla/templates/Beez/html/&amp;lt;/code&amp;gt;).  If you want to try modifying the overrides used in Beez, you could simply copy and paste the Beez &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; directory into your own template&#039;s main directory. &lt;br /&gt;
&lt;br /&gt;
However you choose to make your override files, you will need to ensure that they are correctly installed with your template.  To do this, you should add the following code to your template&#039;s &amp;lt;code&amp;gt;templateDetails.xml&amp;lt;/code&amp;gt; file (in between the &amp;lt;code&amp;gt;&amp;lt;files&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;/files&amp;gt;&amp;lt;/code&amp;gt; tags):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;folder&amp;gt;html&amp;lt;/folder&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code in essence lets the Joomla! [[Installer|package installer]] know that there are files to extract, and that they are part of the template as a whole.&lt;br /&gt;
&lt;br /&gt;
==Further tips==&lt;br /&gt;
Template overrides are almost limitless. They allow you to add, edit, and remove the components of the Joomla! core output. &lt;br /&gt;
Note: For the FireFox web browser, an extension is available called [https://addons.mozilla.org/en-US/firefox/addon/1843 Firebug], which is useful for browsing a page&#039;s HTML source and matching it up with the PHP code used in template overrides.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:How_to_override_the_output_from_the_Joomla!_core&amp;diff=7288</id>
		<title>Archived:How to override the output from the Joomla! core</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:How_to_override_the_output_from_the_Joomla!_core&amp;diff=7288"/>
		<updated>2008-05-22T22:02:30Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Expanded article and included more generic info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
There may be occasions where you would like to change the way a Joomla! Extension (such as a Component or Module, whether from the Joomla! core or produced by a third party) is displayed on your site.  Of course, you could recode the Extension from scratch, but that may be a bit ambitious for you! Thankfully, there is another way.  &lt;br /&gt;
&lt;br /&gt;
The standard output from any Joomla! Module or Component can be overridden by adding code to the &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; directory of your template. It is also possible to override two aspects of core functionality: Module chrome, and pagination.&lt;br /&gt;
&lt;br /&gt;
=== Getting a head-start with overrides ===&lt;br /&gt;
If you are new to Joomla! development, then it is probably easiest to start with an existing view, and try modifying it to get what you want.  To do this, you should make a copy of the existing view in the &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; directory of your template, and then modify the copy.  The directory structure you need is &amp;lt;code&amp;gt;TEMPLATE_NAME/html/EXTENSION_NAME/VIEW_NAME/FILE_NAME.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to change the way that the &#039;&amp;lt;code&amp;gt;Article&amp;lt;/code&amp;gt;&#039; view displays a &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; article, then you should copy the file at &amp;lt;code&amp;gt;PATH_TO_JOOMLA/components/com_content/views/article/tmpl/default.php&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TEMPLATE_NAME/html/com_content/article/default.php&amp;lt;/code&amp;gt; (note the slight difference in directory structure).  Similarly, if you want to change how the &amp;lt;code&amp;gt;mod_login&amp;lt;/code&amp;gt; Module is displayed, then you should copy &amp;lt;code&amp;gt;PATH_TO_JOOMLA/modules/mod_login/tmpl/default.php&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TEMPLATE_NAME/html/mod_login/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Joomla! comes pre-packaged with a frontend template called [[Beez]]. Beez utilizes template overrides to produce a table-less layout for faster, smoother, and semantically correct markup. To add the table-less layout to your template, locate your Joomla! installation&#039;s template directory, and you&#039;ll notice the Beez template. Inside the Beez template directory, copy the folder titled &amp;lt;code&amp;gt;html&amp;lt;/code&amp;gt; (the entire directory structure is as follows: &amp;lt;code&amp;gt;/your_joomla/templates/Beez/html/&amp;lt;/code&amp;gt;) and paste the html folder into your template&#039;s main directory. After copying Beez&#039;s html folder to your template, you must add the following code to your template&#039;s &amp;lt;code&amp;gt;templateDetails.xml&amp;lt;/code&amp;gt; file (in between the &amp;lt;code&amp;gt;&amp;lt;files&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;/files&amp;gt;&amp;lt;/code&amp;gt; tags):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_contact/category/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_contact/category/default_items.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_contact/category/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_contact/contact/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_contact/contact/default_address.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_contact/contact/default_form.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_contact/contact/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_contact/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/article/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/article/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/article/form.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/category/blog.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/category/blog_item.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/category/blog_links.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/category/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/category/default_items.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/category/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/frontpage/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/frontpage/default_item.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/frontpage/default_links.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/frontpage/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/section/blog.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/section/blog_item.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/section/blog_links.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/section/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/section/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_content/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_search/search/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_search/search/default_error.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_search/search/default_form.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_search/search/default_results.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_search/search/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_search/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/editor_content.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_latestnews/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_latestnews/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_login/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_login/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_newsflash/_item.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_newsflash/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_newsflash/horiz.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_newsflash/vert.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_newsflash/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_poll/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_poll/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_search/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/mod_search/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/modules.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/pagination.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_poll/poll/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_poll/poll/default_graph.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_poll/poll/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_poll/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_newsfeeds/categories/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_newsfeeds/categories/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_newsfeeds/category/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_newsfeeds/category/default_items.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_newsfeeds/category/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_newsfeeds/newsfeed/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_newsfeeds/newsfeed/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_newsfeeds/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_weblinks/categories/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_weblinks/categories/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_weblinks/category/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_weblinks/category/default_items.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_weblinks/category/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_weblinks/weblinks/form.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_weblinks/weblinks/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_weblinks/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/user/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/user/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/user/form.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/login/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/login/default_login.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/login/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/login/default_logout.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/register/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/register/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/register/default_message.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/remind/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/remind/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/remind/default_message.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/reset/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/reset/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/reset/confirm.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;html/com_user/reset/complete.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code in essence lets the Joomla! [[Installer|package installer]] know that there are files to extract, and that they are part of the template as a whole.&lt;br /&gt;
&lt;br /&gt;
==Complex Overrides==&lt;br /&gt;
Template overrides are almost limitless. They allow you to add, edit, and remove the components of the Joomla! core output. &lt;br /&gt;
*Note: For the FireFox web browser, an extension is available called [https://addons.mozilla.org/en-US/firefox/addon/1843 Firebug], which is useful for browsing a page&#039;s HTML source and matching it up with the PHP code used in template overrides.&lt;br /&gt;
&lt;br /&gt;
===Which File To Edit===&lt;br /&gt;
Here is a list of very important and commonly used files for editing purposes:&lt;br /&gt;
*&amp;lt;code&amp;gt;html/com_content/frontpage/default.php&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detail to follow&lt;br /&gt;
[[Category:Templates]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7287</id>
		<title>Counting modules in a given module position</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7287"/>
		<updated>2008-05-22T21:25:39Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;== Counting Modules in a given Module position ==&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
The countModules function can be used within a template to determine the number of Modules enabled in a given Module position.  This is commonly used to include Modules in a certain position only if at least one Module is enabled for that position.  This prevents empty regions from being defined in the template output.&lt;br /&gt;
&lt;br /&gt;
For example, the following code includes Modules in the &#039;user1&#039; position only if at least one Module is enabled for that position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
  &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;rounded&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Intermediate]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:Topics]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Applying_custom_module_chrome&amp;diff=7286</id>
		<title>Applying custom module chrome</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Applying_custom_module_chrome&amp;diff=7286"/>
		<updated>2008-05-22T21:22:19Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;==Applying custom Module chrome==&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
To define custom Module chrome in your template you need to create a file called modules.php in your template html directory.  For example, this might be PATH_TO_JOOMLA/templates/TEMPLATE_NAME/html/modules.php.&lt;br /&gt;
&lt;br /&gt;
In this file you should define a function called &amp;lt;code&amp;gt;modChrome_STYLE&amp;lt;/code&amp;gt; where &#039;&amp;lt;code&amp;gt;STYLE&amp;lt;/code&amp;gt;&#039; is the name of your custom Module chrome.  This function will take three arguments, &amp;lt;code&amp;gt;$module&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;$params&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;amp;$attribs&amp;lt;/code&amp;gt;, as shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
  function modChrome_STYLE( $module, &amp;amp;$params, &amp;amp;$attribs ) &lt;br /&gt;
  {&lt;br /&gt;
    /* chromed Module output goes here */&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within this function you can make use of any of the available Module properties (i.e. the fields in the &amp;lt;code&amp;gt;jos_modules&amp;lt;/code&amp;gt; table in the Joomla! database on your server) for that Module, but the main ones you are likely to need are &amp;lt;code&amp;gt;$module-&amp;gt;content&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$module-&amp;gt;showtitle&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$module-&amp;gt;title&amp;lt;/code&amp;gt;.  &amp;lt;code&amp;gt;$module-&amp;gt;showtitle&amp;lt;/code&amp;gt; is a Boolean variable, so is either &#039;&#039;true&#039;&#039; (when the Module title &#039;&#039;&#039;should&#039;&#039;&#039; be shown) or &#039;&#039;false&#039;&#039; (when it &#039;&#039;&#039;shouldn&#039;t&#039;&#039;&#039; be shown). &amp;lt;code&amp;gt;$module-&amp;gt;content&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$module-&amp;gt;title&amp;lt;/code&amp;gt; will return the main Module content and the Module title respectively.&lt;br /&gt;
&lt;br /&gt;
The function is a normal PHP function and so can use any regular PHP code.  One common example is to use an &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statement to check the value of &amp;lt;code&amp;gt;$module-&amp;gt;showtitle&amp;lt;/code&amp;gt;, and then include the title or not accordingly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  if ($module-&amp;gt;showtitle) &lt;br /&gt;
  {&lt;br /&gt;
    echo &#039;&amp;lt;h2&amp;gt;&#039; .$module-&amp;gt;title .&#039;&amp;lt;/h2&amp;gt;&#039;;&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Module parameters are accessed using the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object.  For example, it is possible to assign a &#039;&#039;Module class suffix&#039;&#039; to a Module in the backend of your Joomla! site; this is then stored in the parameters for that Module as &amp;lt;code&amp;gt;moduleclass_sfx&amp;lt;/code&amp;gt;.  To create a &amp;lt;code&amp;gt;&amp;amp;lt;div&amp;amp;gt;&amp;lt;/code&amp;gt; with  a &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; determined by the Module class suffix, you would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;&amp;lt;?php echo $params-&amp;gt;get( &#039;moduleclass_sfx&#039; ); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- div contents --&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Custom chrome attributes ===&lt;br /&gt;
It is also possible to pass further attributes into the Module chrome function using the same &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; statement that sets the Module chrome. These additional attributes can be anything you like, and are stored in the &amp;lt;code&amp;gt;$attribs&amp;lt;/code&amp;gt; array.  Take the following example Module chrome function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  function modChrome_custom( $module, &amp;amp;$params, &amp;amp;$attribs ) {&lt;br /&gt;
    if (isset( $attribs[&#039;headerLevel&#039;] )) &lt;br /&gt;
    {&lt;br /&gt;
      $headerLevel = $attribs[&#039;headerLevel&#039;];&lt;br /&gt;
    } else {&lt;br /&gt;
      $headerLevel = 3;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (isset( $attribs[&#039;background&#039;] )) &lt;br /&gt;
    {&lt;br /&gt;
      $background = $attribs[&#039;background&#039;];&lt;br /&gt;
    } else {&lt;br /&gt;
      $background = &#039;blue&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    echo &#039;&amp;lt;div class=&amp;quot;&#039; .$params-&amp;gt;get( &#039;moduleclass_sfx&#039; ) .&#039;&amp;quot; &amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
    if ($module-&amp;gt;showtitle) &lt;br /&gt;
    {&lt;br /&gt;
      echo &#039;&amp;lt;h&#039; .$headerLevel .&#039;&amp;gt;&#039; .$module-&amp;gt;title .&#039;&amp;lt;/h&#039; .$headerLevel .&#039;&amp;gt;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    echo &#039;&amp;lt;div class=&amp;quot;&#039; .$background .&#039;&amp;quot;&amp;gt;&#039;;&lt;br /&gt;
    echo $module-&amp;gt;content;&lt;br /&gt;
    echo &#039;&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
    echo &#039;&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You would then set the values for &amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;headerLevel&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; statement as shown below.  If no values are set, the attributes default to &#039;blue&#039; and &#039;3&#039; respectively.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Passing attributes to Module chrome from &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; statement&lt;br /&gt;
! Output&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;&amp;lt;!-- Module title --&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;div class=&amp;quot;blue&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Module content --&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; background=&amp;quot;green&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;&amp;lt;!-- Module title --&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;div class=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Module content --&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; headerLevel=&amp;quot;1&amp;quot; background=&amp;quot;yellow&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;h1&amp;gt;&amp;lt;!-- Module title --&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;div class=&amp;quot;yellow&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Module content --&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Further information about passing attributes to Module chrome can be found in [[jtopic:115953]].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Advanced]]&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:Topics]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Module_chrome&amp;diff=7285</id>
		<title>Module chrome</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Module_chrome&amp;diff=7285"/>
		<updated>2008-05-22T21:05:57Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;==What is Module chrome?==&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Module chrome allows template designers to have a certain amount of control over the way the output from a Module is displayed in their template.  Essentially, it consists of a small amount of predefined HTML which is inserted before, after, or around the output from each module, and which can then be styled using CSS.  Module chrome is commonly used to provide borders around modules, especially with rounded corners, but it can be used for much more than that.&lt;br /&gt;
&lt;br /&gt;
Module chrome is determined by using the &#039;&amp;lt;tt&amp;gt;style&amp;lt;/tt&amp;gt;&#039; attribute in the statement calling the module.  For example, the following statement is used the &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; file of a template to insert the Modules in the &#039;&amp;lt;tt&amp;gt;user1&amp;lt;/tt&amp;gt;&#039; position and apply the &#039;&amp;lt;tt&amp;gt;custom&amp;lt;/tt&amp;gt;&#039; Module chrome:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;custom&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It can be seen that the same Module chrome is applied to every Module in that position - in other words, if you want to have two Modules in a column, but want them to have different Module chrome, then they would need to be set up as two different &#039;positions&#039; (e.g. &#039;&amp;lt;tt&amp;gt;user1&amp;lt;/tt&amp;gt;&#039; and &#039;&amp;lt;tt&amp;gt;user2&amp;lt;/tt&amp;gt;&#039;).&lt;br /&gt;
&lt;br /&gt;
The standard Joomla! 1.5 package includes six default Module chrome styles.  However, the flexibility of the template system means that you are not limited to these styles - it&#039;s very easy to create as many new styles as you want!&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Comparison of the Joomla! 1.5 standard Module chromes&#039;&#039;&#039;&lt;br /&gt;
!Style&lt;br /&gt;
!Output&lt;br /&gt;
!width=&amp;quot;204&amp;quot; | Appearance&lt;br /&gt;
|-&lt;br /&gt;
!rounded&amp;lt;br /&amp;gt;(default for menus on milkyway)&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;module_menu&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
      &amp;lt;div&amp;gt;&lt;br /&gt;
        &amp;lt;h3&amp;gt;Main Menu&amp;lt;/h3&amp;gt;&lt;br /&gt;
        &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;/ul&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_rounded.png]]&lt;br /&gt;
|-&lt;br /&gt;
!none&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_none.png]]&lt;br /&gt;
|-&lt;br /&gt;
!table&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;moduletable_menu&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th valign=&amp;quot;top&amp;quot;&amp;gt;Main Menu&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_table.png]]&lt;br /&gt;
|-&lt;br /&gt;
!horz&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;1&amp;quot; cellpadding=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;table cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; class=&amp;quot;moduletable_menu&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;th valign=&amp;quot;top&amp;quot;&amp;gt;Main Menu&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;/ul&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;/table&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_horz.png]]&lt;br /&gt;
|-&lt;br /&gt;
!xhtml&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;moduletable_menu&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;Main Menu&amp;lt;/h3&amp;gt;&lt;br /&gt;
  &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_xhtml.png]]&lt;br /&gt;
|-&lt;br /&gt;
!outline&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mod-preview&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;mod-preview-info&amp;quot;&amp;gt;left[outline]&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;mod-preview-wrapper&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;ul class=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;!-- various menu items --&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[Image:Module_chrome_outline.png]]&lt;br /&gt;
|}&lt;br /&gt;
Note that the Module chrome doesn&#039;t necessarily change the appearance all that much - this depends on the CSS used in the template. For example, the &#039;&amp;lt;tt&amp;gt;none&amp;lt;/tt&amp;gt;&#039; and &#039;&amp;lt;tt&amp;gt;horz&amp;lt;/tt&amp;gt;&#039; chromes look very similar, although the underlying HTML code is very different.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Advanced|Chrome]]&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
[[Category:Templates|Chrome]]&lt;br /&gt;
[[Category:Topics]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Collapsing_columns&amp;diff=7283</id>
		<title>Collapsing columns</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Collapsing_columns&amp;diff=7283"/>
		<updated>2008-05-22T21:01:46Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;==Collapsing columns==&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A common requirement when designing web pages in Joomla! is for a Module position to be removed when no Modules are enabled in that position so that the space is available for other page elements.  The region removed is referred to as a  &amp;quot;collapsed column&amp;quot;.  This can be achieved using the &amp;lt;code&amp;gt;countModules&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to include a &amp;quot;&amp;lt;code&amp;gt;user1&amp;lt;/code&amp;gt;&amp;quot; module position only if there are modules enabled in that position, then you could use this code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;user1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; tag and its surrounding &amp;lt;code&amp;gt;&amp;lt;div&amp;gt;&amp;lt;/code&amp;gt; are only included if the &amp;lt;code&amp;gt;countModules&amp;lt;/code&amp;gt; call returns a non-zero value (the PHP &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statement treats zero as being &#039;&#039;&#039;false&#039;&#039;&#039; and any non-zero value as being &#039;&#039;&#039;true&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Sometimes you may want a pair of module positions to collapse either singly or together.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 or user2&#039; )) : ?&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;user1user2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user2&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user2&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Notice how the region (which is styled by the CSS class &amp;quot;&amp;lt;code&amp;gt;user1user2&amp;lt;/code&amp;gt;&amp;quot;) is only output if either &#039;&amp;lt;code&amp;gt;user1&amp;lt;/code&amp;gt;&#039; or &#039;&amp;lt;code&amp;gt;user2&amp;lt;/code&amp;gt;&#039;, &#039;&#039;&#039;or both&#039;&#039;&#039;, have at least one Module enabled.&lt;br /&gt;
&lt;br /&gt;
If you want a divider to separate the two Module positions then you must be careful to only output the divider if &#039;&#039;&#039;both&#039;&#039;&#039; Module positions have Modules enabled in them.  For example,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 or user2&#039; )) : ?&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;user1user2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 and user2&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;div class=&amp;quot;divider&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user2&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user2&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====See also====&lt;br /&gt;
* [[php:if|PHP &#039;&#039;if&#039;&#039; statement]]&lt;br /&gt;
* [[php:else|PHP &#039;&#039;else&#039;&#039; statement]]&lt;br /&gt;
* [[php:elseif|PHP &#039;&#039;elseif&#039;&#039; statement]]&lt;br /&gt;
* [[php:alternative-syntax|Alternative syntax for PHP control structures]]&lt;br /&gt;
* [[Operators for use with the countModules function]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Collapsing_columns&amp;diff=7282</id>
		<title>Collapsing columns</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Collapsing_columns&amp;diff=7282"/>
		<updated>2008-05-22T21:01:02Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Changed formatting, added includeonly title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;==Collapsing columns==&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A common requirement when designing web pages in Joomla! is for a Module position to be removed when no Modules are enabled in that position so that the space is available for other page elements.  The region removed is referred to as a  &amp;quot;collapsed column&amp;quot;.  This can be achieved using the &amp;lt;code&amp;gt;countModules&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to include a &amp;quot;&amp;lt;code&amp;gt;user1&amp;lt;/code&amp;gt;&amp;quot; module position only if there are modules enabled in that position, then you could use this code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;user1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; tag and its surrounding &amp;lt;code&amp;gt;&amp;lt;div&amp;gt;&amp;lt;/code&amp;gt; are only included if the &amp;lt;code&amp;gt;countModules&amp;lt;/code&amp;gt; call returns a non-zero value (the PHP &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statement treats zero as being &#039;&#039;&#039;false&#039;&#039;&#039; and any non-zero value as being &#039;&#039;&#039;true&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Sometimes you may want a pair of module positions to collapse either singly or together.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 or user2&#039; )) : ?&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;user1user2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user2&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user2&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Notice how the region (which is styled by the CSS class &amp;quot;&amp;lt;code&amp;gt;user1user2&amp;lt;/code&amp;gt;&amp;quot;) is only output if either &#039;&amp;lt;code&amp;gt;user1&amp;lt;/code&amp;gt;&#039; or &#039;&amp;lt;code&amp;gt;user2&amp;lt;/code&amp;gt;&#039;, &#039;&#039;&#039;or both&#039;&#039;&#039; have at least one Module enabled.&lt;br /&gt;
&lt;br /&gt;
If you want a divider to separate the two Module positions then you must be careful to only output the divider if &#039;&#039;&#039;both&#039;&#039;&#039; Module positions have Modules enabled in them.  For example,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 or user2&#039; )) : ?&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;user1user2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 and user2&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;div class=&amp;quot;divider&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user2&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user2&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====See also====&lt;br /&gt;
* [[php:if|PHP &#039;&#039;if&#039;&#039; statement]]&lt;br /&gt;
* [[php:else|PHP &#039;&#039;else&#039;&#039; statement]]&lt;br /&gt;
* [[php:elseif|PHP &#039;&#039;elseif&#039;&#039; statement]]&lt;br /&gt;
* [[php:alternative-syntax|Alternative syntax for PHP control structures]]&lt;br /&gt;
* [[Operators for use with the countModules function]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Customising_the_way_modules_are_displayed&amp;diff=7281</id>
		<title>Customising the way modules are displayed</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Customising_the_way_modules_are_displayed&amp;diff=7281"/>
		<updated>2008-05-22T20:53:56Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{{:Counting modules in a given module position|Counting modules in a given module position}}&lt;br /&gt;
&lt;br /&gt;
{{:Counting modules in multiple module positions|Counting modules in multiple module positions}}&lt;br /&gt;
&lt;br /&gt;
{{:Collapsing columns|Collapsing columns}}&lt;br /&gt;
&lt;br /&gt;
{{:Creating rounded corners|Creating rounded corners}}&lt;br /&gt;
&lt;br /&gt;
{{:What is module chrome?|What is module chrome?}}&lt;br /&gt;
&lt;br /&gt;
{{:Applying custom module chrome|Applying custom module chrome}}&lt;br /&gt;
&lt;br /&gt;
{{:Cascading module chrome styles|Cascading module chrome styles}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Modules]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7280</id>
		<title>Counting modules in a given module position</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7280"/>
		<updated>2008-05-22T19:13:50Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;== Counting Modules in a given Module position ==&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
The countModules function can be used within a template to determine the number of Modules enabled in a given Module position.  This is commonly used to include Modules in a certain position only if at least one Module is enabled for that position.  This prevents empty regions from being defined in the template output.&lt;br /&gt;
&lt;br /&gt;
For example, the following code includes Modules in the &#039;user1&#039; position only if at least one Module is enabled for that position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
  &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;rounded&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Intermediate]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Topics]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_multiple_module_positions&amp;diff=7279</id>
		<title>Counting modules in multiple module positions</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_multiple_module_positions&amp;diff=7279"/>
		<updated>2008-05-22T19:13:04Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;== Counting Modules in multiple Module positions ==&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
The countModules function can be used to determine the number of Modules in more than one Module position.  More advanced calculations can also be performed.&lt;br /&gt;
&lt;br /&gt;
The argument to the countModules function is normally just the name of a single Module position.  The function will return the number of Modules currently enabled for that Module position.  But you can also do simple logical and arithmetic operations on two or more Module positions.&lt;br /&gt;
&lt;br /&gt;
For example, to determine the total number of Modules enabled in the &#039;&amp;lt;code&amp;gt;user1&amp;lt;/code&amp;gt;&#039; and &#039;&amp;lt;code&amp;gt;user2&amp;lt;/code&amp;gt;&#039; positions together, you can use the function call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;countModules( &#039;user1 + user2&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although the usual arithmetic operators, +. -. *, / will work as expected, these are not as useful as the logical operators &#039;and&#039; and &#039;or&#039;.&lt;br /&gt;
&lt;br /&gt;
For example, to determine if the &#039;user1&#039; position and the &#039;user2&#039; position both have at least one Module enabled, you can use the function call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;countModules( &#039;user1 and user2&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Careful: A common mistake is to try something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;countModules( &#039;user1&#039; and &#039;user2&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Intermediate]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:Topics]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is pretty much guaranteed to always return false regardless of the number of Modules enabled in either position, so check what you are passing to countModules carefully.&lt;br /&gt;
&lt;br /&gt;
You must have exactly one space character separating each item in the string.  For example, &#039;user1+user2&#039; will not produce the desired result as there must be a space character either side of the &#039;+&#039; sign.  Also, &#039;user1  +  user2&#039; will produce a PHP error message as there is more than one space separating each element.&lt;br /&gt;
&lt;br /&gt;
Example: The user1 and user2 Module positions are to be displayed in the region, but you want the region to not appear at all if no Modules are enabled in either position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 or user2&#039; )) : ?&amp;gt;&lt;br /&gt;
	&amp;lt;div class=&amp;quot;rightcolumn&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user2&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: The user1 and user2 Module positions are to be displayed side-by-side with a separator between them.  However, if only one of the Module positions has any Modules enabled then the separator is not needed.  Furthermore, if neither user1 or user2 has any Modules enabled then nothing is output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 or user2&#039; )) : ?&amp;gt;&lt;br /&gt;
	&amp;lt;div class=&amp;quot;user1user2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
			&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 and user2&#039; )) : ?&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&amp;quot;greyline&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user2&#039; )) : ?&amp;gt;&lt;br /&gt;
			&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user2&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how the first countModules call determines if there any Modules to display at all.  The second determines if there are any in the &#039;user1&#039; position and if there are it displays them.  The third call determines if both user1 and user2 positions have any Modules enabled and if they do then if provides a separator between them.  Finally, the fourth call determines if there are any enabled Modules in the &#039;user2&#039; position and displays them if there are any.&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7278</id>
		<title>Counting modules in a given module position</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7278"/>
		<updated>2008-05-22T19:09:37Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;=== Counting Modules in a given Module position ===&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
The countModules function can be used within a template to determine the number of Modules enabled in a given Module position.  This is commonly used to include Modules in a certain position only if at least one Module is enabled for that position.  This prevents empty regions from being defined in the template output.&lt;br /&gt;
&lt;br /&gt;
For example, the following code includes Modules in the &#039;user1&#039; position only if at least one Module is enabled for that position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
  &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;rounded&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Intermediate]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Topics]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7277</id>
		<title>Counting modules in a given module position</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7277"/>
		<updated>2008-05-22T19:08:27Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;=== Counting Modules in a given Module position ===&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
The countModules function can be used within a template to determine the number of Modules enabled in a given Module position.  This is commonly used to include Modules in a certain position only if at least one Module is enabled for that position.  This prevents empty regions from being defined in the template output.&lt;br /&gt;
&lt;br /&gt;
For example, the following code includes Modules in the &#039;user1&#039; position only if at least one Module is enabled for that position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;rounded&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Intermediate]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Topics]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7276</id>
		<title>Counting modules in a given module position</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7276"/>
		<updated>2008-05-22T19:07:46Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: /* Counting Modules in a given Module position */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;=== Counting Modules in a given Module position ===&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The countModules function can be used within a template to determine the number of Modules enabled in a given Module position.  This is commonly used to include Modules in a certain position only if at least one Module is enabled for that position.  This prevents empty regions from being defined in the template output.&lt;br /&gt;
&lt;br /&gt;
For example, the following code includes Modules in the &#039;user1&#039; position only if at least one Module is enabled for that position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;rounded&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Intermediate]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Topics]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7275</id>
		<title>Counting modules in a given module position</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Counting_modules_in_a_given_module_position&amp;diff=7275"/>
		<updated>2008-05-22T18:52:18Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Counting Modules in a given Module position ===&lt;br /&gt;
&lt;br /&gt;
The countModules function can be used within a template to determine the number of Modules enabled in a given Module position.  This is commonly used to include Modules in a certain position only if at least one Module is enabled for that position.  This prevents empty regions from being defined in the template output.&lt;br /&gt;
&lt;br /&gt;
For example, the following code includes Modules in the &#039;user1&#039; position only if at least one Module is enabled for that position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;rounded&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Intermediate]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Topics]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Collapsing_columns&amp;diff=7274</id>
		<title>Collapsing columns</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Collapsing_columns&amp;diff=7274"/>
		<updated>2008-05-22T18:49:02Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A common requirement when designing web pages in Joomla! is for a module position to be removed when no modules are enabled in that position so that the space is available for other page elements.  The region removed is referred to as a  &amp;quot;collapsed column&amp;quot;.  This can be achieved using the &#039;&#039;countModules&#039;&#039; function.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to include a &amp;quot;user1&amp;quot; module position only if there are modules enabled in that position, then you could use this code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;div class=&amp;quot;user1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Notice that the &#039;&#039;jdoc:include&#039;&#039; tag &#039;&#039;&#039;and its surrounding divs&#039;&#039;&#039; are only included if the &#039;&#039;countModules&#039;&#039; call returns a non-zero value (the PHP &#039;&#039;if&#039;&#039; statement treats zero as being &#039;&#039;&#039;false&#039;&#039;&#039; and any non-zero value as being &#039;&#039;&#039;true&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Sometimes you may want a pair of module positions to collapse either singly or together.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 or user2&#039; )) : ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;div class=&amp;quot;user1user2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user2&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user2&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Notice how the region (which is styled by the CSS class &amp;quot;user1user2&amp;quot;) is only output if &#039;&#039;user1&#039;&#039; or &#039;&#039;user2&#039;&#039; &#039;&#039;&#039;or both&#039;&#039;&#039; have at least one module enabled.&lt;br /&gt;
&lt;br /&gt;
If you want a divider to separate the two module positions then you must be careful to only output the divider if &#039;&#039;&#039;both&#039;&#039;&#039; module positions have modules enabled in them.  For example,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 or user2&#039; )) : ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;div class=&amp;quot;user1user2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user1 and user2&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;div class=&amp;quot;divider&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php if ($this-&amp;gt;countModules( &#039;user2&#039; )) : ?&amp;gt;&lt;br /&gt;
      &amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user2&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
====See also====&lt;br /&gt;
* [[php:if|PHP &#039;&#039;if&#039;&#039; statement]]&lt;br /&gt;
* [[php:else|PHP &#039;&#039;else&#039;&#039; statement]]&lt;br /&gt;
* [[php:elseif|PHP &#039;&#039;elseif&#039;&#039; statement]]&lt;br /&gt;
* [[php:alternative-syntax|Alternative syntax for PHP control structures]]&lt;br /&gt;
* [[Operators for use with the countModules function]]&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7267</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7267"/>
		<updated>2008-05-20T22:34:40Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: /* 2. Menu item specific parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using parameters with a component=&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - backend==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field reading &#039;font_size=16\n&#039;:&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; parameter value.&lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the component.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view.  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  In addition, you can also choose to override the component-wide default parameters defined as above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; view output template (not to be confused with the site Template, which is different!) directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (at least when viewed using the default Khepri backend site Template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows the menu admin page for the Category &#039;List&#039; layout.  You can see that the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane is open, and contains form elements for five parameters.  There are no &#039;Advanced&#039; parameters for this view, and so the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane is not shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu items edit.png]]&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any &amp;lt;code&amp;gt;&amp;lt;param type=&amp;quot;radio&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt; parameter is shown not as a radio button form field, but by a drop-down list.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is set as the default option for the list.  Thus, by default, these parameters will use the component-wide default values, rather than overriding them.  (However, note that any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value, and so will override the component-wide default value if that is different).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7266</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7266"/>
		<updated>2008-05-20T22:17:28Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: /* 1. Component-wide default parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using parameters with a component=&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - backend==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These can be created at installation of the component, by including &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the installation XML file (typically called COMPONENT_NAME.xml, and located in the root folder of the component package.  As far as the parameters are concerned, this XML file has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will create a line in the parameters field reading &#039;font_size=16\n&#039;:&lt;br /&gt;
    &amp;lt;param name=&amp;quot;font_size&amp;quot; default=&amp;quot;16&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; element must be given the attributes &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, which define the parameter name and value respectively.  These values are then copied to the jos_components table in the database.&lt;br /&gt;
&lt;br /&gt;
However, on its own this is not very useful, as it doesn&#039;t allow users to change the values of the parameters.  To do this, parameter form elements need to be defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;!-- Example: the following will produce a text box 3 characters wide with the label &#039;Font size:&#039;.  When the user hovers the mouse over the label, a tooltip will pop up which states &#039;Please enter the required font size&#039;.  On saving, a value entered into the text box will be saved as the &#039;font_size&#039; parameter value.&lt;br /&gt;
    &amp;lt;param type=&amp;quot;text&amp;quot; name=&amp;quot;font_size&amp;quot; size=&amp;quot;3&amp;quot; label=&amp;quot;Font size:&amp;quot; description=&amp;quot;Please enter the required font size&amp;quot; /&amp;gt;&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.  It is not currently possible to group certain parameter form elements together.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to define &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; attributes for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, since the default values will already have been saved in the installation of the component.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view (usually for a particular component item).  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  You can also choose to override the component-wide default parameters as mentioned above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; template directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (in the default Kepri backend template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any radio button form fields are replaced by drop-down lists.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is the default option for the list.&lt;br /&gt;
* Any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value (unlike the drop-down lists).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7264</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7264"/>
		<updated>2008-05-20T21:52:43Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: /* Storing the parameters and their values. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using parameters with a component=&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;&amp;lt;code&amp;gt;/n&amp;lt;/code&amp;gt;&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  Typically, a parameter will be given no value where it is set up to allow override of a default value, but &#039;no override is required&#039; - i.e. it is desired to use the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - backend==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is possible to define default values for each of these parameters in the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; statements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file.  However, in order to save these default values to the database, a user would need to click on the &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button (at which point any field not having a pre-saved value will be given the default value), and then click the &#039;Save&#039; button.  Since you won&#039;t want to rely on your users doing this before using the component, Joomla! 1.5 allows you define default values for the component parameters, to be saved to the database on installation.  These default values are set in the installation XML file (typically called &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt;), which has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Although the structure of these &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements is superficially similar to those from the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, you should note that the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements from the install file are never used to produce form fields.  There is therefore no benefit to setting the types of parameter.  The only attributes required for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements are the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values - it is these values which will be copied to the database on installation.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view (usually for a particular component item).  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  You can also choose to override the component-wide default parameters as mentioned above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; template directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (in the default Kepri backend template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any radio button form fields are replaced by drop-down lists.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is the default option for the list.&lt;br /&gt;
* Any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value (unlike the drop-down lists).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7263</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=7263"/>
		<updated>2008-05-20T21:36:50Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using parameters with a component=&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. Modules and Plugins) is the ability to store significant quantities of data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles associated with the &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt; component are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly how to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;/n&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  If these parameters were set up as overrides, parameter2 would show the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - backend==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is possible to define default values for each of these parameters in the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; statements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file.  However, in order to save these default values to the database, a user would need to click on the &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button (at which point any field not having a pre-saved value will be given the default value), and then click the &#039;Save&#039; button.  Since you won&#039;t want to rely on your users doing this before using the component, Joomla! 1.5 allows you define default values for the component parameters, to be saved to the database on installation.  These default values are set in the installation XML file (typically called &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt;), which has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Although the structure of these &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements is superficially similar to those from the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, you should note that the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements from the install file are never used to produce form fields.  There is therefore no benefit to setting the types of parameter.  The only attributes required for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements are the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values - it is these values which will be copied to the database on installation.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view (usually for a particular component item).  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  You can also choose to override the component-wide default parameters as mentioned above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; template directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (in the default Kepri backend template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any radio button form fields are replaced by drop-down lists.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is the default option for the list.&lt;br /&gt;
* Any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value (unlike the drop-down lists).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Jdoc_statements&amp;diff=5541</id>
		<title>Jdoc statements</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Jdoc_statements&amp;diff=5541"/>
		<updated>2008-04-28T19:27:00Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: Minor formatting changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:jdoc statements}}&lt;br /&gt;
== jdoc:include ==&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; statement is a Joomla! template&#039;s method of displaying content specific to the page being viewed. There are various &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; statements, each returning a different part of a Joomla! page.&lt;br /&gt;
&lt;br /&gt;
== The type attribute ==&lt;br /&gt;
The &amp;lt;tt&amp;gt;type&amp;lt;/tt&amp;gt; attribute specifies the type of content to be rendered in place of the &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; element. For example, the &amp;lt;code&amp;gt;&amp;lt;jdoc:include &#039;&#039;&#039;&#039;&#039;type=&amp;quot;head&amp;quot;&#039;&#039;&#039;&#039;&#039; /&amp;gt;&amp;lt;/code&amp;gt; statement uses the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; attribute &amp;lt;code&amp;gt;head&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;type=&amp;quot;head&amp;quot;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Component ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;component&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This element should only appear once in the &amp;lt;body&amp;gt; element of the Template to render the main content of the page with respect to the current page being viewed.&lt;br /&gt;
&lt;br /&gt;
=== Head ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;head&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This element should only appear once in the &amp;lt;head&amp;gt; element of the Template to render the content of the style, script and meta elements associated with the current page.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;installation&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This element is only used within the Joomla! Installer template and of no particular use in a Front-end or Back-end template. It&#039;s somewhat the equivalent to the &#039;component&#039; type, rendering the main content of an installation step.&lt;br /&gt;
&lt;br /&gt;
=== Message ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;message&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This element should only appear once in the &amp;lt;body&amp;gt; element of the Template to render system and error messages that occurred in the request.&lt;br /&gt;
&lt;br /&gt;
=== Module ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;module&amp;quot; name=&amp;quot;breadcrumbs&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;module&amp;quot; name=&amp;quot;menu&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;module&amp;quot; name=&amp;quot;submenu&amp;quot; style=&amp;quot;rounded&amp;quot; id=&amp;quot;submenu-box&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This element renders a single module given by the &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute. The module in question must be published and accessible by the current user in order to become visible. Additional attributes can be provided to control the layout and appearance of the module, if supported.&lt;br /&gt;
&lt;br /&gt;
=== Modules ===&lt;br /&gt;
Modules are rendered on a page using one of the following code examples. The modules are separated into different areas of a template using template positions set in the &amp;lt;code&amp;gt;templatedetails.xml&amp;lt;/code&amp;gt; file. Using the &amp;lt;code&amp;gt;jdoc:include&amp;lt;/code&amp;gt;&#039;s &amp;lt;code&amp;gt;name=&amp;quot;&#039;&#039;[template position name]&#039;&#039;&amp;quot;&amp;lt;/code&amp;gt; attribute, the various modules in their respective positions can be called, rendered, and styled separately. Additional attributes can be provided to control the layout and appearance of modules, if supported.&lt;br /&gt;
&lt;br /&gt;
Below are some examples of module statements with module positions used frequently by Joomla! theme developers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;debug&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;icon&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;left&amp;quot; style=&amp;quot;rounded&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;left&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;right&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;status&amp;quot;  /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;syndicate&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;title&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;toolbar&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;top&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;top&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user2&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user3&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user4&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The &amp;lt;code&amp;gt;name=&amp;quot;user3&amp;quot;&amp;lt;/code&amp;gt; module position is normally (by default) used for the top menu.&lt;br /&gt;
&lt;br /&gt;
==== The style attribute ====&lt;br /&gt;
The optional &amp;lt;code&amp;gt;style=&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; attribute is available for the &amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;modules&amp;lt;/code&amp;gt; types of &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; statements. The attribute value refers to the [[What is module chrome?|chrome]] style used to wrap the output generated by the Module. If no style is provided, a value of &amp;quot;&amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&amp;quot; is used by default.&lt;br /&gt;
&lt;br /&gt;
Template designers may add additional chrome names as described in [[Applying custom module chrome]].&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=5329</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=5329"/>
		<updated>2008-04-26T17:11:38Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using parameters with a component=&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. modules and plugins) is the ability to store data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles (associated with the  com_content component) are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly where to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;/n&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  If these parameters were set up as overrides, parameter2 would show the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - backend==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is possible to define default values for each of these parameters in the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; statements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file.  However, in order to save these default values to the database, a user would need to click on the &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button (at which point any field not having a pre-saved value will be given the default value), and then click the &#039;Save&#039; button.  Since you won&#039;t want to rely on your users doing this before using the component, Joomla! 1.5 allows you define default values for the component parameters, to be saved to the database on installation.  These default values are set in the installation XML file (typically called &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt;), which has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Although the structure of these &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements is superficially similar to those from the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, you should note that the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements from the install file are never used to produce form fields.  There is therefore no benefit to setting the types of parameter.  The only attributes required for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements are the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values - it is these values which will be copied to the database on installation.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view (usually for a particular component item).  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  You can also choose to override the component-wide default parameters as mentioned above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; template directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (in the default Kepri backend template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any radio button form fields are replaced by drop-down lists.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is the default option for the list.&lt;br /&gt;
* Any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value (unlike the drop-down lists).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - frontend==&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=5310</id>
		<title>User:Mike dowler</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Mike_dowler&amp;diff=5310"/>
		<updated>2008-04-26T09:21:25Z</updated>

		<summary type="html">&lt;p&gt;Mike dowler: /* 3. &amp;#039;Article&amp;#039; specific parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using parameters with a component=&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
One thing that sets Joomla! components apart from other types of Extension (i.e. modules and plugins) is the ability to store data in the Joomla! MySQL database.  Typically, this data will be content for displaying on a page (such as the content of an article, or its title) or data about how that content should be displayed (e.g. a setting specifying whether or not the title should be shown).  A component normally creates at least one table in the database to store this data - for example, data for articles (associated with the  com_content component) are stored in the &amp;lt;code&amp;gt;jos_content&amp;lt;/code&amp;gt; table (where &#039;&#039;jos&#039;&#039; is the table prefix for the site).&lt;br /&gt;
&lt;br /&gt;
However, choosing exactly where to store each item of data requires a little more thought.  There are essentially two choices:  each data item may be stored in its own field, or a collection of data items may be stored within a single parameters field.  (Of course, there is nothing to stop you making use of both methods, for different data items, within the same component).  Which approach you use for a given data item is largely a matter of personal choice, although there are some factors to consider:&lt;br /&gt;
* Core code included in the Joomla! installation makes it very easy to produce the appropriate form elements for entering data into &#039;&#039;&#039;parameters&#039;&#039;&#039; in the backend.  If you choose to save the data in separate fields, you will need to code the appropriate form elements yourself.&lt;br /&gt;
* Again, Joomla! core code allows you to set default values for &#039;&#039;&#039;parameters&#039;&#039;&#039; across the whole component.  Individual component items (e.g. individual articles) can then choose to use the default values, or to override them with values specific to that item.  See below for details of how to do this.&lt;br /&gt;
* It is not possible to extract individual parameter values directly from the database.  Instead, the whole parameters field must be extracted and parsed to obtain the different parameter values.  This means that it is not very easy, for example, to run MySQL queries that search for a parameter with a particular value.  Any data that you want to run queries against should be given its &#039;&#039;&#039;own table field&#039;&#039;&#039;.&lt;br /&gt;
* Similarly, it is not possible to run data validation on parameter fields before saving data.&lt;br /&gt;
In general, parameters are conventionally used to store data relating to the &#039;&#039;presentation&#039;&#039; of information.  The information itself is generally stored in separate fields.&lt;br /&gt;
&lt;br /&gt;
==Types of component parameter==&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These parameters are set once for the whole component, and are generally used to provide the &#039;default&#039; parameter settings for the component on that particular site.  &lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu link to an individual component item (e.g. an article) can also have parameters associated with it, which can affect the way the component item is displayed &#039;&#039;using that link&#039;&#039;.  The types of parameters available will depend on the way that the component item is displayed (the &#039;view&#039; in MVC terms, but don&#039;t worry if this doesn&#039;t mean anything to you!).  However, the precise values of those parameters can be set for each menu link individually.  If there is another menu link to that same component item, then it is important to realise each menu link may have different parameter values, and so the same article may be displayed differently in the two cases.&lt;br /&gt;
&lt;br /&gt;
A menu link can also override the component-wide default parameters, so that the override values (if set) are used in place of the default values &#039;&#039;for that component item when accessed via that menu link&#039;&#039;.  As you would expect, when no override value is set, the default value is used instead, in the normal manner.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
Finally, each component item (e.g. article) can have parameters which apply to that item, regardless of how it is accessed (i.e. via any available menu link, or even without reference to a menu at all!).  If the component designer wants, the article specific parameters can also be set up to use the &#039;override&#039; behaviour, so that they default to the current values of the corresponding component-wide parameters, though this is not essential.  Again, this is described further below.&lt;br /&gt;
&lt;br /&gt;
==Storing the parameters and their values.==&lt;br /&gt;
&lt;br /&gt;
In general, a set of parameters is stored within the database in a single &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; field.  Different parameters are separated by &amp;lt;code&amp;gt;newline&amp;lt;/code&amp;gt; characters (&#039;/n&#039; in MySQL - each parameter will appear on a different line when you look at the data in something like phpMyAdmin).  Each parameter consists of the parameter name and value, separated by an equals sign (=).  As an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
parameter1=parameter1value&lt;br /&gt;
parameter2=&lt;br /&gt;
parameter3=parameter3value&lt;br /&gt;
parameter4=parameter4value&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, parameter1, parameter3, and parameter4 have all been assigned values, whilst parameter2 has no value.  If these parameters were set up as overrides, parameter2 would show the default value.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_components table, in the row corresponding to the particular component to which they apply.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the jos_menu table, in the row corresponding to the particular menu item to which they apply.&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are stored in a text field in the table created by the component.  Whilst there is no strict rule for naming the field, it is common to extend the above pattern using the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; name.  However, com_content stores article parameters in a field called &amp;lt;code&amp;gt;attribs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Accessing the parameters - backend==&lt;br /&gt;
&lt;br /&gt;
Joomla! includes some shortcuts to enable component creators to easily add parameter forms to the backend of their component.  These forms allow a site administrator to enter a parameter value by, for example, entering some text in a box, choosing from a drop-down list, or selecting a radio button.  To create these forms, each parameter needs to have an associated &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; object in an XML file.  The type of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object determines the form elements that will be shown in the backend.  A list of the available form elements is given [[Using_the_core_parameter_types|here]].  More information is given below about the XML file names, structure and location required for each set of parameters.&lt;br /&gt;
&lt;br /&gt;
===1. Component-wide default parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in a file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; which is located in &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/&amp;lt;/code&amp;gt;.  The file should have the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element can have any name you wish, but there must be one element at the root of the document (this is a requirement for a well-formed XML document). You can have more than one &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; element, but only the first one will be considered.&lt;br /&gt;
&lt;br /&gt;
So that administrators to access these parameters, you will need to add a button to the toolbar in the backend of your component.  This can be done using the code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::preferences( &#039;com_COMPONENT_NAME&#039; );&lt;br /&gt;
// e.g. for the core Content component, you would use JToolBarHelper::preferences( &#039;com_content&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which is typically placed in the PHP file responsible for the backend output.  (For example, using an MVC structure, you might place this code at the top of &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This adds a &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button to the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Toolbar_newsfeed.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking on the toolbar button produces a pop-up window containing the form fields for each parameter defined in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is possible to define default values for each of these parameters in the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; statements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file.  However, in order to save these default values to the database, a user would need to click on the &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; button (at which point any field not having a pre-saved value will be given the default value), and then click the &#039;Save&#039; button.  Since you won&#039;t want to rely on your users doing this before using the component, Joomla! 1.5 allows you define default values for the component parameters, to be saved to the database on installation.  These default values are set in the installation XML file (typically called &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt;), which has the following structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Although the structure of these &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements is superficially similar to those from the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file, you should note that the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements from the install file are never used to produce form fields.  There is therefore no benefit to setting the types of parameter.  The only attributes required for the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements are the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values - it is these values which will be copied to the database on installation.&lt;br /&gt;
&lt;br /&gt;
===2. Menu item specific parameters===&lt;br /&gt;
&lt;br /&gt;
A menu item is associated with a particular view from your component&#039;s frontend - following the menu link in the frontend will display that view (usually for a particular component item).  Joomla! 1.5 allows you to define parameters for a particular view, so that a copy of those parameters can be associated with each menu item using the view.  You can also choose to override the component-wide default parameters as mentioned above, so that the override values will apply to the particular menu item.&lt;br /&gt;
&lt;br /&gt;
The view parameters are defined in an XML file stored in the &#039;&#039;frontend&#039;&#039; template directory and with the same name as the template, i.e. &amp;lt;code&amp;gt;/PATH_TO_JOOMLA/components/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/TEMPLATE_NAME.xml&amp;lt;/code&amp;gt;.  The structure of the file is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;state&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;params&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
    &amp;lt;advanced&amp;gt;&lt;br /&gt;
      &amp;lt;param /&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/advanced&amp;gt;&lt;br /&gt;
  &amp;lt;/state&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displaying the forms for these parameters is handled automatically by the core &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; component, which creates a number of slider panes on the right hand side (in the default Kepri backend template) of the menu item edit screen.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Basic&amp;lt;/code&amp;gt; slider pane.  Any parameters defined within the &amp;lt;code&amp;gt;&amp;lt;advanced&amp;gt;&amp;lt;/code&amp;gt; tag will appear in the &amp;lt;code&amp;gt;Parameters - Advanced&amp;lt;/code&amp;gt; slider pane.&lt;br /&gt;
&lt;br /&gt;
For the override of the component-wide default parameters, &amp;lt;code&amp;gt;com_menus&amp;lt;/code&amp;gt; uses the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file as above, so there is no need to define these parameters again.  The override forms are automatically added to a slider pane named &amp;lt;code&amp;gt;Parameters - Component&amp;lt;/code&amp;gt;.  However, there are a number of changes from the forms used in the Preferences pop-up window (despite being based on the same &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file):&lt;br /&gt;
* Any radio button form fields are replaced by drop-down lists.&lt;br /&gt;
* All drop-down lists (both those defined as such in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;, and those defined as radio buttons) are given an extra  option.  This extra option displays the text &amp;quot;Use Global&amp;quot; but has an associated value of an empty string.  The &amp;quot;Use Global&amp;quot; option is the default option for the list.&lt;br /&gt;
* Any text box fields defined with a default value in &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; retain that default value (unlike the drop-down lists).&lt;br /&gt;
&lt;br /&gt;
===3. &#039;Article&#039; specific parameters===&lt;br /&gt;
&lt;br /&gt;
These are defined in an XML file which can be stored anywhere you like, but is typically placed within the &amp;lt;code&amp;gt;models&amp;lt;/code&amp;gt; folder of the component backend (if you are using an MVC structure) and named according to the model to which they apply, i.e. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&amp;lt;/code&amp;gt;.  The XML file has the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  &amp;lt;params group=&amp;quot;GROUP_NAME&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;param /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/params&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As above, you can give the &amp;lt;code&amp;gt;&amp;lt;root&amp;gt;&amp;lt;/code&amp;gt; element whatever name you wish.  You can also have as many &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups as you like, though each group must have a &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; attribute with a different &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;.  If there are two or more &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; groups with the same &amp;lt;code&amp;gt;GROUP_NAME&amp;lt;/code&amp;gt;, only the last one in the list will be considered.&lt;br /&gt;
&lt;br /&gt;
To display the forms for these parameters in the backend of your component, you will need to do a little work yourself.  Firstly, you need to access the saved parameter data from the database.  For this, you will need to identify both the location of the stored parameters data in the database, and the XML file that you are using to define the parameter form fields.  Assuming that you have already created a &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt; variable to hold your component item (i.e. &#039;article&#039;) data, that the parameters data is stored in the &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; field of the &amp;lt;code&amp;gt;$row&amp;lt;/code&amp;gt;, and that the XML file is located in the models folder as specified above, you could use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$paramsdata = $row-&amp;gt;params;&lt;br /&gt;
$paramsdefs = &#039;PATH_TO_JOOMLA/administrator/components/com_COMPONENT_NAME/models/MODEL_NAME.xml&#039;;&lt;br /&gt;
$params = new JParameter( $paramsdata, $paramsdefs );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code is typically placed in the View file (e.g. view.html.php) within the corresponding folder.&lt;br /&gt;
&lt;br /&gt;
To display the parameters forms in slider panes (in the same way that they are displayed in the menu item backend), you should use the following code in the template file (e.g. &amp;lt;code&amp;gt;PATH_TO_JOOMLA/administrator/com_COMPONENT_NAME/views/VIEW_NAME/tmpl/default.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pane =&amp;amp; JPane::getInstance( &#039;sliders&#039; );&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;startPane( &#039;content-pane&#039; );&lt;br /&gt;
&lt;br /&gt;
// First slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_1_TITLE and a title id attribute of SLIDER_PANEL_1_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_1_TITLE&#039; ), &#039;SLIDER_PANEL_1_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with no &#039;group&#039; attribute&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
//Second slider panel&lt;br /&gt;
// Create a slider panel with a title of SLIDER_PANEL_2_TITLE and a title id attribute of SLIDER_PANEL_2_NAME&lt;br /&gt;
echo $pane-&amp;gt;startPanel( JText::_( &#039;SLIDER_PANEL_2_TITLE&#039; ), &#039;SLIDER_PANEL_2_NAME&#039; );&lt;br /&gt;
// Display the parameters defined in the &amp;lt;params&amp;gt; group with the &#039;group&#039; attribute of &#039;GROUP_NAME&#039;&lt;br /&gt;
echo $this-&amp;gt;params-&amp;gt;render( &#039;params&#039;, &#039;GROUP_NAME&#039; );&lt;br /&gt;
echo $pane-&amp;gt;endPanel();&lt;br /&gt;
&lt;br /&gt;
// Repeat for each additional slider panel required&lt;br /&gt;
&lt;br /&gt;
echo $pane-&amp;gt;endPane();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mike dowler</name></author>
	</entry>
</feed>