<?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=Dynedain</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=Dynedain"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Dynedain"/>
	<updated>2026-09-03T11:47:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_content_plugin&amp;diff=26664</id>
		<title>J1.5:Creating a content plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_content_plugin&amp;diff=26664"/>
		<updated>2010-04-09T17:04:10Z</updated>

		<summary type="html">&lt;p&gt;Dynedain: /* XML file */  updating DTD&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
==Description==&lt;br /&gt;
There are lots of abilities of the use of a Content Plugin. They all have to do with the display of your content and so your articles. You will need at least two files for this Plugin. An XML file and a PHP file. Because there are so many differences between two Content Plugins in the PHP file, two examples of them will be explained in this document. Also a part about internationalization (with INI files) is added. And last but not least: the Joomla! Core Content Plugin coding examples and the quick tips.&lt;br /&gt;
&lt;br /&gt;
==XML file==&lt;br /&gt;
The XML file is named the same as the PHP file, and is one of the two required files.&lt;br /&gt;
Always start off with the XML tag and define that it is written in a UTF-8 format.&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;!DOCTYPE install&lt;br /&gt;
  PUBLIC &amp;quot;-//Joomla! 1.5//DTD plugin 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd&amp;quot;&amp;gt;&lt;br /&gt;
To define that the plugin has to be a content plugin, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;content&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
The type will define it is a Plugin, the group defines the Plugin is in the group of Content Plugins.&lt;br /&gt;
&lt;br /&gt;
After that, add some information about yourself and the Plugin, like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;Name of your Content Plugin&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;creationDate&amp;gt;Created Date&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
&amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
&amp;lt;authorEmail&amp;gt;Your e-mail address&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
&amp;lt;authorUrl&amp;gt;Your website&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
&amp;lt;copyright&amp;gt;Copyright&amp;lt;/copyright&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;License, for example GNU/GPL&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;version&amp;gt;Version of the plugin&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;lt;description&amp;gt;Description of the Plugin; showed with installation and when editing &lt;br /&gt;
the Plugin in the Plugin Manager&amp;lt;/description&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
And now include your PHP file to the Content Plugin. The name of this file should be the same as the name of this XML file. Put this name also behind the plugin=&amp;quot;&amp;quot; part. &lt;br /&gt;
&lt;br /&gt;
You could also add more files for your plugin, for example an image. Just add another row between &amp;lt;files&amp;gt; and &amp;lt;/files&amp;gt;, and then place the file between &amp;lt;filename&amp;gt; tags.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
   &amp;lt;filename plugin=&amp;quot;nameofplugin&amp;quot;&amp;gt;nameofplugin.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/files&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the internationalization, we will use language files. This is not required, but people from other countries will love it they can easily translate your plugin to their own language. Plugin language files are always installed in administrator/languages/xx-XX/ where xx-XX is the code for a language already installed in Joomla.&lt;br /&gt;
The language tags can be found here: [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes] (use the ISO 639-1 column) and here: [http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&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.plg_content_nameofplugin.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Optionally, you could add some parameters to the Plugin. These will look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;paramname&amp;quot; type=&amp;quot;typeofparameter&amp;quot; default=&amp;quot;defaultsetting&amp;quot; label=&amp;quot;title&amp;quot; description=&amp;quot;description&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Param name:&#039;&#039;&#039; The name of the parameter. You will need this when creating the PHP file.&lt;br /&gt;
*&#039;&#039;&#039;Param type:&#039;&#039;&#039; You could choose between several types of parameters. Look at this document to learn something about the different types: [http://docs.joomla.org/Using_the_core_parameter_types] &lt;br /&gt;
*&#039;&#039;&#039;Param default:&#039;&#039;&#039; The default setting for this parameter.&lt;br /&gt;
*&#039;&#039;&#039;Param label:&#039;&#039;&#039; The name of this parameter displayed in the edit screen of this Plugin in the Plugin Manager.&lt;br /&gt;
*&#039;&#039;&#039;Param description:&#039;&#039;&#039; The text which appears as a tool tip for this parameter. &lt;br /&gt;
When you do not want to use parameters, add the following tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;params/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And do not forget to end your XML file with the following tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/install&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PHP file==&lt;br /&gt;
Start your PHP file with the general licensing and author information about your content plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @version		$Id: nameofplugin.php revision date lasteditedby $&lt;br /&gt;
 * @package		Joomla&lt;br /&gt;
 * @subpackage	Content&lt;br /&gt;
 * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.&lt;br /&gt;
 * @license		GNU/GPL, see LICENSE.php&lt;br /&gt;
 * Joomla! is free software. This version may have been modified pursuant&lt;br /&gt;
 * to the GNU General Public License, and as distributed it includes or&lt;br /&gt;
 * is derivative of works licensed under the GNU General Public License or&lt;br /&gt;
 * other free or open source software licenses.&lt;br /&gt;
 * See COPYRIGHT.php for copyright notices and details.&lt;br /&gt;
 */ &amp;lt;/source&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Next, always put the following code in any PHP file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
// no direct access&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&amp;lt;/source&amp;gt;&lt;br /&gt;
This prevents people from directly accessing this PHP file.&lt;br /&gt;
&lt;br /&gt;
After that, you should import the general plugin file of Joomla!&#039;s library&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;jimport( &#039;joomla.plugin.plugin&#039; );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To indicate that you&#039;re writing a Content plugin, add the following code.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;class plgContentNameofplugin extends JPlugin {&amp;lt;/source&amp;gt;&lt;br /&gt;
Please note the use of capital letters. You should replace Nameofplugin by the name of your own plugin.&lt;br /&gt;
&lt;br /&gt;
Now, it&#039;s time to construct the plugin:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;/**&lt;br /&gt;
 * Constructor&lt;br /&gt;
 *&lt;br /&gt;
 * For php4 compatability we must not use the __constructor as a constructor for plugins&lt;br /&gt;
 * because func_get_args ( void ) returns a copy of all passed arguments NOT references.&lt;br /&gt;
 * This causes problems with cross-referencing necessary for the observer design pattern.&lt;br /&gt;
 *&lt;br /&gt;
 * @param object $subject The object to observe&lt;br /&gt;
 * @param object $params  The object that holds the plugin parameters&lt;br /&gt;
 * @since 1.5&lt;br /&gt;
 */&lt;br /&gt;
	function plgContentNameofplugin( &amp;amp;$subject, $params )&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( $subject, $params );&lt;br /&gt;
	}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should choose now at which moment the plugin should be rendered. You can choose from the following:&lt;br /&gt;
&lt;br /&gt;
* onBeforeContentSave : This is an event that is called right before the content is saved into the database.&lt;br /&gt;
* onAfterContentSave : This is an event that is called after the content is saved into the database.&lt;br /&gt;
* onPrepareContent : This is the first stage in preparing content for output and is the most common point for content orientated plugins to do their work.&lt;br /&gt;
* onAfterDisplayTitle : This is a request for information that should be placed between the content title and the content body.&lt;br /&gt;
* onBeforeDisplayContent : This is a request for information that should be placed immediately before the generated content.&lt;br /&gt;
* onAfterDisplayContent : This is a request for information that should be placed immediately after the generated content.&lt;br /&gt;
&lt;br /&gt;
More information on which type you should use for your plugin, including several examples, can be found here: [[Reference:Content_Events_for_Plugin_System]]&lt;br /&gt;
&lt;br /&gt;
===onBeforeContentSave===&lt;br /&gt;
Use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;	function onBeforeContentSave( &amp;amp;$article, $isNew )&lt;br /&gt;
	{&lt;br /&gt;
		global $mainframe;&lt;br /&gt;
		//add your plugin codes here&lt;br /&gt;
		return true;&lt;br /&gt;
	}&amp;lt;/source&amp;gt;&lt;br /&gt;
The parameters article and isNew should contain the following:&lt;br /&gt;
* article : A reference to the JTableContent object that is being saved which holds the article data.&lt;br /&gt;
* isNew : A boolean which is set to true if the content is about to be created.&lt;br /&gt;
&lt;br /&gt;
===onAfterContentSave===&lt;br /&gt;
Use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;	function onAfterContentSave( &amp;amp;$article, $isNew )&lt;br /&gt;
	{&lt;br /&gt;
		global $mainframe;&lt;br /&gt;
		//add your plugin codes here&lt;br /&gt;
		return true;&lt;br /&gt;
	}&amp;lt;/source&amp;gt;&lt;br /&gt;
The parameters article and isNew should contain the following:&lt;br /&gt;
* article : A reference to the JTableContent object that was saved which holds the article data.&lt;br /&gt;
* isNew : A boolean which is set to true if the content was created.&lt;br /&gt;
&lt;br /&gt;
===onPrepareContent===&lt;br /&gt;
Use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;	function onPrepareContent( &amp;amp;$article, &amp;amp;$params, $limitstart )&lt;br /&gt;
	{&lt;br /&gt;
		global $mainframe;&lt;br /&gt;
		//add your plugin codes here&lt;br /&gt;
		//no return value&lt;br /&gt;
	}&amp;lt;/source&amp;gt;&lt;br /&gt;
The parameters article, params and limitstart should contain the following:&lt;br /&gt;
* article : A reference to the article that is being rendered by the view.&lt;br /&gt;
* params : A reference to an associative array of relevant parameters. The view determines what it considers to be relevant and passes that information along.&lt;br /&gt;
* limitstart : An integer that determines the &amp;quot;page&amp;quot; of the content that is to be generated. Note that in the context of views that might not generate HTML output, a page is a reasonably abstract concept that depends on the context.&lt;br /&gt;
&lt;br /&gt;
===onAfterDisplayTitle===&lt;br /&gt;
Use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;	function onAfterDisplayTitle( &amp;amp;$article, &amp;amp;$params, $limitstart )&lt;br /&gt;
	{&lt;br /&gt;
		global $mainframe;&lt;br /&gt;
		//add your plugin codes here&lt;br /&gt;
		return &#039;&#039;;&lt;br /&gt;
		//return a string value. Returned value from this event will be displayed in a placeholder. &lt;br /&gt;
                // Most templates display this placeholder after the article separator.&lt;br /&gt;
	}&amp;lt;/source&amp;gt;&lt;br /&gt;
The parameters article, params and limitstart should contain the following:&lt;br /&gt;
* article : A reference to the article that is being rendered by the view.&lt;br /&gt;
* params : A reference to an associative array of relevant parameters. The view determines what it considers to be relevant and passes that information along.&lt;br /&gt;
* limitstart : An integer that determines the &amp;quot;page&amp;quot; of the content that is to be generated. Note that in the context of views that might not generate HTML output, a page is a reasonably abstract concept that depends on the context.&lt;br /&gt;
	&lt;br /&gt;
===onBeforeDisplayContent===&lt;br /&gt;
Use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;	function onBeforeDisplayContent( &amp;amp;$article, &amp;amp;$params, $limitstart )&lt;br /&gt;
	{&lt;br /&gt;
		global $mainframe;&lt;br /&gt;
		//add your plugin codes here&lt;br /&gt;
		return &#039;&#039;;&lt;br /&gt;
		//return a string value. Returned value from this event will be displayed in a placeholder. &lt;br /&gt;
                // Most templates display this placeholder after the article separator. &lt;br /&gt;
	}&amp;lt;/source&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
The parameters article, params and limitstart should contain the following:&lt;br /&gt;
* article : A reference to the article that is being rendered by the view.&lt;br /&gt;
* params : A reference to an associative array of relevant parameters. The view determines what it considers to be relevant and passes that information along.&lt;br /&gt;
* limitstart : An integer that determines the &amp;quot;page&amp;quot; of the content that is to be generated. Note that in the context of views that might not generate HTML output, a page is a reasonably abstract concept that depends on the context.&lt;br /&gt;
&lt;br /&gt;
===onAfterDisplayContent===&lt;br /&gt;
Use the following code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;	function onAfterDisplayContent( &amp;amp;$article, &amp;amp;$params, $limitstart )&lt;br /&gt;
	{&lt;br /&gt;
		global $mainframe;&lt;br /&gt;
//add your plugin codes here&lt;br /&gt;
		return &#039;&#039;;&lt;br /&gt;
		//return a string value. Returned value from this event will be displayed in a placeholder. &lt;br /&gt;
                // Most templates display this placeholder after the article separator.&lt;br /&gt;
	}&amp;lt;/source&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
The parameters article, params and limitstart should contain the following:&lt;br /&gt;
* article : A reference to the article that is being rendered by the view.&lt;br /&gt;
* params : A reference to an associative array of relevant parameters. The view determines what it considers to be relevant and passes that information along.&lt;br /&gt;
* limitstart : An integer that determines the &amp;quot;page&amp;quot; of the content that is to be generated. Note that in the context of views that might not generate HTML output, a page is a reasonably abstract concept that depends on the context.&lt;br /&gt;
&lt;br /&gt;
==PHP file - Example==&lt;br /&gt;
This example PHP file is about the Content Plugin load module. It is a plugin made for displaying modules within the articles. &lt;br /&gt;
The commented PHP file used in this example is the file which will be included in Joomla! 1.6. This has been done because the content plugin files in Joomla! 1.5 are not refactored yet to the new standards. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// The general information at the top of each file&lt;br /&gt;
/**&lt;br /&gt;
* @version		$Id$&lt;br /&gt;
* @package		Joomla&lt;br /&gt;
* @copyright	Copyright (C) 2005 - 2009 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
* @license		GNU General Public License, see LICENSE.php&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
// No direct access allowed to this file&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
// Import Joomla! Plugin library file&lt;br /&gt;
jimport(&#039;joomla.plugin.plugin&#039;);&lt;br /&gt;
&lt;br /&gt;
//The Content plugin Loadmodule&lt;br /&gt;
class plgContentLoadmodule extends JPlugin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	* Plugin that loads module positions within content&lt;br /&gt;
	*/&lt;br /&gt;
// onPrepareContent, meaning the plugin is rendered at the first stage in preparing content for output&lt;br /&gt;
	public function onPrepareContent( &amp;amp;$row, &amp;amp;$params, $page=0 )&lt;br /&gt;
	{&lt;br /&gt;
                // A database connection is created&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
		// simple performance check to determine whether bot should process further&lt;br /&gt;
		if ( JString::strpos( $row-&amp;gt;text, &#039;loadposition&#039; ) === false ) {&lt;br /&gt;
			return true;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	 	// expression to search for&lt;br /&gt;
	 	$regex = &#039;/{loadposition\s*.*?}/i&#039;;&lt;br /&gt;
&lt;br /&gt;
		// check whether plugin has been unpublished&lt;br /&gt;
		if ( !$this-&amp;gt;params-&amp;gt;get( &#039;enabled&#039;, 1 ) ) {&lt;br /&gt;
			$row-&amp;gt;text = preg_replace( $regex, &#039;&#039;, $row-&amp;gt;text );&lt;br /&gt;
			return true;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	 	// find all instances of plugin and put in $matches&lt;br /&gt;
		preg_match_all( $regex, $row-&amp;gt;text, $matches );&lt;br /&gt;
&lt;br /&gt;
		// Number of plugins&lt;br /&gt;
	 	$count = count( $matches[0] );&lt;br /&gt;
&lt;br /&gt;
	 	// plugin only processes if there are any instances of the plugin in the text&lt;br /&gt;
	 	if ( $count ) {&lt;br /&gt;
			// Get plugin parameters&lt;br /&gt;
		 	$style	= $this-&amp;gt;params-&amp;gt;def( &#039;style&#039;, -2 );&lt;br /&gt;
	 		$this-&amp;gt;_process( $row, $matches, $count, $regex, $style );&lt;br /&gt;
		}&lt;br /&gt;
		// No return value&lt;br /&gt;
	}&lt;br /&gt;
// The proccessing function&lt;br /&gt;
	protected function _process( &amp;amp;$row, &amp;amp;$matches, $count, $regex, $style )&lt;br /&gt;
	{&lt;br /&gt;
	 	for ( $i=0; $i &amp;lt; $count; $i++ )&lt;br /&gt;
		{&lt;br /&gt;
	 		$load = str_replace( &#039;loadposition&#039;, &#039;&#039;, $matches[0][$i] );&lt;br /&gt;
	 		$load = str_replace( &#039;{&#039;, &#039;&#039;, $load );&lt;br /&gt;
	 		$load = str_replace( &#039;}&#039;, &#039;&#039;, $load );&lt;br /&gt;
 			$load = trim( $load );&lt;br /&gt;
&lt;br /&gt;
			$modules	= $this-&amp;gt;_load( $load, $style );&lt;br /&gt;
			$row-&amp;gt;text 	= preg_replace( &#039;{&#039;. $matches[0][$i] .&#039;}&#039;, $modules, $row-&amp;gt;text );&lt;br /&gt;
	 	}&lt;br /&gt;
&lt;br /&gt;
	  	// removes tags without matching module positions&lt;br /&gt;
		$row-&amp;gt;text = preg_replace( $regex, &#039;&#039;, $row-&amp;gt;text );&lt;br /&gt;
	}&lt;br /&gt;
// The function who takes care for the &#039;completing&#039; of the plugins&#039; actions : loading the module(s)&lt;br /&gt;
	protected function _load( $position, $style=-2 )&lt;br /&gt;
	{&lt;br /&gt;
		$document	= &amp;amp;JFactory::getDocument();&lt;br /&gt;
		$renderer	= $document-&amp;gt;loadRenderer(&#039;module&#039;);&lt;br /&gt;
		$params		= array(&#039;style&#039;=&amp;gt;$style);&lt;br /&gt;
&lt;br /&gt;
		$contents = &#039;&#039;;&lt;br /&gt;
		foreach (JModuleHelper::getModules($position) as $mod)  {&lt;br /&gt;
			$contents .= $renderer-&amp;gt;render($mod, $params);&lt;br /&gt;
		}&lt;br /&gt;
		return $contents;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==INI file(s)==&lt;br /&gt;
For internationalization it is good to use the INI files. You can add to the language file everyting which outputs text to the user, in this order: &lt;br /&gt;
*XML description tag &lt;br /&gt;
*XML label and description attributes from parameters &lt;br /&gt;
*JText::_( &#039;string&#039; ) used by the plugin &lt;br /&gt;
Start your INI file with something like this: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;# $Id: en-GB.plg_content_nameofplugin.ini&lt;br /&gt;
# Joomla! Project&lt;br /&gt;
# Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.&lt;br /&gt;
# License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php&lt;br /&gt;
# Note : All ini files need to be saved as UTF-8 - No BOM&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course, you could also add other information, like the author. &lt;br /&gt;
&lt;br /&gt;
For example, this parameter: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;XML&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;param name=&amp;quot;mode&amp;quot; type=&amp;quot;list&amp;quot; default=&amp;quot;1&amp;quot; label=&amp;quot;Mode&amp;quot; description=&amp;quot;Select how the emails will be displayed&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;Nonlinkable Text&amp;lt;/option&amp;gt;&lt;br /&gt;
   &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;As linkable mailto address&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/param&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Will cause the following in the INI file: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
MODE=Mode&lt;br /&gt;
SELECT HOW THE EMAILS WILL BE DISPLAYED=Select how the e-mails will be displayed&lt;br /&gt;
NONLINKABLE TEXT=Nonlinkable text&lt;br /&gt;
AS LINKABLE MAILTO ADDRESS=As linkable mailto address&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The file looks repetitive, but will be very useful for translaters. &lt;br /&gt;
&lt;br /&gt;
When you want to make your Content Plugin available in more languages, first add them to the &amp;lt;languages&amp;gt; tag in the XML file. Then create the same INI file, and change the part after the =, for example the dutch version would be: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
MODE=Modus&lt;br /&gt;
SELECT HOW THE EMAILS WILL BE DISPLAYED=Selecteer hoe de e-mails worden weergegeven&lt;br /&gt;
NONLINKABLE TEXT=Niet-linkbare tekst&lt;br /&gt;
AS LINKABLE MAILTO ADDRESS=Als een linkbaar mailto adres&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Coding examples==&lt;br /&gt;
There are seven Joomla! Core Content Plugins. These are all not yet refactored to the new standards. For learning how to write good plugins, its better to look at the (refactored) files of Joomla! 1.6.&lt;br /&gt;
You can see them &#039;working&#039; when you go to the Back-end of your Joomla! 1.5 installation, then go to the menu &#039;Extensions&#039; and select the &#039;Plugin Manager&#039;. Click on the name of the Plugin to edit it; and see it working. Also watch the content and see what happens when you insert a pagebreak for example.&lt;br /&gt;
&lt;br /&gt;
==Quick tips==&lt;br /&gt;
*In the PHP file you often forget to place an semicolon (;) at the end of a row, which causes errors. Check this before you test your Plugin and you will eliminate many errors. &lt;br /&gt;
*Take care of the fact that the parameters in the XML file are closed correctly. When you add options for example, you need to close it with &amp;lt;/param&amp;gt;. &lt;br /&gt;
*It is easy to test on a localhost when you are still busy with editing your Plugin. &lt;br /&gt;
*A typical zip will contain the following: &lt;br /&gt;
**nameofplugin.XML &lt;br /&gt;
**nameofplugin.PHP &lt;br /&gt;
**en-GB.plg_content_nameofplugin.ini&lt;/div&gt;</summary>
		<author><name>Dynedain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=26663</id>
		<title>J1.5:Creating a search plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=26663"/>
		<updated>2010-04-09T17:03:32Z</updated>

		<summary type="html">&lt;p&gt;Dynedain: /* XML file */  updating DTD&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
==Description==&lt;br /&gt;
This document is about how to create a Search Plugin. You can use a Search Plugin to search through the database of your Joomla! site. To create a plugin, you will at least need two files; an XML file and a PHP file. For internationalization it is good to create an INI file as well. &lt;br /&gt;
&lt;br /&gt;
==XML file==&lt;br /&gt;
The XML file is named the same as the PHP file, and is one of the two required files.&lt;br /&gt;
Always start off with the XML tag and define that it is written in a UTF-8 format.&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;!DOCTYPE install PUBLIC&lt;br /&gt;
    &amp;quot;-//Joomla! 1.5//DTD plugin 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd&amp;quot;&amp;gt;&lt;br /&gt;
To define that the plugin has to be a search plugin, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;search&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
The type will define it is a plugin, the group defines the Plugin is in the group of search plugins.&lt;br /&gt;
&lt;br /&gt;
After that, add some information about yourself and the plugin, like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;Name of your search plugin&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;creationDate&amp;gt;Creation date&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
&amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
&amp;lt;authorEmail&amp;gt;Your e-mail address&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
&amp;lt;authorUrl&amp;gt;Your website&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
&amp;lt;copyright&amp;gt;Copyright information&amp;lt;/copyright&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;License, for example GNU/GPL&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;version&amp;gt;Version of the plugin&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;lt;description&amp;gt;Description of the plugin; showed during installation and when editing &lt;br /&gt;
the plugin in the Plugin Manager&amp;lt;/description&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
And now, include your PHP file to the Search Plugin. The name of this file should be the same as the name of this XML file. Put this name also behind the plugin=&amp;quot;&amp;quot; part. &lt;br /&gt;
&lt;br /&gt;
You could also add more files for your plugin, for example an image. Just add another row between &amp;lt;files&amp;gt; and &amp;lt;/file&amp;gt;, and then place the file between &amp;lt;filename&amp;gt; tags.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
   &amp;lt;filename plugin=&amp;quot;nameofplugin&amp;quot;&amp;gt;nameofplugin.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/files&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the internationalization, we will use language files. This is not required, but people from other countries will love it they can easily translate your plugin to their own language.&lt;br /&gt;
The language tags can be found here: [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes] (use the ISO 639-1 column) and here: [http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&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;language/en-GB/en-GB.plg_search_nameofplugin.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Optionally, you could add some parameters to the plugin. These will look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;paramname&amp;quot; type=&amp;quot;typeofparameter&amp;quot; default=&amp;quot;defaultsetting&amp;quot; label=&amp;quot;title&amp;quot; description=&amp;quot;description&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Param name:&#039;&#039;&#039; The name of the parameter. You will need this when creating the PHP file.&lt;br /&gt;
*&#039;&#039;&#039;Param type:&#039;&#039;&#039; You could choose between several types of parameters. Look at this document to learn something about the different types: [http://docs.joomla.org/Using_the_core_parameter_types] &lt;br /&gt;
*&#039;&#039;&#039;Param default:&#039;&#039;&#039; The default setting for this parameter.&lt;br /&gt;
*&#039;&#039;&#039;Param label:&#039;&#039;&#039; The name of this parameter displayed in the edit screen of this plugin in the Plugin Manager.&lt;br /&gt;
*&#039;&#039;&#039;Param description:&#039;&#039;&#039; The text which appears as a tool tip for this parameter. &lt;br /&gt;
&lt;br /&gt;
And do not forget to end your XML file with the following tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/install&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PHP file==&lt;br /&gt;
The PHP file of your plugin is probably the most important file of the plugin. This is an example PHP file of a search plugin. The comments are included. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
//First start with information about the Plugin and yourself. For example:&lt;br /&gt;
/**&lt;br /&gt;
 * @version		$Id: nameofplugin.php versionnumber date author&lt;br /&gt;
 * @copyright	        Copyright&lt;br /&gt;
 * @license		License, for example GNU/GPL&lt;br /&gt;
 * All other information you would like to add&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
//To prevent accessing the document directly, enter this code:&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;
//Now define the registerEvent and the language file. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearch&#039;, &#039;plgSearchnameofplugin&#039; );&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearchAreas&#039;, &#039;plgSearchnameofpluginAreas&#039; );&lt;br /&gt;
&lt;br /&gt;
JPlugin::loadLanguage( &#039;plg_search_nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//Then define a function to return an array of search areas. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
function &amp;amp;plgSearchnameofpluginAreas()&lt;br /&gt;
{&lt;br /&gt;
	static $areas = array(&lt;br /&gt;
		&#039;nameofplugin&#039; =&amp;gt; &#039;Nameofplugin&#039;&lt;br /&gt;
	);&lt;br /&gt;
	return $areas;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Then the real function has to be created. The database connection should be made. &lt;br /&gt;
//The function will be closed with an } at the end of the file.&lt;br /&gt;
function plgSearchnameofplugin( $text, $phrase=&#039;&#039;, $ordering=&#039;&#039;, $areas=null )&lt;br /&gt;
{&lt;br /&gt;
	$db		=&amp;amp; JFactory::getDBO();&lt;br /&gt;
	$user	=&amp;amp; JFactory::getUser(); &lt;br /&gt;
&lt;br /&gt;
//If the array is not correct, return it:&lt;br /&gt;
	if (is_array( $areas )) {&lt;br /&gt;
		if (!array_intersect( $areas, array_keys( plgSearchnameofpluginAreas() ) )) {&lt;br /&gt;
			return array();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//It is time to define the parameters! First get the right plugin; &#039;search&#039; (the group), &#039;nameofplugin&#039;. &lt;br /&gt;
$plugin =&amp;amp; JPluginHelper::getPlugin(&#039;search&#039;, &#039;nameofplugin&#039;);&lt;br /&gt;
&lt;br /&gt;
//Then load the parameters of the plugin..&lt;br /&gt;
$pluginParams = new JParameter( $plugin-&amp;gt;params );&lt;br /&gt;
&lt;br /&gt;
//And define the parameters. For example like this..&lt;br /&gt;
$limit = $pluginParams-&amp;gt;def( &#039;nameofparameter&#039;, defaultsetting );&lt;br /&gt;
&lt;br /&gt;
//Use the function trim to delete spaces in front of or at the back of the searching terms&lt;br /&gt;
$text = trim( $text );&lt;br /&gt;
&lt;br /&gt;
//Return Array when nothing was filled in&lt;br /&gt;
if ($text == &#039;&#039;) {&lt;br /&gt;
		return array();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//After this, you have to add the database part. This will be the most difficult part, because this changes per situation.&lt;br /&gt;
//In the coding examples later on you will find some of the examples used by Joomla! 1.5 core Search Plugins.&lt;br /&gt;
//It will look something like this.&lt;br /&gt;
	$wheres = array();&lt;br /&gt;
	switch ($phrase) {&lt;br /&gt;
&lt;br /&gt;
//search exact&lt;br /&gt;
		case &#039;exact&#039;:&lt;br /&gt;
			$text		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $text, true ).&#039;%&#039;, false );&lt;br /&gt;
			$wheres2 	= array();&lt;br /&gt;
			$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$text;&lt;br /&gt;
			$where 		= &#039;(&#039; . implode( &#039;) OR (&#039;, $wheres2 ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//search all or any&lt;br /&gt;
		case &#039;all&#039;:&lt;br /&gt;
		case &#039;any&#039;:&lt;br /&gt;
&lt;br /&gt;
//set default&lt;br /&gt;
		default:&lt;br /&gt;
			$words 	= explode( &#039; &#039;, $text );&lt;br /&gt;
			$wheres = array();&lt;br /&gt;
			foreach ($words as $word)&lt;br /&gt;
			{&lt;br /&gt;
				$word		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $word, true ).&#039;%&#039;, false );&lt;br /&gt;
				$wheres2 	= array();&lt;br /&gt;
				$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$word;&lt;br /&gt;
				$wheres[] 	= implode( &#039; OR &#039;, $wheres2 );&lt;br /&gt;
			}&lt;br /&gt;
			$where = &#039;(&#039; . implode( ($phrase == &#039;all&#039; ? &#039;) AND (&#039; : &#039;) OR (&#039;), $wheres ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//ordering of the results&lt;br /&gt;
	switch ( $ordering ) {&lt;br /&gt;
&lt;br /&gt;
//alphabetic, ascending&lt;br /&gt;
		case &#039;alpha&#039;:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//oldest first&lt;br /&gt;
		case &#039;oldest&#039;:&lt;br /&gt;
&lt;br /&gt;
//popular first&lt;br /&gt;
		case &#039;popular&#039;:&lt;br /&gt;
&lt;br /&gt;
//newest first&lt;br /&gt;
		case &#039;newest&#039;:&lt;br /&gt;
&lt;br /&gt;
//default setting: alphabetic, ascending&lt;br /&gt;
		default:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//replace nameofplugin&lt;br /&gt;
	$searchNameofplugin = JText::_( &#039;Nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//the database query; differs per situation! It will look something like this:&lt;br /&gt;
	$query = &#039;SELECT a.name AS title,&#039;&lt;br /&gt;
	. &#039; CONCAT_WS( &amp;quot; / &amp;quot;, &#039;. $db-&amp;gt;Quote($searchNameofplugin) .&#039;, b.title )AS section,&#039;&lt;br /&gt;
	. &#039; &amp;quot;1&amp;quot; AS browsernav&#039;&lt;br /&gt;
	. &#039; FROM #__nameofplugin AS a&#039;&lt;br /&gt;
	. &#039; INNER JOIN #__categories AS b ON b.id = a.catid&#039;&lt;br /&gt;
	. &#039; WHERE ( &#039;. $where .&#039; )&#039;&lt;br /&gt;
	. &#039; AND a.published = 1&#039;&lt;br /&gt;
	. &#039; AND b.access &amp;lt;= &#039;. (int) $user-&amp;gt;get( &#039;aid&#039; )&lt;br /&gt;
	. &#039; ORDER BY &#039;. $order&lt;br /&gt;
	;&lt;br /&gt;
&lt;br /&gt;
//Set query&lt;br /&gt;
	$db-&amp;gt;setQuery( $query, 0, $limit );&lt;br /&gt;
	$rows = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&lt;br /&gt;
//The &#039;output&#039; of the displayed link&lt;br /&gt;
	foreach($rows as $key =&amp;gt; $row) {&lt;br /&gt;
		$rows[$key]-&amp;gt;href = &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//Return the search results in an array&lt;br /&gt;
return $rows;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 4 variables that get passed in, which are evident by their names and use in the above code.&lt;br /&gt;
What&#039;s not obvious is what the function should return. An array of objects that the search tool uses to display the results. The results could alternatively have been assembled something like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
$rows[] = (object) array(&lt;br /&gt;
			&#039;href&#039;        =&amp;gt; &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug,&lt;br /&gt;
			&#039;title&#039;       =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;section&#039;     =&amp;gt; $searchnameofplugin,&lt;br /&gt;
			&#039;created&#039;     =&amp;gt; $row[&#039;date&#039;],&lt;br /&gt;
			&#039;text&#039;        =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;browsernav&#039;  =&amp;gt; &#039;1&#039;&lt;br /&gt;
		);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==INI file(s)==&lt;br /&gt;
For internationalization it is good to use the INI files. You can add everything to the language file that outputs text to the user, in this order:&lt;br /&gt;
*XML description tag&lt;br /&gt;
*XML label and description attributes from parameters&lt;br /&gt;
*JText::_( &#039;string&#039; ) used by the plugin&lt;br /&gt;
&lt;br /&gt;
Start your INI file with something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;# $Id: en-GB.plg_search_nameofplugin.ini&lt;br /&gt;
# Joomla! Project&lt;br /&gt;
# Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.&lt;br /&gt;
# License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php&lt;br /&gt;
# Note : All ini files need to be saved as UTF-8 - No BOM&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course, you could also add other information, like the author. &lt;br /&gt;
&lt;br /&gt;
For example, this parameter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;XML&amp;quot;&amp;gt;&amp;lt;param name=&amp;quot;search_limit&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;5&amp;quot; default=&amp;quot;50&amp;quot; label=&amp;quot;Search Limit&amp;quot; &lt;br /&gt;
description=&amp;quot;Number of Search items to return&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Will cause the following output in the INI file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Search Limit&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Number of Search items to return&amp;lt;/source&amp;gt;&lt;br /&gt;
The file looks repetitive, but will be very useful for translaters.&lt;br /&gt;
&lt;br /&gt;
When you want to make your search plugin available in more languages, first add them to the &amp;lt;languages&amp;gt; tag in the XML file. Then create the same INI file, and change the part after the =, for example the dutch version would be:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Zoek limiet&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Aantal weer te geven zoekresultaten&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Coding examples==&lt;br /&gt;
There are six Joomla! Core Search Plugins. If you look at them you can learn a lot, especially about the query part.&lt;br /&gt;
You can see them &#039;working&#039; when you go to the back-end of your Joomla! 1.5 installation, then go to the menu &#039;Extensions&#039; and select the &#039;Plugin Manager&#039;. Click on the name of the plugin to edit it; and see it working.&lt;br /&gt;
*Plugin Search - Categories&lt;br /&gt;
**\plugins\search\categories.XML&lt;br /&gt;
**\plugins\search\categories.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_categories.INI&lt;br /&gt;
*Plugin Search - Contacts&lt;br /&gt;
**\plugins\search\contacts.XML&lt;br /&gt;
**\plugins\search\contacts.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_contacts.INI&lt;br /&gt;
*Plugin Search - Content&lt;br /&gt;
**\plugins\search\content.XML&lt;br /&gt;
**\plugins\search\content.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_content.INI&lt;br /&gt;
*Plugin Search - Newsfeeds&lt;br /&gt;
**\plugins\search\newsfeeds.XML&lt;br /&gt;
**\plugins\search\newsfeeds.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_newsfeeds.INI&lt;br /&gt;
*Plugin Search - Sections&lt;br /&gt;
**\plugins\search\sections.XML&lt;br /&gt;
**\plugins\search\sections.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_sections.INI&lt;br /&gt;
*Plugin Search - Weblinks&lt;br /&gt;
**\plugins\search\weblinks.XML&lt;br /&gt;
**\plugins\search\weblinks.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_weblinks.INI&lt;br /&gt;
&lt;br /&gt;
==Quick tips==&lt;br /&gt;
*In the PHP file, people often forget to place an semicolon (;) at the end of a row. This causes errors. Check this before you test your plugin.&lt;br /&gt;
*Make sure the parameters in the XML file are closed correctly. When you add options, for example, you need to close it with &amp;lt;/param&amp;gt;.&lt;br /&gt;
*It is easy to test on a localhost when you are still busy with editing your plugin.&lt;br /&gt;
*When making a zip-file to test it, do not forget to make the directories for the language files. A typical zip will contain the following:&lt;br /&gt;
**nameofplugin.XML&lt;br /&gt;
**nameofplugin.PHP&lt;br /&gt;
**language\en-GB\en-GB.plg_search_nameofplugin.INI&lt;/div&gt;</summary>
		<author><name>Dynedain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Creating_a_basic_templateDetails.xml_file&amp;diff=26662</id>
		<title>Creating a basic templateDetails.xml file</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Creating_a_basic_templateDetails.xml_file&amp;diff=26662"/>
		<updated>2010-04-09T17:01:32Z</updated>

		<summary type="html">&lt;p&gt;Dynedain: updating doctype&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;tt&amp;gt;templateDetails.xml&amp;lt;/tt&amp;gt; file is essential. Without it, your template won&#039;t be seen by Joomla!. The file holds key &amp;quot;metadata&amp;quot; about the template. &lt;br /&gt;
&lt;br /&gt;
Lets look at an example:&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;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD template 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/template-install.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;template&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;mynewtemplate&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;2008-05-01&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@example.com&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.com&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;John Doe 2008&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;GNU/GPL&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;1.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;My New Template&amp;lt;/description&amp;gt;&lt;br /&gt;
	&amp;lt;files&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;component.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;templateDetails.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;template_thumbnail.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;images/background.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;css/style.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;positions&amp;gt;&lt;br /&gt;
		&amp;lt;position&amp;gt;breadcrumb&amp;lt;/position&amp;gt;&lt;br /&gt;
		&amp;lt;position&amp;gt;left&amp;lt;/position&amp;gt;&lt;br /&gt;
		&amp;lt;position&amp;gt;right&amp;lt;/position&amp;gt;&lt;br /&gt;
		&amp;lt;position&amp;gt;top&amp;lt;/position&amp;gt;&lt;br /&gt;
		&amp;lt;position&amp;gt;user1&amp;lt;/position&amp;gt;&lt;br /&gt;
		&amp;lt;position&amp;gt;user2&amp;lt;/position&amp;gt;&lt;br /&gt;
		&amp;lt;position&amp;gt;user3&amp;lt;/position&amp;gt;&lt;br /&gt;
		&amp;lt;position&amp;gt;user4&amp;lt;/position&amp;gt;&lt;br /&gt;
		&amp;lt;position&amp;gt;footer&amp;lt;/position&amp;gt;&lt;br /&gt;
	&amp;lt;/positions&amp;gt;&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So, as you can see, we have a set of information between markup tags ( the &amp;amp;lt;thing&amp;gt; ). Your best approach is to cut and paste this into your &amp;quot;templateDetails.xml&amp;quot; file and change the relevant bits (such as &amp;lt;name&amp;gt; &amp;lt;author&amp;gt; ).&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;lt;files&amp;gt; part should contain all the files that you use - you possibly don&#039;t know what they are called yet - don&#039;t worry update it later.&lt;br /&gt;
&lt;br /&gt;
Leave the positions as they are - these are a common set so you will be able to switch easily from the standard templates.&lt;/div&gt;</summary>
		<author><name>Dynedain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=DocType_header_for_templates&amp;diff=26661</id>
		<title>DocType header for templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=DocType_header_for_templates&amp;diff=26661"/>
		<updated>2010-04-09T17:00:20Z</updated>

		<summary type="html">&lt;p&gt;Dynedain: /* Joomla Internal XML DocTypes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Current thinking is that XHTML 1.0 Transitional should be used for Joomla! templates.&lt;br /&gt;
&lt;br /&gt;
===Recommended DocTypes===&lt;br /&gt;
{{:Recommended DocTypes|}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References about DocTypes===&lt;br /&gt;
{{:References about DocTypes|}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Beginners]][[Category:Templates]][[Category:Topics]][[Category:HTML|DocType]][[Category:Template FAQ]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dynedain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=DocType_header_for_templates&amp;diff=26660</id>
		<title>DocType header for templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=DocType_header_for_templates&amp;diff=26660"/>
		<updated>2010-04-09T16:59:35Z</updated>

		<summary type="html">&lt;p&gt;Dynedain: /* Recommended DocTypes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Current thinking is that XHTML 1.0 Transitional should be used for Joomla! templates.&lt;br /&gt;
&lt;br /&gt;
===Recommended DocTypes===&lt;br /&gt;
{{:Recommended DocTypes|}}&lt;br /&gt;
&lt;br /&gt;
===Joomla Internal XML DocTypes===&lt;br /&gt;
{{:Official DTDs}}&lt;br /&gt;
&lt;br /&gt;
===References about DocTypes===&lt;br /&gt;
{{:References about DocTypes|}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Beginners]][[Category:Templates]][[Category:Topics]][[Category:HTML|DocType]][[Category:Template FAQ]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dynedain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Official_DTDs&amp;diff=26659</id>
		<title>Official DTDs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Official_DTDs&amp;diff=26659"/>
		<updated>2010-04-09T16:57:40Z</updated>

		<summary type="html">&lt;p&gt;Dynedain: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Joomla! 1.5 Internal DocTypes====&lt;br /&gt;
List of doctypes used by the installation manifest XMLs for Joomla! and 3rd party add-ons.&lt;br /&gt;
&lt;br /&gt;
*Template Manifest (templateDetails.xml): &amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD template 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/template-install.dtd&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
*Component Manifest (component-install.xml): &amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD component 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/component-install.dtd&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
*Plugin Manifest (plugin-install.xml): &amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD plugin 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
*Module Manifest (module-install.xml): &amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD module 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/module-install.dtd&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Legacy DTDs=====&lt;br /&gt;
Up until December 2008, when dev.joomla.org was shut down, the Internal DTDs were hosted at http://dev.joomla.org/xml/1.5. Since that time, they have been moved to http://www.joomla.org/xml/dtd/1.5 and their locations corrected in Joomla 1.5.9&lt;br /&gt;
Some 3rd party Joomla! add-ons may be referencing the old locations, which may work, but is deprecated.&lt;/div&gt;</summary>
		<author><name>Dynedain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Official_DTDs&amp;diff=26658</id>
		<title>Official DTDs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Official_DTDs&amp;diff=26658"/>
		<updated>2010-04-09T16:27:43Z</updated>

		<summary type="html">&lt;p&gt;Dynedain: Updated listings to reflect the shutdown of dev.joomla.org&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of the officially defined public and system identifiers used in Joomla! XML DOCTYPE declarations.&lt;br /&gt;
&lt;br /&gt;
{{Ambox|type=serious|image=serious|text=NOTE: This list is not complete at the present time.}}&lt;br /&gt;
&lt;br /&gt;
;-//Joomla! 1.5//DTD template 1.0//EN&lt;br /&gt;
:&#039;&#039;&#039;Full DOCTYPE:&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD template 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/template-install.dtd&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;URL:&#039;&#039;&#039; http://www.joomla.org/xml/dtd/1.5/template-install.dtd&lt;br /&gt;
:&#039;&#039;&#039;Description:&#039;&#039;&#039; Joomla! 1.5 templates for validation of templateDetails.xml files.&lt;br /&gt;
&lt;br /&gt;
;-//Joomla! 1.5//DTD component 1.0//EN&lt;br /&gt;
:&#039;&#039;&#039;Full DOCTYPE:&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD component 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/component-install.dtd&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;URL:&#039;&#039;&#039; http://www.joomla.org/xml/dtd/1.5/component-install.dtd&lt;br /&gt;
:&#039;&#039;&#039;Description:&#039;&#039;&#039; Joomla! 1.5 templates for validation of component-install.xml files.&lt;br /&gt;
&lt;br /&gt;
;-//Joomla! 1.5//DTD plugin 1.0//EN&lt;br /&gt;
:&#039;&#039;&#039;Full DOCTYPE:&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD plugin 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;URL:&#039;&#039;&#039; http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd&lt;br /&gt;
:&#039;&#039;&#039;Description:&#039;&#039;&#039; Joomla! 1.5 templates for validation of plugin-install.xml files.&lt;br /&gt;
&lt;br /&gt;
;-//Joomla! 1.5//DTD module 1.0//EN&lt;br /&gt;
:&#039;&#039;&#039;Full DOCTYPE:&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD module 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/module-install.dtd&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;URL:&#039;&#039;&#039; http://www.joomla.org/xml/dtd/1.5/module-install.dtd&lt;br /&gt;
:&#039;&#039;&#039;Description:&#039;&#039;&#039; Joomla! 1.5 templates for validation of module-install.xml files.&lt;br /&gt;
&lt;br /&gt;
===Legacy DTDs===&lt;br /&gt;
Up until December 2008, when dev.joomla.org was shut down, the DTDs were hosted at http://dev.joomla.org/xml/1.5. Since that time, they have been moved to http://www.joomla.org/xml/dtd/1.5&lt;br /&gt;
Some 3rd party Joomla! add-ons may be referencing the old locations, which may work, but is deprecated.&lt;/div&gt;</summary>
		<author><name>Dynedain</name></author>
	</entry>
</feed>