<?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=Waveywhite</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=Waveywhite"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Waveywhite"/>
	<updated>2026-05-14T15:01:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Subform_form_field_type&amp;diff=445055</id>
		<title>Subform form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Subform_form_field_type&amp;diff=445055"/>
		<updated>2017-09-11T17:11:37Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: Made it clear that that the relative path for the xml file is relative to the installation folder, because the previous text implied that it was relative to the path of the including file.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;subform&#039;&#039;&#039; form field type provides a method for using XML forms inside one another or reuse forms inside an existing  form.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
If attribute &#039;&#039;&#039;multiple&#039;&#039;&#039; is set to &#039;&#039;&#039;true&#039;&#039;&#039; then the included form will be &#039;&#039;&#039;repeatable&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
The Field has two &amp;quot;predefined&amp;quot; layouts for displaying the subform as either a &#039;&#039;&#039;table&#039;&#039;&#039; or as a &#039;&#039;&#039;div&#039;&#039;&#039; container, as well as support for custom layouts.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
An example XML &#039;&#039;&#039;field&#039;&#039;&#039; definition for &#039;&#039;&#039;single&#039;&#039;&#039; mode:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;field-name&amp;quot; type=&amp;quot;subform&amp;quot;&lt;br /&gt;
    formsource=&amp;quot;path/to/exampleform.xml&amp;quot;&lt;br /&gt;
    label=&amp;quot;Subform Field&amp;quot; description=&amp;quot;Subform Field Description&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
An example XML &#039;&#039;&#039;field&#039;&#039;&#039; definition for &#039;&#039;&#039;multiple&#039;&#039;&#039; mode:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;field-name&amp;quot; type=&amp;quot;subform&amp;quot;&lt;br /&gt;
    formsource=&amp;quot;path/to/exampleform.xml&amp;quot; multiple=&amp;quot;true&amp;quot;&lt;br /&gt;
    label=&amp;quot;Subform Field&amp;quot; description=&amp;quot;Subform Field Description&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Example XML of &#039;&#039;exampleform.xml&#039;&#039;&amp;lt;/translate&amp;gt;&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;form&amp;gt;&lt;br /&gt;
    &amp;lt;field name=&amp;quot;example_text&amp;quot; type=&amp;quot;text&amp;quot; label=&amp;quot;Example Text&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;field name=&amp;quot;example_textarea&amp;quot; type=&amp;quot;textarea&amp;quot; label=&amp;quot;Example Textarea&amp;quot; cols=&amp;quot;40&amp;quot; rows=&amp;quot;8&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
An example XML of &#039;&#039;exampleform.xml&#039;&#039; with &#039;&#039;fieldsets&#039;&#039;&amp;lt;/translate&amp;gt;&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;form&amp;gt;&lt;br /&gt;
    &amp;lt;fieldset name=&amp;quot;section1&amp;quot; label=&amp;quot;Section1&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;field name=&amp;quot;example_text&amp;quot; type=&amp;quot;text&amp;quot; label=&amp;quot;Example Text&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;field name=&amp;quot;example_textarea&amp;quot; type=&amp;quot;textarea&amp;quot; label=&amp;quot;Example Textarea&amp;quot; cols=&amp;quot;40&amp;quot; rows=&amp;quot;8&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;fieldset name=&amp;quot;section2&amp;quot; label=&amp;quot;Section2&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;field name=&amp;quot;example_list&amp;quot; type=&amp;quot;list&amp;quot; default=&amp;quot;1&amp;quot; class=&amp;quot;advancedSelect&amp;quot; label=&amp;quot;Example List&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JYES&amp;lt;/option&amp;gt;&lt;br /&gt;
            &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JNO&amp;lt;/option&amp;gt;&lt;br /&gt;
        &amp;lt;/field&amp;gt;&lt;br /&gt;
    &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
Field attributes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;subform&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;required&#039;&#039;&#039; (optional) The field must be filled before submitting the form.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;message&#039;&#039;&#039; (optional) The error message that will be displayed instead of the default message.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;default&#039;&#039;&#039; (optional) is the default value, JSON string.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;formsource&#039;&#039;&#039; (mandatory) the form source to be included. A relative path to the xml file (relative to the root folder for the installed Joomla site) or a valid form name which can be found by &#039;&#039;JForm::getInstance()&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;multiple&#039;&#039;&#039; (optional) whether the subform fields are repeatable or not.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;min&#039;&#039;&#039; (optional) count of minimum repeating in multiple mode. Default: &#039;&#039;0&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;max&#039;&#039;&#039; (optional) count of maximum repeating in multiple mode. Default: &#039;&#039;1000&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;groupByFieldset&#039;&#039;&#039; (optional) whether to group the subform fields by its fieldset (&#039;&#039;true&#039;&#039; or &#039;&#039;false&#039;&#039;). Default: &#039;&#039;false&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;buttons&#039;&#039;&#039; (optional) which buttons to show in multiple mode. Default: &#039;&#039;add,remove,move&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;layout&#039;&#039;&#039; (optional) the name of the layout to use when displaying &#039;&#039;&#039;subform&#039;&#039;&#039; fields.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Available layouts:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;joomla.form.field.subform.default&#039;&#039;&#039; render the subform in a div container, without support of repeating. Default for single mode.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;joomla.form.field.subform.repeatable&#039;&#039;&#039; render the subform in a div container, used for multiple mode. Support groupByFieldset.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;joomla.form.field.subform.repeatable-table&#039;&#039;&#039; render the subform as a table, used for multiple mode. Supports groupByFieldset. By default each field is rendered as a table column, but if &#039;&#039;groupByFieldset=true&#039;&#039; then each fieldset is rendered as a table column.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Be aware&#039;&#039;&#039;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
If your field in the subform has additional JavaScript logic then it may not work in &#039;&#039;&#039;multiple&#039;&#039;&#039; mode, because do not see the fields which added by the subform field dynamically. If it happened then you need to adjust your field to support it.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
Next example may help:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;jQuery(document).ready(function(){&lt;br /&gt;
    ... here the code for setup your field as usual...&lt;br /&gt;
&lt;br /&gt;
    jQuery(document).on(&#039;subform-row-add&#039;, function(event, row){&lt;br /&gt;
        ... here is the code to set up the fields in the new row ...&lt;br /&gt;
    })&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
Because of this some extra Joomla! fields may not work for now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Subform not provide the Validation and Filter.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Example == &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Problem &#039;&#039;&#039;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
After adding new rows selects are not &amp;quot;chosen&amp;quot;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
See screenshot to get the idea of the problem http://static.xscreenshot.com/2016/10/29/18/screen_6917fc3c8d3c5d679b6442ff249a7b5f&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Solution &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Here is an example how to reinit jQuery Chosen on newly added repeated rows:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;jQuery(document).ready(function(){&lt;br /&gt;
    jQuery(document).on(&#039;subform-row-add&#039;, function(event, row){&lt;br /&gt;
        jQuery(row).find(&#039;select&#039;).chosen();&lt;br /&gt;
    })&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Or a PHP snippet to be used in e.g. your plugin in **onBeforeCompileHead** method or in your component view.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$doc = JFactory::getDocument();&lt;br /&gt;
$js = &#039;&lt;br /&gt;
	jQuery(document).on(\&#039;subform-row-add\&#039;, function(event, row){&lt;br /&gt;
		jQuery(row).find(\&#039;select\&#039;).chosen();&lt;br /&gt;
	})&lt;br /&gt;
&#039;;&lt;br /&gt;
$doc-&amp;gt;addScriptDeclaration($js);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
So newly added rows now are &amp;quot;chosen&amp;quot; now http://static.xscreenshot.com/2016/10/29/18/screen_8f7dc7709899bac7a43926828e504519&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== See also === &amp;lt;!--T:32--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Standard form field types|List of standard form field types]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
[[Category:Standard form field types]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Package&amp;diff=170476</id>
		<title>Package</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Package&amp;diff=170476"/>
		<updated>2015-04-07T11:00:43Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: Added details on the version number parameter for the extension tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Note on component dependant modules== &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Sometimes modules (or plugins etc.) use a component&#039;s models and helpers and such. In these occasions it would be nice to be able to package your module in this way that it gets uninstalled when the component itself gets uninstalled.  This is called dependency management which has been desired in joomla but hasn&#039;t been done yet.&lt;br /&gt;
It is suggested to follow the standards and just using a package as is described below.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== What is a package? == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
A package is a extension that is used to install multiple extensions in one go. This is used if you have for example a component and a module that are depending on each other. Combining them in a package will let the user install and uninstall both extensions in one go. Package extensions can be used with Joomla {{JVer|2.5}} and higher.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== How do I create a package? == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
A package extension is created by zipping all zip files of the extensions together with a xml manifest file. For example if you have a package composed by:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;component&#039;&#039;&#039; helloworld&lt;br /&gt;
* &#039;&#039;&#039;module&#039;&#039;&#039; helloworld&lt;br /&gt;
* &#039;&#039;&#039;library&#039;&#039;&#039; helloworld &lt;br /&gt;
* &#039;&#039;&#039;system plugin&#039;&#039;&#039; helloworld &lt;br /&gt;
* &#039;&#039;&#039;template&#039;&#039;&#039; helloworld&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The package should have the following tree in your zipfile:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  -- pkg_helloworld.xml&lt;br /&gt;
  -- packages &amp;lt;dir&amp;gt;&lt;br /&gt;
      |-- com_helloworld.zip&lt;br /&gt;
      |-- mod_helloworld.zip&lt;br /&gt;
      |-- lib_helloworld.zip&lt;br /&gt;
      |-- plg_sys_helloworld.zip&lt;br /&gt;
      |-- tpl_helloworld.zip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
The pkg_helloworld.xml could have the following contents:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&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;extension type=&amp;quot;package&amp;quot; version=&amp;quot;1.6&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;name&amp;gt;Hello World Package&amp;lt;/name&amp;gt;&lt;br /&gt;
 &amp;lt;author&amp;gt;Hello World Package Team&amp;lt;/author&amp;gt;&lt;br /&gt;
 &amp;lt;creationDate&amp;gt;May 2012&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
 &amp;lt;packagename&amp;gt;helloworld&amp;lt;/packagename&amp;gt;&lt;br /&gt;
 &amp;lt;version&amp;gt;1.0.0&amp;lt;/version&amp;gt;&lt;br /&gt;
 &amp;lt;url&amp;gt;http://www.yoururl.com/&amp;lt;/url&amp;gt;&lt;br /&gt;
 &amp;lt;packager&amp;gt;Hello World Package Team&amp;lt;/packager&amp;gt;&lt;br /&gt;
 &amp;lt;packagerurl&amp;gt;http://www.yoururl.com/&amp;lt;/packagerurl&amp;gt;&lt;br /&gt;
 &amp;lt;description&amp;gt;Example package to combine multiple extensions&amp;lt;/description&amp;gt;&lt;br /&gt;
 &amp;lt;update&amp;gt;http://www.updateurl.com/update&amp;lt;/update&amp;gt;&lt;br /&gt;
 &amp;lt;files folder=&amp;quot;packages&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;component&amp;quot; id=&amp;quot;com_helloworld&amp;quot; &amp;gt;com_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;module&amp;quot; id=&amp;quot;helloworld&amp;quot; client=&amp;quot;site&amp;quot;&amp;gt;mod_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;library&amp;quot; id=&amp;quot;helloworld&amp;quot;&amp;gt;lib_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;plugin&amp;quot; id=&amp;quot;helloworld&amp;quot; group=&amp;quot;system&amp;quot;&amp;gt;plg_sys_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;template&amp;quot; id=&amp;quot;helloworld&amp;quot; client=&amp;quot;site&amp;quot;&amp;gt;tpl_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
 &amp;lt;/files&amp;gt;&lt;br /&gt;
 &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
When you zip this and try to install it, you will see that every extension will be installed. Also the package will be visible in the extension list to uninstall all the extension of this package.&lt;br /&gt;
&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
Remember to use the package uninstaller instead of individual subpackage uninstallers to avoid orphan extension entries in the extension manager.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Id= &amp;lt;file id=&amp;quot;not_arbitrary&amp;quot;&amp;gt; === &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
The id element in &amp;lt;file ..&amp;gt; tag are NOT arbitrary!. The &amp;quot;id=&amp;quot; should be set to the value of the &amp;quot;element&amp;quot; column in the &amp;quot;#__extensions&amp;quot; table. If they are not set correctly, upon uninstalling of the package the children ( &amp;lt;file&amp;gt; ) will NOT be found and uninstalled.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Manifest filename and packagename === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
The naming of the manifest file and the ability to uninstall the package file itself are closely related. &lt;br /&gt;
The manifest file must have a &amp;quot;pkg_&amp;quot; prefix, the remainder of the manifest name ( without .xml extension ) is to be used as &amp;lt;packagename&amp;gt;. Or, the other way around, a package you want to identify as &amp;quot;blurpblurp_J3&amp;quot; get that as its &amp;lt;packagename&amp;gt; and should be in a manifest file named &amp;quot;pkg_blurpblurp_J3.xml&amp;quot;. Failure to do so will make it impossible to uninstall the package itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
=== Extension tag ===&lt;br /&gt;
As of Joomla 3.4, you should include method=&amp;quot;upgrade&amp;quot; in the &amp;lt;extension&amp;gt; tag if you wish for your package to succeed in updating itself on subsequent installations.&lt;br /&gt;
&lt;br /&gt;
The version attribute of the &amp;lt;extension&amp;gt; tag should be set to the minimum supported version of Joomla for this package. For example, if your package only supports Joomla 3.2 and above set this to 3.2.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Plugin/Events&amp;diff=108583</id>
		<title>Plugin/Events</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Plugin/Events&amp;diff=108583"/>
		<updated>2014-02-25T13:52:19Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: /* User */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{version/tutor|2.5,3.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
Joomla! ships with a variety of core events, organised into groups.  These are described in the following topics.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
* [[Plugin/Events/User#onUserAuthenticate|onUserAuthenticate]]&lt;br /&gt;
&lt;br /&gt;
=== Captcha ===&lt;br /&gt;
* [[Plugin/Events/Editor#onInit|onInit]]&lt;br /&gt;
* [[Plugin/Events/Editor#onDisplay|onDisplay]]&lt;br /&gt;
* [[Plugin/Events/Captcha#onCheckAnswer|onCheckAnswer]]&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
* [[Plugin/Events/Content#onContentPrepare|onContentPrepare]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentAfterTitle|onContentAfterTitle]] ({{JVer|3.x}} only)&lt;br /&gt;
* [[Plugin/Events/Content#onContentBeforeDisplay|onContentBeforeDisplay]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentAfterDisplay|onContentAfterDisplay]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentBeforeSave|onContentBeforeSave]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentAfterSave|onContentAfterSave]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentPrepareForm|onContentPrepareForm]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentPrepareData|onContentPrepareData]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentBeforeDelete|onContentBeforeDelete]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentAfterDelete|onContentAfterDelete]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentChangeState|onContentChangeState]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentSearch|onContentSearch]]&lt;br /&gt;
* [[Plugin/Events/Content#onContentSearchAreas|onContentSearchAreas]]&lt;br /&gt;
&lt;br /&gt;
=== Editors ===&lt;br /&gt;
* [[Plugin/Events/Editor#onInit|onInit]]&lt;br /&gt;
* [[Plugin/Events/Editor#onSave|onSave]]&lt;br /&gt;
* [[Plugin/Events/Editor#onSetContent|onSetContent]]&lt;br /&gt;
* [[Plugin/Events/Editor#onDisplay|onDisplay]]&lt;br /&gt;
* [[Plugin/Events/Editor#onGetContent|onGetContent]]&lt;br /&gt;
* [[Plugin/Events/Editor#onGetInsertMethod|onGetInsertMethod]]&lt;br /&gt;
&lt;br /&gt;
=== Extensions ===&lt;br /&gt;
* [[Plugin/Events/Extension#onExtensionAfterInstall|onExtensionAfterInstall]]&lt;br /&gt;
* [[Plugin/Events/Extension#onExtensionAfterUninstall|onExtensionAfterUninstall]]&lt;br /&gt;
* [[Plugin/Events/Extension#onExtensionAfterUpdate|onExtensionAfterUpdate]]&lt;br /&gt;
&lt;br /&gt;
=== Finder ===&lt;br /&gt;
* [[Plugin/Events/Finder#onFinderCategoryChangeState|onFinderCategoryChangeState]]&lt;br /&gt;
* [[Plugin/Events/Finder#onFinderChangeState|onFinderChangeState]]&lt;br /&gt;
* [[Plugin/Events/Finder#onFinderBeforeDelete|onFinderAfterDelete]]&lt;br /&gt;
* [[Plugin/Events/Finder#onFinderAfterDelete|onFinderAfterDelete]]&lt;br /&gt;
* [[Plugin/Events/Finder#onFinderBeforeSave|onFinderBeforeSave]]&lt;br /&gt;
* [[Plugin/Events/Finder#onFinderAfterSave|onFinderAfterSave]]&lt;br /&gt;
&lt;br /&gt;
=== Quick Icons ===&lt;br /&gt;
* [[Plugin/Events/Quickicon#onGetIcons|onGetIcons]]&lt;br /&gt;
&lt;br /&gt;
=== System ===&lt;br /&gt;
* [[Plugin/Events/System#onAfterInitialise|onAfterInitialise]]&lt;br /&gt;
* [[Plugin/Events/System#onAfterRoute|onAfterRoute]]&lt;br /&gt;
* [[Plugin/Events/System#onAfterDispatch|onAfterDispatch]]&lt;br /&gt;
* [[Plugin/Events/System#onAfterRender|onAfterRender]]&lt;br /&gt;
* [[Plugin/Events/System#onBeforeRender|onBeforeRender]]&lt;br /&gt;
* [[Plugin/Events/System#onBeforeCompileHead|onBeforeCompileHead]]&lt;br /&gt;
* [[Plugin/Events/System#onSearch|onSearch]]&lt;br /&gt;
* [[Plugin/Events/System#onSearchAreas|onSearchAreas]]&lt;br /&gt;
&lt;br /&gt;
=== User ===&lt;br /&gt;
* [[Plugin/Events/User#onUserBeforeSave|onUserBeforeSave]]&lt;br /&gt;
* [[Plugin/Events/User#onUserAfterSave|onUserAfterSave]]&lt;br /&gt;
* [[Plugin/Events/User#onUserBeforeDelete|onUserBeforeDelete]]&lt;br /&gt;
* [[Plugin/Events/User#onUserAfterDelete|onUserAfterDelete]]&lt;br /&gt;
* [[Plugin/Events/User#onUserLogin|onUserLogin]]&lt;br /&gt;
* [[Plugin/Events/User#onUserLoginFailure|onUserLoginFailure]]&lt;br /&gt;
* [[Plugin/Events/User#onUserAfterLogin|onUserAfterLogin]]&lt;br /&gt;
* [[Plugin/Events/User#onUserLogout|onUserLogout]]&lt;br /&gt;
* [[Plugin/Events/User#onUserAuthenticate|onUserAuthenticate]]&lt;br /&gt;
* [[Plugin/Events/User#onUserAuthorisation|onUserAuthorisation]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Plugin Development|Events]][[Category:Specifications]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_custom_fields_to_core_components_using_a_plugin&amp;diff=108551</id>
		<title>Adding custom fields to core components using a plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_custom_fields_to_core_components_using_a_plugin&amp;diff=108551"/>
		<updated>2014-02-25T12:24:17Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Have you ever wished that there was an extra phone number field in com_contact or needed an extra field for articles in com_content? Joomla provides a straight-foward way of integrating new fields with core components such as these. All it takes to achieve this is a simple content plugin and a layout override in your template.&lt;br /&gt;
&lt;br /&gt;
This article shows how to add an extra field to a core component using the example of adding an additional email address to contacts in com_contact.&lt;br /&gt;
&lt;br /&gt;
==Adding a custom field==&lt;br /&gt;
&lt;br /&gt;
It is recommended that you first read [[Creating a Plugin for Joomla]] for details on how to create and install a plugin, which is not covered here.&lt;br /&gt;
&lt;br /&gt;
To add a field to a system component you need to create a content plugin which picks up the onContentPrepareForm event and inserts it&#039;s own fields into the given JForm. The following code is for Joomla 3.1 and later, for Joomla 2.5 the language files need to be loaded in the constructor (see [[J2.5:Creating a Plugin for Joomla]]).&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;
// no direct access&lt;br /&gt;
defined ( &#039;_JEXEC&#039; ) or die ( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
class plgContentExample extends JPlugin {&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Load the language file on instantiation.&lt;br /&gt;
	 * Note this is only available in Joomla 3.1 and higher.&lt;br /&gt;
	 * If you want to support 3.0 series you must override the constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var boolean&lt;br /&gt;
	 * @since 3.1&lt;br /&gt;
	 */&lt;br /&gt;
	&lt;br /&gt;
	protected $autoloadLanguage = true;&lt;br /&gt;
&lt;br /&gt;
	function onContentPrepareForm($form, $data) {&lt;br /&gt;
		$app = JFactory::getApplication();&lt;br /&gt;
		$option = $app-&amp;gt;input-&amp;gt;get(&#039;option&#039;);&lt;br /&gt;
		&lt;br /&gt;
		switch($option) {&lt;br /&gt;
			&lt;br /&gt;
			case &#039;com_contact&#039;:&lt;br /&gt;
				if ($app-&amp;gt;isAdmin()) {&lt;br /&gt;
					JForm::addFormPath(__DIR__ . &#039;/forms&#039;);&lt;br /&gt;
					$form-&amp;gt;loadFile(&#039;contact&#039;, false);&lt;br /&gt;
				}&lt;br /&gt;
				return true;&lt;br /&gt;
				&lt;br /&gt;
		}&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The additional fields are loaded from the file forms/contact.xml in the plugin directory. It&#039;s important that these fields are in a fields element with the name property set to &amp;quot;params&amp;quot;. If you don&#039;t set this property name the fields will appear in the admin site but the values will not be saved.&lt;br /&gt;
&lt;br /&gt;
In this case we are adding a field for a label to describe the email field in the public website and a second field for the value of the email address.&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;form&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;params&amp;quot; &amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;params&amp;quot; &amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;contact_emaillabel2&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;PLG_CONTENT_EXAMPLE_CONTACT_EMAILLABEL2&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;contact_email2&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;PLG_CONTENT_EXAMPLE_CONTACT_EMAIL2&amp;quot;&lt;br /&gt;
				filter=&amp;quot;email&amp;quot;&lt;br /&gt;
			/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we need a language file so that the parameters are presnted nicely in the admin site and are translatable into different languages. This file needs to be called something like en-GB.plg_content_example.ini.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
COM_CONTACT_PARAMS_FIELDSET_LABEL=&amp;quot;Additional Information&amp;quot;&lt;br /&gt;
PLG_CONTENT_EXAMPLE_CONTACT_EMAIL2=&amp;quot;Additional email address&amp;quot;&lt;br /&gt;
PLG_CONTENT_EXAMPLE_CONTACT_EMAILLABEL2=&amp;quot;Additional email label&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it for adding the field to com_contact. If you install this plugin you&#039;ll have an additional tab in the contact editing form called &amp;quot;Additional Information&amp;quot; with the new fields included. If you fill in the new label and an email address fields for a contact you&#039;ll see that com_contact will store and retrieve the information for you.&lt;br /&gt;
&lt;br /&gt;
The same plugin can be used to add more fields to different components, just add the relevant code into the onContentPrepareForm function and create the appropriate XML form files.&lt;br /&gt;
&lt;br /&gt;
==Displaying the custom field==&lt;br /&gt;
&lt;br /&gt;
To display the custom field you need to create a layout override for the relevant component in your template. For more details on creating templates see [[Creating a basic Joomla! template]], for details on layout overrides see [[Understanding Output Overrides]].&lt;br /&gt;
&lt;br /&gt;
Copy the file &amp;lt;Joomla&amp;gt;/components/com_contact/views/contact/tmpl/default.php to &amp;lt;template&amp;gt;/html/com_contact/contact/default.php, creating the folders in your template as necessary. We&#039;re going to edit this file to include the additional information. The com_contact component will automatically load the additional fields for us and load it into a variable called $thiis-&amp;gt;params. All we need to do is check that the data is set and, if so, display it.&lt;br /&gt;
&lt;br /&gt;
To display the field, find the location in &amp;lt;template&amp;gt;/html/com_contact/contact/default.php that corresponds to where you&#039;d like the additional email address to be displayed and add the following code&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;params-&amp;gt;get(&#039;contact_emaillabel2&#039;, false)) : ?&amp;gt;&lt;br /&gt;
	&amp;lt;div&amp;gt;&lt;br /&gt;
		&amp;lt;span class=&amp;quot;contact-additionalemail&amp;quot;&amp;gt;&amp;lt;?php echo $this-&amp;gt;params-&amp;gt;get(&#039;contact_emaillabel2&#039;);?&amp;gt;:&amp;amp;emsp;&amp;lt;a href=&amp;quot;mailto:&amp;lt;?php echo $this-&amp;gt;params-&amp;gt;get(&#039;contact_email2&#039;); ?&amp;gt;&amp;quot;&amp;gt;&amp;lt;?php echo $this-&amp;gt;params-&amp;gt;get(&#039;contact_email2&#039;); ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/span&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;
If you add this code and install your template you will now have the custom field displaying in your public website.&lt;br /&gt;
[[Category:Plugin Development]] [[Category:Template Development]] [[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Portal:Plugin_Development/Projects&amp;diff=108550</id>
		<title>Portal:Plugin Development/Projects</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Portal:Plugin_Development/Projects&amp;diff=108550"/>
		<updated>2014-02-25T12:18:47Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Plugin Development Articles Needed ==&lt;br /&gt;
The Joomla! Documentation Wiki needs your help! Below is a list of pages/articles needed for Plugin Development. If you know of a topic which needs to be addressed, just add it to the &#039;&#039;&#039;List of Red Links&#039;&#039;&#039; below by using the following wikimarkup.&lt;br /&gt;
{{amboxNew|image=jdoc|text=To add a &#039;&#039;&#039;Red Link&#039;&#039;&#039; {{edit|Portal:Plugin_Development/Projects|click here}} and add it to the &#039;&#039;&#039;Plugins Development Projects page&#039;&#039;&#039;. Please use the following wikimarkup code to add the suggested topic to the list: &lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;*[[Put your Plugin Article name here]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;|title=Want or Need a New Article on Plugin Development?}}&lt;br /&gt;
&lt;br /&gt;
List of Red Links for needed &#039;&#039;&#039;Plugin Develepment&#039;&#039;&#039; Articles:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Landing subpages|{{PAGENAME}}]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Portal:Plugin_Development/Using_Plugins&amp;diff=108549</id>
		<title>Portal:Plugin Development/Using Plugins</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Portal:Plugin_Development/Using_Plugins&amp;diff=108549"/>
		<updated>2014-02-25T12:17:48Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: /* Using Plugins */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Using Plugins==&lt;br /&gt;
&lt;br /&gt;
Plugins are grouped together depending on which event they run on. A full list of events grouped by event type can be found [[Plugin/Events|here]] (the names of a lot of events changed between {{JVer|1.5}} and {{JVer|2.5}} see [[J2.5:Adapting_a_Joomla_1.5_extension_to_Joomla_2.5#Renamed_Events|here]] for a full list of changes). There are also several simple tutorials on making some sample plugins running on some of these events to help running searches on extensions using both the search and smart search components:&lt;br /&gt;
&lt;br /&gt;
* [[Creating a search plugin]]&lt;br /&gt;
* [[Creating a Smart Search plug-in]] ({{JVer|2.5}} only)&lt;br /&gt;
&lt;br /&gt;
There are further tutorials using the user triggers on how to create an authentication plugin to help users log into Joomla and creating a profile plugin for Joomla.&lt;br /&gt;
&lt;br /&gt;
* [[Creating an Authentication Plugin for Joomla]]&lt;br /&gt;
* [[Creating a profile plugin]]&lt;br /&gt;
&lt;br /&gt;
Content plugins can be used to add custom fields to core components. The following tutorial explains how to do this and how to display the new field on your webite.&lt;br /&gt;
&lt;br /&gt;
* [[Adding custom fields to core components using a plugin]]&lt;br /&gt;
&lt;br /&gt;
A more complex example of [[Creating a System Plugin to augment JRouter|using plugins to create a new system router]] to produce URLs is also available ({{JVer|2.5}} only).&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Landing subpages|{{PAGENAME}}]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_custom_fields_to_core_components_using_a_plugin&amp;diff=108548</id>
		<title>Adding custom fields to core components using a plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_custom_fields_to_core_components_using_a_plugin&amp;diff=108548"/>
		<updated>2014-02-25T12:13:25Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: How to add custom fields to a core component and display them on your website.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Have you ever wished that there was an extra phone number field in com_contact or needed an extra field for articles in com_content? Joomla provides a straight-foward way of integrating new fields with core components such as these. All it takes to achieve this is a simple content plugin and a layout override in your template.&lt;br /&gt;
&lt;br /&gt;
This article shows how to add an extra field to a core component using the example of adding an additional email address to contacts in com_contact.&lt;br /&gt;
&lt;br /&gt;
==Adding a custom field==&lt;br /&gt;
&lt;br /&gt;
It is recommended that you first read [[Creating a Plugin for Joomla]] for details on how to create and install a plugin, which is not covered here.&lt;br /&gt;
&lt;br /&gt;
To add a field to a system component you need to create a content plugin which picks up the onContentPrepareForm event and inserts it&#039;s own fields into the given JForm. The following code is for Joomla 3.1 and later, for Joomla 2.5 the language files need to be loaded in the constructor (see [[J2.5:Creating a Plugin for Joomla]]).&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;
// no direct access&lt;br /&gt;
defined ( &#039;_JEXEC&#039; ) or die ( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
class plgContentExample extends JPlugin {&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Load the language file on instantiation.&lt;br /&gt;
	 * Note this is only available in Joomla 3.1 and higher.&lt;br /&gt;
	 * If you want to support 3.0 series you must override the constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var boolean&lt;br /&gt;
	 * @since 3.1&lt;br /&gt;
	 */&lt;br /&gt;
	&lt;br /&gt;
	protected $autoloadLanguage = true;&lt;br /&gt;
&lt;br /&gt;
	function onContentPrepareForm($form, $data) {&lt;br /&gt;
		$app = JFactory::getApplication();&lt;br /&gt;
		$option = $app-&amp;gt;input-&amp;gt;get(&#039;option&#039;);&lt;br /&gt;
		&lt;br /&gt;
		switch($option) {&lt;br /&gt;
			&lt;br /&gt;
			case &#039;com_contact&#039;:&lt;br /&gt;
				if ($app-&amp;gt;isAdmin()) {&lt;br /&gt;
					JForm::addFormPath(__DIR__ . &#039;/forms&#039;);&lt;br /&gt;
					$form-&amp;gt;loadFile(&#039;contact&#039;, false);&lt;br /&gt;
				}&lt;br /&gt;
				return true;&lt;br /&gt;
				&lt;br /&gt;
		}&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The additional fields are loaded from the file forms/contact.xml in the plugin directory. It&#039;s important that these fields are in a fields element with the name property set to &amp;quot;params&amp;quot;. If you don&#039;t set this property name the fields will appear in the admin site but the values will not be saved.&lt;br /&gt;
&lt;br /&gt;
In this case we are adding a field for a label to describe the email field in the public website and a second field for the value of the email address.&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;form&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;params&amp;quot; &amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;params&amp;quot; &amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;contact_emaillabel2&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;PLG_CONTENT_EXAMPLE_CONTACT_EMAILLABEL2&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;contact_email2&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;PLG_CONTENT_EXAMPLE_CONTACT_EMAIL2&amp;quot;&lt;br /&gt;
				filter=&amp;quot;email&amp;quot;&lt;br /&gt;
			/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we need a language file so that the parameters are presnted nicely in the admin site and are translatable into different languages. This file needs to be called something like en-GB.plg_content_example.ini.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
COM_CONTACT_PARAMS_FIELDSET_LABEL=&amp;quot;Additional Information&amp;quot;&lt;br /&gt;
PLG_CONTENT_EXAMPLE_CONTACT_EMAIL2=&amp;quot;Additional email address&amp;quot;&lt;br /&gt;
PLG_CONTENT_EXAMPLE_CONTACT_EMAILLABEL2=&amp;quot;Additional email label&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it for adding the field to com_contact. If you install this plugin you&#039;ll have an additional tab in the contact editing form called &amp;quot;Additional Information&amp;quot; with the new fields included. If you fill in the new label and an email address fields for a contact you&#039;ll see that com_contact will store and retrieve the information for you.&lt;br /&gt;
&lt;br /&gt;
The same plugin can be used to add more fields to different components, just add the relevant code into the onContentPrepareForm function and create the appropriate XML form files.&lt;br /&gt;
&lt;br /&gt;
==Displaying the custom field==&lt;br /&gt;
&lt;br /&gt;
To display the custom field you need to create a layout override for the relevant component in your template. For more details on creating templates see [[Creating a basic Joomla! template]], for details on layout overrides see [[Understanding Output Overrides]].&lt;br /&gt;
&lt;br /&gt;
Copy the file &amp;lt;Joomla&amp;gt;/components/com_contact/views/contact/tmpl/default.php to &amp;lt;template&amp;gt;/html/com_contact/contact/default.php, creating the folders in your template as necessary. We&#039;re going to edit this file to include the additional information. The com_contact component will automatically load the additional fields for us and load it into a variable called $thiis-&amp;gt;params. All we need to do is check that the data is set and, if so, display it.&lt;br /&gt;
&lt;br /&gt;
To display the field, find the location in &amp;lt;template&amp;gt;/html/com_contact/contact/default.php that corresponds to where you&#039;d like the additional email address to be displayed and add the following code&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;params-&amp;gt;get(&#039;contact_emaillabel2&#039;, false)) : ?&amp;gt;&lt;br /&gt;
	&amp;lt;div&amp;gt;&lt;br /&gt;
		&amp;lt;span class=&amp;quot;contact-additionalemail&amp;quot;&amp;gt;&amp;lt;?php echo $this-&amp;gt;params-&amp;gt;get(&#039;contact_emaillabel2&#039;);?&amp;gt;:&amp;amp;emsp;&amp;lt;a href=&amp;quot;mailto:&amp;lt;?php echo $this-&amp;gt;params-&amp;gt;get(&#039;contact_email2&#039;); ?&amp;gt;&amp;quot;&amp;gt;&amp;lt;?php echo $this-&amp;gt;params-&amp;gt;get(&#039;contact_email2&#039;); ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/span&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;
If you add this code and install your template you will now have the custom field displaying in your public website.&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_custom_fields_to_core_components_using_a_plugin&amp;diff=108547</id>
		<title>Adding custom fields to core components using a plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_custom_fields_to_core_components_using_a_plugin&amp;diff=108547"/>
		<updated>2014-02-25T12:09:32Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Have you ever wished that there was an extra phone number field in com_contact or needed an extra field for articles in com_content? Joomla provides a straight-foward way of integrating new fields with core components such as these. All it takes to achieve this is a simple content plugin and a layout override in your template.&lt;br /&gt;
&lt;br /&gt;
This article shows how to add an extra field to a core component using the example of adding an additional email address to contacts in com_contact.&lt;br /&gt;
&lt;br /&gt;
==Adding a custom field==&lt;br /&gt;
&lt;br /&gt;
It is recommended that you first read [[Creating a Plugin for Joomla]] for details on how to create and install a plugin, which is not covered here.&lt;br /&gt;
&lt;br /&gt;
To add a field to a system component you need to create a content plugin which picks up the onContentPrepareForm event and inserts it&#039;s own fields into the given JForm. The following code is for Joomla 3.1 and later, for Joomla 2.5 the language files need to be loaded in the constructor (see [[J2.5:Creating a Plugin for Joomla]]).&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;
// no direct access&lt;br /&gt;
defined ( &#039;_JEXEC&#039; ) or die ( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
class plgContentExample extends JPlugin {&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Load the language file on instantiation.&lt;br /&gt;
	 * Note this is only available in Joomla 3.1 and higher.&lt;br /&gt;
	 * If you want to support 3.0 series you must override the constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var boolean&lt;br /&gt;
	 * @since 3.1&lt;br /&gt;
	 */&lt;br /&gt;
	&lt;br /&gt;
	protected $autoloadLanguage = true;&lt;br /&gt;
&lt;br /&gt;
	function onContentPrepareForm($form, $data) {&lt;br /&gt;
		$app = JFactory::getApplication();&lt;br /&gt;
		$option = $app-&amp;gt;input-&amp;gt;get(&#039;option&#039;);&lt;br /&gt;
		&lt;br /&gt;
		switch($option) {&lt;br /&gt;
			&lt;br /&gt;
			case &#039;com_contact&#039;:&lt;br /&gt;
				if ($app-&amp;gt;isAdmin()) {&lt;br /&gt;
					JForm::addFormPath(__DIR__ . &#039;/forms&#039;);&lt;br /&gt;
					$form-&amp;gt;loadFile(&#039;contact&#039;, false);&lt;br /&gt;
				}&lt;br /&gt;
				return true;&lt;br /&gt;
				&lt;br /&gt;
		}&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The additional fields are loaded from the file forms/contact.xml in the plugin directory. It&#039;s important that these fields are in a fields element with the name property set to &amp;quot;params&amp;quot;. If you don&#039;t set this property name the fields will appear in the admin site but the values will not be saved.&lt;br /&gt;
&lt;br /&gt;
In this case we are adding a field for a label to describe the email field in the public website and a second field for the value of the email address.&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;form&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;params&amp;quot; &amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;params&amp;quot; &amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;contact_emaillabel2&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;PLG_CONTENT_EXAMPLE_CONTACT_EMAILLABEL2&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;contact_email2&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;PLG_CONTENT_EXAMPLE_CONTACT_EMAIL2&amp;quot;&lt;br /&gt;
				filter=&amp;quot;email&amp;quot;&lt;br /&gt;
			/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we need a language file so that the parameters are presnted nicely in the admin site and are translatable into different languages. This file needs to be called something like en-GB.plg_content_example.ini.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
COM_CONTACT_PARAMS_FIELDSET_LABEL=&amp;quot;Additional Information&amp;quot;&lt;br /&gt;
PLG_CONTENT_EXAMPLE_CONTACT_EMAIL2=&amp;quot;Additional email address&amp;quot;&lt;br /&gt;
PLG_CONTENT_EXAMPLE_CONTACT_EMAILLABEL2=&amp;quot;Additional email label&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it for adding the field to com_contact. If you install this plugin you&#039;ll have an additional tab in the contact editing form called &amp;quot;Additional Information&amp;quot; with the new fields included. If you fill in the new label and an email address fields for a contact you&#039;ll see that com_contact will store and retrieve the information for you.&lt;br /&gt;
&lt;br /&gt;
The same plugin can be used to add more fields to different components.&lt;br /&gt;
&lt;br /&gt;
==Displaying the custom field==&lt;br /&gt;
&lt;br /&gt;
To display the custom field you need to create a layout override for the relevant component in your template. For more details on creating templates see [[Creating a basic Joomla! template]], for details on layout overrides see [[Understanding Output Overrides]].&lt;br /&gt;
&lt;br /&gt;
Copy the file &amp;lt;Joomla&amp;gt;/components/com_contact/views/contact/tmpl/default.php to &amp;lt;template&amp;gt;/html/com_contact/contact/default.php, creating the folders in your template as necessary. We&#039;re going to edit this file to include the additional information. The com_contact component will automatically load the additional fields for us and load it into a variable called $thiis-&amp;gt;params. All we need to do is check that the data is set and, if so, display it.&lt;br /&gt;
&lt;br /&gt;
To display the field, find the location in &amp;lt;template&amp;gt;/html/com_contact/contact/default.php that corresponds to where you&#039;d like the additional email address to be displayed and add the following code&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;params-&amp;gt;get(&#039;contact_emaillabel2&#039;, false)) : ?&amp;gt;&lt;br /&gt;
	&amp;lt;div&amp;gt;&lt;br /&gt;
		&amp;lt;span class=&amp;quot;contact-additionalemail&amp;quot;&amp;gt;&amp;lt;?php echo $this-&amp;gt;params-&amp;gt;get(&#039;contact_emaillabel2&#039;);?&amp;gt;:&amp;amp;emsp;&amp;lt;a href=&amp;quot;mailto:&amp;lt;?php echo $this-&amp;gt;params-&amp;gt;get(&#039;contact_email2&#039;); ?&amp;gt;&amp;quot;&amp;gt;&amp;lt;?php echo $this-&amp;gt;params-&amp;gt;get(&#039;contact_email2&#039;); ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/span&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;
If you add this code and install your template you will now have the custom field displaying in your public website.&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_custom_fields_to_core_components_using_a_plugin&amp;diff=108546</id>
		<title>Adding custom fields to core components using a plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_custom_fields_to_core_components_using_a_plugin&amp;diff=108546"/>
		<updated>2014-02-25T11:40:24Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: Created page with &amp;quot;Have you ever wished that there was an extra phone number field in com_contact or needed an extra field for articles in com_content? Joomla provides a straight-foward way of i...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Have you ever wished that there was an extra phone number field in com_contact or needed an extra field for articles in com_content? Joomla provides a straight-foward way of integrating new fields with core components such as these. All it takes is a simple content plugin and a template override to achieve.&lt;br /&gt;
&lt;br /&gt;
This article shows how to add an extra field to a core component using the example of adding an additional email address to contacts in com_contact.&lt;br /&gt;
&lt;br /&gt;
==Adding a custom field==&lt;br /&gt;
&lt;br /&gt;
It is recommended that you first read [[Creating a Plugin for Joomla]] for details on how to create and install a plugin, which is not covered here.&lt;br /&gt;
&lt;br /&gt;
To add a field to a system component you need to create a content plugin which picks up the onContentPrepareForm event and inserts it&#039;s own fields into the given JForm. The following code is for Joomla 3.1 and later, for Joomla 2.5 the language files need to be loaded in the constructor (see [[J2.5:Creating a Plugin for Joomla]]).&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;
// no direct access&lt;br /&gt;
defined ( &#039;_JEXEC&#039; ) or die ( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
class plgContentExample extends JPlugin {&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Load the language file on instantiation.&lt;br /&gt;
	 * Note this is only available in Joomla 3.1 and higher.&lt;br /&gt;
	 * If you want to support 3.0 series you must override the constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var boolean&lt;br /&gt;
	 * @since 3.1&lt;br /&gt;
	 */&lt;br /&gt;
	&lt;br /&gt;
	protected $autoloadLanguage = true;&lt;br /&gt;
&lt;br /&gt;
	function onContentPrepareForm($form, $data) {&lt;br /&gt;
		$app = JFactory::getApplication();&lt;br /&gt;
		$option = $app-&amp;gt;input-&amp;gt;get(&#039;option&#039;);&lt;br /&gt;
		&lt;br /&gt;
		switch($option) {&lt;br /&gt;
			&lt;br /&gt;
			case &#039;com_contact&#039;:&lt;br /&gt;
				if ($app-&amp;gt;isAdmin()) {&lt;br /&gt;
					JForm::addFormPath(__DIR__ . &#039;/forms&#039;);&lt;br /&gt;
					$form-&amp;gt;loadFile(&#039;contact&#039;, false);&lt;br /&gt;
				}&lt;br /&gt;
				return true;&lt;br /&gt;
				&lt;br /&gt;
		}&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The additional fields are loaded from the file forms/contact.xml in the plugin directory. It&#039;s important that these fields are in a fields element with the name property set to &amp;quot;params&amp;quot;. If you don&#039;t set this property name the fields will appear in the admin site but the values will not be saved.&lt;br /&gt;
&lt;br /&gt;
In this case we are adding a field for a label to describe the email field in the public website and a second field for the value of the email address.&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;form&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;params&amp;quot; &amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;params&amp;quot; &amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;contact_emaillabel2&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;PLG_CONTENT_EXAMPLE_CONTACT_EMAILLABEL2&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;contact_email2&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;PLG_CONTENT_EXAMPLE_CONTACT_EMAIL2&amp;quot;&lt;br /&gt;
				filter=&amp;quot;email&amp;quot;&lt;br /&gt;
			/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we need a language file so that the parameters are presnted nicely in the admin site and are translatable into different languages. This file needs to be called something like en-GB.plg_content_example.ini.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
COM_CONTACT_PARAMS_FIELDSET_LABEL=&amp;quot;Additional Information&amp;quot;&lt;br /&gt;
PLG_CONTENT_EXAMPLE_CONTACT_EMAIL2=&amp;quot;Additional email address&amp;quot;&lt;br /&gt;
PLG_CONTENT_PHOTOCMS_CONTACT_EMAILLABEL2=&amp;quot;Additional email label&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Displaying the custom field==&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Portal:Plugin_Development/Projects&amp;diff=107315</id>
		<title>Portal:Plugin Development/Projects</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Portal:Plugin_Development/Projects&amp;diff=107315"/>
		<updated>2014-02-05T08:58:55Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: Added a placeholder for a plugin article I&amp;#039;m intending to write.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Plugin Development Articles Needed ==&lt;br /&gt;
The Joomla! Documentation Wiki needs your help! Below is a list of pages/articles needed for Plugin Development. If you know of a topic which needs to be addressed, just add it to the &#039;&#039;&#039;List of Red Links&#039;&#039;&#039; below by using the following wikimarkup.&lt;br /&gt;
{{amboxNew|image=jdoc|text=To add a &#039;&#039;&#039;Red Link&#039;&#039;&#039; {{edit|Portal:Plugin_Development/Projects|click here}} and add it to the &#039;&#039;&#039;Plugins Development Projects page&#039;&#039;&#039;. Please use the following wikimarkup code to add the suggested topic to the list: &lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;*[[Put your Plugin Article name here]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;|title=Want or Need a New Article on Plugin Development?}}&lt;br /&gt;
&lt;br /&gt;
List of Red Links for needed &#039;&#039;&#039;Plugin Develepment&#039;&#039;&#039; Articles:&lt;br /&gt;
*[[Adding custom fields to core components using a plugin]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Landing subpages|{{PAGENAME}}]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Usergroup_form_field_type&amp;diff=104725</id>
		<title>Usergroup form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Usergroup_form_field_type&amp;diff=104725"/>
		<updated>2013-11-04T16:56:13Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: Added &amp;quot;multiple&amp;quot; field for multi-select&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;usergroup&#039;&#039;&#039; form field type provides a modal select box of user groups.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;usergroup&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the &#039;&#039;value_field&#039;&#039; attribute.&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.&lt;br /&gt;
* &#039;&#039;&#039;class&#039;&#039;&#039; (optional) is a CSS class name for the HTML form field.&lt;br /&gt;
* &#039;&#039;&#039;size&#039;&#039;&#039; (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.&lt;br /&gt;
* &#039;&#039;&#039;multiple&#039;&#039;&#039; (optional) If set to &#039;&#039;multiple&#039;&#039; then allows more than one usergroup to be selected.&lt;br /&gt;
&lt;br /&gt;
Implemented by: libraries/joomla/form/fields/usergroup.php&lt;br /&gt;
&lt;br /&gt;
Example user form field definition:&lt;br /&gt;
&amp;lt;source type=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;guest_usergroup&amp;quot; type=&amp;quot;usergroup&amp;quot;&lt;br /&gt;
	label=&amp;quot;COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_LABEL&amp;quot;&lt;br /&gt;
	description=&amp;quot;COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_DESC&amp;quot;&amp;gt;&lt;br /&gt;
	default=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Standard form field types|List of standard form field types]]&lt;br /&gt;
[[Category:Standard form field types]] &amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File_form_field_type&amp;diff=77684</id>
		<title>File form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File_form_field_type&amp;diff=77684"/>
		<updated>2012-11-22T11:30:23Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{{incomplete}}{{review}}&lt;br /&gt;
{{Ambox|type=notice|text=In Joomla! 1.5, [[Form field|form fields]] were [[Parameter|parameters]]. For that version, you may want to use the corresponding [[Text parameter type]].}}&lt;br /&gt;
&lt;br /&gt;
Intro: todo&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;file&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the field.&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&lt;br /&gt;
* &#039;&#039;&#039;default&#039;&#039;&#039; (optional) (not translatable) is the default value, but doesn&#039;t mean much for a file.&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.&lt;br /&gt;
* &#039;&#039;&#039;size&#039;&#039;&#039; (optional) is the width of the file box in characters. &lt;br /&gt;
* [http://www.w3schools.com/tags/att_input_accept.asp &#039;&#039;&#039;accept&#039;&#039;&#039;] (optional) Tells the browser what MIME types your form will allow to be uploaded.&lt;br /&gt;
* &#039;&#039;&#039;class&#039;&#039;&#039; (optional) is a CSS class name for the HTML form field.&lt;br /&gt;
* &#039;&#039;&#039;disabled&#039;&#039;&#039; (optional)  HTML equivalent attribute&lt;br /&gt;
* &#039;&#039;&#039;onchange&#039;&#039;&#039; (optional)  HTML equivalent attribute&lt;br /&gt;
* &#039;&#039;&#039;required&#039;&#039;&#039; (optional)  For Joomla form validating it to be filled in&lt;br /&gt;
* &#039;&#039;&#039;validate&#039;&#039;&#039; (optional)  Whether to Joomla validate the field according to rules&lt;br /&gt;
* &#039;&#039;&#039;onchange&#039;&#039;&#039; (optional)  HTML equivalent attribute (javascript use)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&lt;br /&gt;
You should always add the attribute enctype=&amp;quot;multipart/form-data&amp;quot; to your form tag when using the file input type. Otherwise, the uploaded files will not be attached correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note 2:&#039;&#039;&#039;&lt;br /&gt;
You can put a soft limit file size by adding a hidden field with name=&amp;quot;MAX_FILE_SIZE&amp;quot; and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.&lt;br /&gt;
Example XML field definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;myfilevalue&amp;quot; type=&amp;quot;file&amp;quot; label=&amp;quot;Enter some text&amp;quot; description=&amp;quot;Choose an image from your computer with maximum 100KB&amp;quot; size=&amp;quot;10&amp;quot; accept=&amp;quot;image/*&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Media_form_field_type]]&lt;br /&gt;
* [[Standard form field types|List of standard form field types]]&lt;br /&gt;
[[Category:Standard form field types]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Checkbox_form_field_type&amp;diff=76437</id>
		<title>Checkbox form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Checkbox_form_field_type&amp;diff=76437"/>
		<updated>2012-10-12T19:34:17Z</updated>

		<summary type="html">&lt;p&gt;Waveywhite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;checkbox&#039;&#039;&#039; form field type provides a single checkbox.  If the parameter has a saved value this is selected when the page is first loaded.  If not, the default value (if any) is selected.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be checkbox&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the parameter.&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&lt;br /&gt;
* &#039;&#039;&#039;value&#039;&#039;&#039; (optional) is the value of the parameter if this checkbox is set (usually 1).&lt;br /&gt;
* &#039;&#039;&#039;default&#039;&#039;&#039; (optional) is the default value (usually 0 or 1).&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.&lt;br /&gt;
* &#039;&#039;&#039;class&#039;&#039;&#039; (optional) is a CSS class name for the HTML form field.  If omitted this will default to &#039;inputbox&#039;.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
Example XML field definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;show_title&amp;quot; type=&amp;quot;checkbox&amp;quot; label=&amp;quot;Show title&amp;quot; description=&amp;quot;Show the title of the item&amp;quot; value=&amp;quot;1&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example XML field definition (unchecked):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;show_title&amp;quot; type=&amp;quot;checkbox&amp;quot; label=&amp;quot;Show title&amp;quot; description=&amp;quot;Show the title of the item&amp;quot; value=&amp;quot;1&amp;quot; default=&amp;quot;0&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Standard form field types|List of standard form field types]]&lt;br /&gt;
[[Category:Standard form field types]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waveywhite</name></author>
	</entry>
</feed>