<?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=Renekorss</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=Renekorss"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Renekorss"/>
	<updated>2026-07-10T02:12:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Understanding_Output_Overrides&amp;diff=175296</id>
		<title>Understanding Output Overrides</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Understanding_Output_Overrides&amp;diff=175296"/>
		<updated>2015-04-21T05:54:57Z</updated>

		<summary type="html">&lt;p&gt;Renekorss: prettified paths&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|1.5,2.5,3.1}}&lt;br /&gt;
[[Category:Development]] [[Category:Templates]] [[Category:Overrides]] [[Category:Tips and tricks 1.5]]&lt;br /&gt;
This was a Developer Blog post by Andrew Eddie, initially copied to the wiki with minor edits by Alan Langford.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
There are many competing requirements for Web designers ranging from accessibility to legislative to personal preferences. Rather than trying to over-parameterise views, or trying to aim for some sort of line of best fit, or, worse, sticking its head in the sand, Joomla! has added the potential for the designer to take over control of virtually all the output that is generated.&lt;br /&gt;
&lt;br /&gt;
Joomla! has been criticized by some for not giving due attention to accessibility or being archaic in their approach to Web standards. However, with 1.5, the responsibility--and, more importantly, the power--to control output is back in the designer&#039;s hands.&lt;br /&gt;
&lt;br /&gt;
In addition, except for files that are provided in the Joomla! distribution itself, these methods for customisation eliminate the need for designers and developers to &amp;quot;hack&amp;quot; core files that could change when the site is updated to a new version. Because they are contained within the template, they can be deployed to the Website without having to worry about changes being accidentally overwritten when your System Administrator upgrades the site.&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is to introduce the fours areas of the output of Joomla! that are able to be customised by the template designer.&lt;br /&gt;
&lt;br /&gt;
Not interested in all the theory? Jump straight to the cheat sheet below.&lt;br /&gt;
&lt;br /&gt;
== MVC 101 ==&lt;br /&gt;
MVC can be a scary acronym. It stands for Model-View-Controller and the concepts behind MVC are responsible for the extra flexibility that is now afforded to the designer. While parts of the theory can be rather involved and complicated, the only part that the designer need worry about is the V for View. This is the part that is concerned with output.&lt;br /&gt;
&lt;br /&gt;
Different extensions display output in different ways.&lt;br /&gt;
&lt;br /&gt;
Components, as you already know, are fairly complex and have the ability to display different information in different ways. For example, the Articles Component (com_content) is able to display a single article, or articles in a category, or categories in a section. Each of the ways of representing the different types of data (an article, or a category, or a section) is called a &amp;quot;view&amp;quot; (this comes from our MVC terminology). Most components will have many views. However, the view doesn&#039;t actually display the output. This is left up to what we call a &amp;quot;layout&amp;quot; and it is possible for a view to have a variety of layouts.&lt;br /&gt;
&lt;br /&gt;
The main thing to remember here is that components can have multiple views, and each view can have one or more layouts. Each view assembles a fixed set of information, but each layout can display that information in different ways. For example, the Category view in the Articles component assembles a number of articles. These articles could be displayed in a list or in a table (and probably other ways as well). So this view may have a &amp;quot;list&amp;quot; layout and a &amp;quot;table&amp;quot; layout to choose from.&lt;br /&gt;
&lt;br /&gt;
Modules, on the other hand, are very simple. They generally display one thing one way. Modules don&#039;t really have views but they do support a layout. Some developers might even support a choice of layout through module parameters.&lt;br /&gt;
=== Template versus Layout ===&lt;br /&gt;
It is very important to distinguish between the role of templates and the role of layouts. The template sets up a structural framework for the page of the Web site. Within this framework are positions for modules and a component to display. What actually gets displayed is governed by the module layout, or the combination of view and layout in the case of the component.&lt;br /&gt;
&lt;br /&gt;
The following image shows the structural layout of a typical Joomla! template (rhuk_milkyway, the default for 1.5). The module positions are displayed by adding tp=1 to the URL (eg, index.php?tp=1). You can clearly see where the module output is contained within the overall template, as well as the main component output starting in the lower-centre region. However, what is actually output in those regions is controlled by the layouts.&lt;br /&gt;
&lt;br /&gt;
[[Image:FrontpageTemplatePositions.png|Typical Joomla! screenshot with template positions shown.]]&lt;br /&gt;
&lt;br /&gt;
=== Ancillary Customisation ===&lt;br /&gt;
While not strictly related to the MVC, there are two other important areas to consider when looking at customising the output of Joomla!.&lt;br /&gt;
&lt;br /&gt;
=== Ancillary Customisation:Chrome ===&lt;br /&gt;
In addition to layouts, modules have what we call &amp;quot;chrome&amp;quot;. Chrome is the style(s) with which a module is to display. Most developers, designers and probably some end-users will be familiar with the different built-in styles for modules (raw, xhtml, etc). It is also possible to define your own chrome styles for modules depending on the designer result. For example, you could design a chrome to display all the modules in a particular position in a fancy Javascript collapsing blind arrangement.&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can just make out the names of some of the built-in module chrome used (rounded, none and xhtml).&lt;br /&gt;
&lt;br /&gt;
Note the potential plural.  A module or component can have multiple chrome styles applied to it.  For example, When the global template setting &amp;quot;preview module positions&amp;quot; is enabled and the page is loaded with ?tp=1 at the end of the url the chrome &amp;quot;outline&amp;quot; is added to all modules and the component.  This is in addition to their regular chrome styling.  The default chrome settings can be found in the template/system/html/modules.php file and additional chrome styles may be added by adding your own modules.php file to your template.&lt;br /&gt;
&lt;br /&gt;
Chrome styles are functions and are written in this manner:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * foobar (outputs foo before module content and bar after)&lt;br /&gt;
 */&lt;br /&gt;
function modChrome_foobar($module, &amp;amp;$params, &amp;amp;$attribs)&lt;br /&gt;
{&lt;br /&gt;
        echo &#039;&amp;lt;h1&amp;gt;Foo&amp;lt;/h1&amp;gt;&#039;;&lt;br /&gt;
	echo $module-&amp;gt;content;&lt;br /&gt;
        echo &#039;&amp;lt;h1&amp;gt;Bar&amp;lt;/h1&amp;gt;&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use $module-&amp;gt;content to access the content generated by the module.  You may access the module parameters and attributes by using the appropriate variables passed to this function.&lt;br /&gt;
&lt;br /&gt;
=== Ancillary Customisation:Pagination ===&lt;br /&gt;
The second area has to do with controlling the pagination controls when viewing lists of data. We will look at that in more detail later.&lt;br /&gt;
&lt;br /&gt;
== Component Output Types and Layout Overrides ==&lt;br /&gt;
&lt;br /&gt;
To understand layout overrides we must first understand the file structure of a component. While there are many parts to a component, all fulfilling different roles and responsibilities, we want to look just in the /views/ directory. Here is the partial structure for two of the com_content views:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/components&lt;br /&gt;
  /com_content&lt;br /&gt;
	/views&lt;br /&gt;
	  /articles&lt;br /&gt;
		/tmpl&lt;br /&gt;
		  default.php (this is a layout)&lt;br /&gt;
		  form.php	(this is a layout)&lt;br /&gt;
		view.html.php (this is the view that outputs the HTML)&lt;br /&gt;
		view.pdf.php (this is the view that outputs the PDF)&lt;br /&gt;
	  /category&lt;br /&gt;
		/tmpl&lt;br /&gt;
		  blog.php	   (layout)&lt;br /&gt;
		  blog_items.php (a sub-layout&lt;br /&gt;
		  default.php	(layout)&lt;br /&gt;
		view.html.php	(HTML view)&lt;br /&gt;
		view.feed.php	(RSS feed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
So what you see here is that under the /views/ directory, each view is placed in a directory of its own. The content component actually has three other views not shown: archive, frontpage and section.&lt;br /&gt;
=== Output Types ===&lt;br /&gt;
Under the /articles/ directory we have a number of files. There is almost always a file called view.html.php. This is what we call the view file, but there can be more than one depending on the type of output to produce. It has a specific naming convention, view.output_type.php, where the output type can be html, feed, pdf, raw or error (for more information see JDocument in the API reference and look in the directory /libraries/joomla/document/). What this means is when we want html output for this particular view, the view.html.php file is used. When we want the RSS output, the view.feed.php file is used.&lt;br /&gt;
&lt;br /&gt;
The affect of these different output types is most apparent when the Global Configuration setting for Search Engine Friendly URLs is set to Yes, Use Apache mod_rewrite is set to Yes, and Add suffix to URLs is also set to Yes. When this is done, the site URLs will look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://domain/sports.html&lt;br /&gt;
http://domain/sports.feed&lt;br /&gt;
http://domain/sports/rowing.html&lt;br /&gt;
http://domain/sports/rowing.pdf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The exact URL will vary depending on how you set up your site but the point here is to show that sports.html will use the category view&#039;s view.html.php file to, and that sports.feed will display the RSS feed for the category using view.feed.php. It should be noted that you cannot currently customise feed or PDF output types. However, you can customise the html output type and this is where layouts come into play.&lt;br /&gt;
&lt;br /&gt;
=== Layouts ===&lt;br /&gt;
Under the view directory there is a /tmpl/ directory in which the layout files reside. Each PHP file in this directory represents a layout. For example, article/tmpl/default.php is the default layout for an article whereas article/tmpl/form.php is the edit form for an article; category/tmpl/default.php is the default layout for a category whereas category/tmpl/blog.php displays the list of article differently.&lt;br /&gt;
&lt;br /&gt;
The relationship between component views and layout is most plainly seen when adding a new menu item. The next screenshot represents the typical display of the New Menu Item page. Having clicked on Articles (which represents com_content), the tree expands to show the list of views and each layout within the view.&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu_item_type_articles.png|Screenshot of creating a new menu item fro an article.]]&lt;br /&gt;
&lt;br /&gt;
You will notice that while there are extra files in some of the /tmpl/ directories (like pagebreak.php in the article view), they are missing from the list. This is due to instructions in the XML file for the layout (for example, pagebreak.xml) to hide the layout (or even the view) from the menu item list. However, this is another broad topic which will be covered in another tutorial.&lt;br /&gt;
&lt;br /&gt;
Armed with all that knowledge of how all the parts relate to each other, we are now ready to actually create our layout overrides.&lt;br /&gt;
&lt;br /&gt;
=== Copying or Creating Layout Files ===&lt;br /&gt;
&lt;br /&gt;
Layout overrides only work within the active template and are located under the /html/ directory in the template. For example, the overrides for rhuk_milkyway are located under /templates/rhuk_milkyway/html/, for the JA Purity template under /templates/ja_purity/html/ and for Beez under /templates/beez/html/.&lt;br /&gt;
&lt;br /&gt;
It is important to understand that if you create overrides in one template, they will not be available in other templates. For example, rhuk_milkyway has no component layout overrides at all. When you use this template you are seeing the raw output from all components. When you use the Beez template, almost every piece of component output is being controlled by the layout overrides in the template. JA Purity is in between having overrides for some components and only some views of those components.&lt;br /&gt;
&lt;br /&gt;
The layout overrides must be placed in particular way. Using Beez as an example you will see the following structure:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/templates&lt;br /&gt;
  /beez&lt;br /&gt;
	/html&lt;br /&gt;
	  /com_content	(this directory matches the component directory name)&lt;br /&gt;
		/articles	 (this directory matches the view directory name)&lt;br /&gt;
		  default.php (this file matches the layout file name)&lt;br /&gt;
		  form.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The structure for component overrides is quite simple: /html/com_component_name/view_name/layout_file_name.php. Let&#039;s look at a few examples.&lt;br /&gt;
&lt;br /&gt;
The rhuk_milkyway template does not have any layout overrides for any components. If we want to override the default layout for an article, first we need to copy this file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/components/com_content/views/article/tmpl/default.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this location, creating the appropriate directories in the event they don&#039;t already exist:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/templates/rhuk_milkyway/html/com_content/article/default.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we wanted to override the blog layout in the category view, we would copy this file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/components/com_content/views/category/tmpl/blog.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/templates/rhuk_milkyway/html/com_content/category/blog.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the files are copied, you are free to customise these files as much or as little as required or desired. You do not have to honour parameter settings if you don&#039;t want to.&lt;br /&gt;
=== Overriding Sub-Layouts ===&lt;br /&gt;
&lt;br /&gt;
In some views you will see that some of the layouts have a group of files that start with the same name. The category view has an example of this. The blog layout actually has three parts: the main layout file blog.php and two sub-layout files, blog_item.php and blog_links.php. You can see where these sub-layouts are loaded in the blog.php file using the loadTemplate method, for example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo $this-&amp;gt;loadTemplate(&#039;item&#039;);&lt;br /&gt;
// or&lt;br /&gt;
echo $this-&amp;gt;loadTemplate(&#039;links&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
When loading sub-layouts, the view already knows what layout you are in, so you don&#039;t have to provide the prefix (that is, you load just &#039;item&#039;, not &#039;blog_item&#039;).&lt;br /&gt;
&lt;br /&gt;
What is important to note here is that it is possible to override just a sub-layout without copying the whole set of files. For example, if you were happy with the Joomla! default output for the blog layout, but just wanted to customise the item sub-layout, you could just copy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/components/com_content/views/category/tmpl/blog_item.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/templates/rhuk_milkyway/html/com_content/category/blog_item.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Joomla! is parsing the view, it will automatically know to load blog.php from com_content natively and blog_item.php from your template overrides.&lt;br /&gt;
== Module Layout Overrides ==&lt;br /&gt;
&lt;br /&gt;
Modules, like components, are set up in a particular directory structure.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/modules&lt;br /&gt;
  /mod_latest_news&lt;br /&gt;
	/tmpl&lt;br /&gt;
	  default.php   (the layout)&lt;br /&gt;
	helper.php   (a helper file containing data logic)&lt;br /&gt;
	mod_latest_news.php   (the main module file)&lt;br /&gt;
	mod_latest_news.xml   (the installation XML file)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Similar to components, under the main module directory (in the example, mod_latest_news) there is a /tmpl/ directory. There is usually only one layout file but depending on who wrote the module, and how it is written, there could be more.&lt;br /&gt;
&lt;br /&gt;
As for components, the layout override for a module must be placed in particular way. Using Beez as an example again, you will see the following structure:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/templates&lt;br /&gt;
  /beez&lt;br /&gt;
	/html&lt;br /&gt;
	  /mod_latest_news   (this directory matches the module directory name)&lt;br /&gt;
		default.php   (this file matches the layout file name)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The structure for module overrides is again quite simple: /html/mod_module_name/layout_file_name.php.&lt;br /&gt;
=== Copying or Creating Layout Files ===&lt;br /&gt;
&lt;br /&gt;
The rhuk_milkyway template does not have any layout overrides for any modules. If we want to override the default layout for Latest News module, we need to copy this file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/modules/mod_latest_news/tmpl/default.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this location, creating the approriate directories in the event they don&#039;t already exist:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/templates/rhuk_milkyway/html/mod_latest_news/default.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to take a little care with overriding module layout because there are a number of different ways that modules can or have been designed so you need to treat each one individually.&lt;br /&gt;
&lt;br /&gt;
== Module Chrome ==&lt;br /&gt;
&lt;br /&gt;
Joomla! 1.0 had a number of fixed styles that could display a list of modules in a particular position. These where represented by numbers:&lt;br /&gt;
&lt;br /&gt;
* 0 (the default) displayed modules in a vertical table&lt;br /&gt;
* 1 displayed them in a horizontal table&lt;br /&gt;
* -1 displayed the raw module output&lt;br /&gt;
* -2 displayed the modules in a XHTML compatible format with the title in a H3 tag.&lt;br /&gt;
* -3 displayed modules in a set of nested DIVs that allowed for rounded-corner techniques&lt;br /&gt;
&lt;br /&gt;
It was a great system except for two things:&lt;br /&gt;
&lt;br /&gt;
# Nobody could remember which number was which, and&lt;br /&gt;
# You couldn&#039;t expand on the styles.&lt;br /&gt;
&lt;br /&gt;
Well, in 1.5, the numbers are still recognised, but more commonly the style is represented as a word. As well as that, the syntax for displaying a module position was changed. For example, this snippet displays each module in the left position in the xhtml style:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;left&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The built-in styles that are now available are:&lt;br /&gt;
&lt;br /&gt;
* table (was 0 and is the default)&lt;br /&gt;
* horz (was 1)&lt;br /&gt;
* none (was -1)&lt;br /&gt;
* xhtml (was -2)&lt;br /&gt;
* rounded (was -3)&lt;br /&gt;
* outline (new - used to preview module positions - see screenshot above)&lt;br /&gt;
&lt;br /&gt;
In the source code, these styles are referred to as &amp;quot;chrome&amp;quot;. The default chrome is in the system template of the default Joomla! install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/templates/system/html/modules.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file is maintained by the project so you should never modify it. You will lose your changes when you upgrade your Joomla! installation.&lt;br /&gt;
&lt;br /&gt;
To create your own chrome, or module styles, create or edit modules.php under the templates /html/ directory. (This is the same directory we have been talking about for component and module layout overrides).&lt;br /&gt;
&lt;br /&gt;
The rhuk_milkyway template provides some extra chrome as an example. (It provides an example style called &amp;quot;slider&amp;quot;). This can be found in the following file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/templates/rhuk_milkyway/html/modules.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating your own chrome is easy. Let&#039;s look at example that displays the module in a Definition List (a set of DL&#039;s, DT&#039;s and DD&#039;s).&lt;br /&gt;
&lt;br /&gt;
Just add the following function to the /html/modules.php file in your default template directory (create it if it does not exist):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Module chrome that wraps the module in a definition list&lt;br /&gt;
 */&lt;br /&gt;
function modChrome_dlist($module, &amp;amp;$params, &amp;amp;$attribs)&lt;br /&gt;
{ ?&amp;gt;&lt;br /&gt;
   &amp;lt;dl class=&amp;quot;&amp;lt;?php echo $params-&amp;gt;get(&#039;moduleclass_sfx&#039;); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;?php if ($module-&amp;gt;showtitle != 0) : ?&amp;gt;&lt;br /&gt;
	 &amp;lt;dt&amp;gt;&lt;br /&gt;
	    &amp;lt;?php echo $module-&amp;gt;title; ?&amp;gt;&lt;br /&gt;
	        &amp;lt;/dt&amp;gt;&lt;br /&gt;
	    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
		&amp;lt;dd&amp;gt;&lt;br /&gt;
	    &amp;lt;?php echo $module-&amp;gt;content; ?&amp;gt;&lt;br /&gt;
	        &amp;lt;/dd&amp;gt;&lt;br /&gt;
	    &amp;lt;/dl&amp;gt;&lt;br /&gt;
	&amp;lt;?php&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We will be calling the style &amp;quot;dlist&amp;quot;, so the name of the function needs to be modChrome_dlist.&lt;br /&gt;
&lt;br /&gt;
The function must take the three arguments as shown for the module object, the module parameters, and lastly the $attribs is an array of all the attributes in the jdoc XML tag.&lt;br /&gt;
&lt;br /&gt;
There are three main properties in the module object to be concerned with:&lt;br /&gt;
&lt;br /&gt;
* showtitle tells you whether to show the title of the module of not&lt;br /&gt;
* title is the title of the module&lt;br /&gt;
* content is the output of the module (from its layout)&lt;br /&gt;
&lt;br /&gt;
This is a very simple case and you can, of course, design more complex styles, possibly using custom atrributes in the XML tag.&lt;br /&gt;
&lt;br /&gt;
== Pagination Links Overrides ==&lt;br /&gt;
&lt;br /&gt;
The final override we will look at is the pagination override. This override can control the display of items-per-page and the pagination links used with lists of information, as shown in the following screenshot.&lt;br /&gt;
&lt;br /&gt;
[[Image:Article_list_pagination.png|Typical Joomla! page showing a paginated list.]]&lt;br /&gt;
&lt;br /&gt;
The rhuk_milkyway template provides a well-commented example for this override. The file is found here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/templates/rhuk_milkyway/html/pagination.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the pagination list is required, Joomla! will look for this file in the default templates. If it is found, it will be loaded and the display functions it contains will be used.&lt;br /&gt;
&lt;br /&gt;
There are four functions that can be used:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pagination_list_footer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function is responsible for showing the select list for the number of items to display per page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pagination_list_render&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function is responsible for showing the list of page number links as well at the Start, End, Previous and Next links.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pagination_item_active&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function displays the links to other page numbers other than the &amp;quot;current&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pagination_item_inactive&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function displays the current page number, usually not hyperlinked.&lt;br /&gt;
&lt;br /&gt;
== Media Files Override ==&lt;br /&gt;
&lt;br /&gt;
This method allows 3rd party developers to override CSS and JS files that where inserted using the functions &amp;lt;code&amp;gt;JHtml::script()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;JHtml::stylesheet()&amp;lt;/code&amp;gt; and are stored inside the Joomla media folder. &lt;br /&gt;
&lt;br /&gt;
=== Supporting Media Files Override ===&lt;br /&gt;
&lt;br /&gt;
For this example we have a module called &amp;lt;code&amp;gt;mod_test&amp;lt;/code&amp;gt;, this module have a CSS file installed at:&lt;br /&gt;
&lt;br /&gt;
 /media/mod_test/css/mystyle.css&lt;br /&gt;
&lt;br /&gt;
That file should be inserted using the following functions and parameters:&lt;br /&gt;
&lt;br /&gt;
 JHtml::stylesheet(&#039;mod_test/mystyle.css&#039;, false, true, false);&lt;br /&gt;
&lt;br /&gt;
Note that the 3rd parameter (true) is the one that makes the Joomla API to look for an override file inside your current template folder.&lt;br /&gt;
&lt;br /&gt;
The override file must be placed as follow at your current template folder:&lt;br /&gt;
&lt;br /&gt;
 /templates/my_template/css/mod_test/mystyle.css&lt;br /&gt;
&lt;br /&gt;
== Cheat Sheet ==&lt;br /&gt;
Using the rhuk_milkyway template as an example, here is a brief summary of the principles we&#039;ve looked at.&lt;br /&gt;
=== Customise the Component Output ===&lt;br /&gt;
To override a component layout (for example the default layout in the article view), copy:&lt;br /&gt;
&lt;br /&gt;
 /components/com_content/views/article/tmpl/default.php&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
 /templates/rhuk_milkyway/html/com_content/article/default.php&lt;br /&gt;
&lt;br /&gt;
Read more about [[#Component Output Types and Layout Overrides|component output]].&lt;br /&gt;
&lt;br /&gt;
=== Customise the Module Output ===&lt;br /&gt;
To override a module layout (for example the Latest News module using the rhuk_milkyway template), copy:&lt;br /&gt;
&lt;br /&gt;
 /modules/mod_latest_news/tmpl/default.php&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
 /templates/rhuk_milkyway/html/mod_latest_news/default.php&lt;br /&gt;
&lt;br /&gt;
Read more about [[#Module Layout Overrides|module output]].&lt;br /&gt;
&lt;br /&gt;
=== Add New Module Styles ===&lt;br /&gt;
To add new module styles (chrome), add them to the following file:&lt;br /&gt;
&lt;br /&gt;
 /templates/rhuk_milkyway/html/modules.php&lt;br /&gt;
&lt;br /&gt;
Read more about [[#Module Chrome|module chrome]].&lt;br /&gt;
&lt;br /&gt;
=== Customise the Pagination Links ===&lt;br /&gt;
To customise the way the items-per-page selector and pagination links display, edit the following file:&lt;br /&gt;
&lt;br /&gt;
 /templates/rhuk_milkyway/html/pagination.php&lt;br /&gt;
&lt;br /&gt;
Read more about [[#Pagination Links Overrides|pagination]].&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Joomla! 1.5, through the use of an MVC paradigm has greatly improved the flexibility that is afforded to Web site designers. By way of a few simple principles, like copying certain files to certain places in your template, the designer is able to override almost all the output generated by Joomla!.&lt;/div&gt;</summary>
		<author><name>Renekorss</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Understanding_Output_Overrides&amp;diff=175295</id>
		<title>Understanding Output Overrides</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Understanding_Output_Overrides&amp;diff=175295"/>
		<updated>2015-04-21T05:52:20Z</updated>

		<summary type="html">&lt;p&gt;Renekorss: prettified paths&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|1.5,2.5,3.1}}&lt;br /&gt;
[[Category:Development]] [[Category:Templates]] [[Category:Overrides]] [[Category:Tips and tricks 1.5]]&lt;br /&gt;
This was a Developer Blog post by Andrew Eddie, initially copied to the wiki with minor edits by Alan Langford.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
There are many competing requirements for Web designers ranging from accessibility to legislative to personal preferences. Rather than trying to over-parameterise views, or trying to aim for some sort of line of best fit, or, worse, sticking its head in the sand, Joomla! has added the potential for the designer to take over control of virtually all the output that is generated.&lt;br /&gt;
&lt;br /&gt;
Joomla! has been criticized by some for not giving due attention to accessibility or being archaic in their approach to Web standards. However, with 1.5, the responsibility--and, more importantly, the power--to control output is back in the designer&#039;s hands.&lt;br /&gt;
&lt;br /&gt;
In addition, except for files that are provided in the Joomla! distribution itself, these methods for customisation eliminate the need for designers and developers to &amp;quot;hack&amp;quot; core files that could change when the site is updated to a new version. Because they are contained within the template, they can be deployed to the Website without having to worry about changes being accidentally overwritten when your System Administrator upgrades the site.&lt;br /&gt;
&lt;br /&gt;
The aim of this tutorial is to introduce the fours areas of the output of Joomla! that are able to be customised by the template designer.&lt;br /&gt;
&lt;br /&gt;
Not interested in all the theory? Jump straight to the cheat sheet below.&lt;br /&gt;
&lt;br /&gt;
== MVC 101 ==&lt;br /&gt;
MVC can be a scary acronym. It stands for Model-View-Controller and the concepts behind MVC are responsible for the extra flexibility that is now afforded to the designer. While parts of the theory can be rather involved and complicated, the only part that the designer need worry about is the V for View. This is the part that is concerned with output.&lt;br /&gt;
&lt;br /&gt;
Different extensions display output in different ways.&lt;br /&gt;
&lt;br /&gt;
Components, as you already know, are fairly complex and have the ability to display different information in different ways. For example, the Articles Component (com_content) is able to display a single article, or articles in a category, or categories in a section. Each of the ways of representing the different types of data (an article, or a category, or a section) is called a &amp;quot;view&amp;quot; (this comes from our MVC terminology). Most components will have many views. However, the view doesn&#039;t actually display the output. This is left up to what we call a &amp;quot;layout&amp;quot; and it is possible for a view to have a variety of layouts.&lt;br /&gt;
&lt;br /&gt;
The main thing to remember here is that components can have multiple views, and each view can have one or more layouts. Each view assembles a fixed set of information, but each layout can display that information in different ways. For example, the Category view in the Articles component assembles a number of articles. These articles could be displayed in a list or in a table (and probably other ways as well). So this view may have a &amp;quot;list&amp;quot; layout and a &amp;quot;table&amp;quot; layout to choose from.&lt;br /&gt;
&lt;br /&gt;
Modules, on the other hand, are very simple. They generally display one thing one way. Modules don&#039;t really have views but they do support a layout. Some developers might even support a choice of layout through module parameters.&lt;br /&gt;
=== Template versus Layout ===&lt;br /&gt;
It is very important to distinguish between the role of templates and the role of layouts. The template sets up a structural framework for the page of the Web site. Within this framework are positions for modules and a component to display. What actually gets displayed is governed by the module layout, or the combination of view and layout in the case of the component.&lt;br /&gt;
&lt;br /&gt;
The following image shows the structural layout of a typical Joomla! template (rhuk_milkyway, the default for 1.5). The module positions are displayed by adding tp=1 to the URL (eg, index.php?tp=1). You can clearly see where the module output is contained within the overall template, as well as the main component output starting in the lower-centre region. However, what is actually output in those regions is controlled by the layouts.&lt;br /&gt;
&lt;br /&gt;
[[Image:FrontpageTemplatePositions.png|Typical Joomla! screenshot with template positions shown.]]&lt;br /&gt;
&lt;br /&gt;
=== Ancillary Customisation ===&lt;br /&gt;
While not strictly related to the MVC, there are two other important areas to consider when looking at customising the output of Joomla!.&lt;br /&gt;
&lt;br /&gt;
=== Ancillary Customisation:Chrome ===&lt;br /&gt;
In addition to layouts, modules have what we call &amp;quot;chrome&amp;quot;. Chrome is the style(s) with which a module is to display. Most developers, designers and probably some end-users will be familiar with the different built-in styles for modules (raw, xhtml, etc). It is also possible to define your own chrome styles for modules depending on the designer result. For example, you could design a chrome to display all the modules in a particular position in a fancy Javascript collapsing blind arrangement.&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can just make out the names of some of the built-in module chrome used (rounded, none and xhtml).&lt;br /&gt;
&lt;br /&gt;
Note the potential plural.  A module or component can have multiple chrome styles applied to it.  For example, When the global template setting &amp;quot;preview module positions&amp;quot; is enabled and the page is loaded with ?tp=1 at the end of the url the chrome &amp;quot;outline&amp;quot; is added to all modules and the component.  This is in addition to their regular chrome styling.  The default chrome settings can be found in the template/system/html/modules.php file and additional chrome styles may be added by adding your own modules.php file to your template.&lt;br /&gt;
&lt;br /&gt;
Chrome styles are functions and are written in this manner:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * foobar (outputs foo before module content and bar after)&lt;br /&gt;
 */&lt;br /&gt;
function modChrome_foobar($module, &amp;amp;$params, &amp;amp;$attribs)&lt;br /&gt;
{&lt;br /&gt;
        echo &#039;&amp;lt;h1&amp;gt;Foo&amp;lt;/h1&amp;gt;&#039;;&lt;br /&gt;
	echo $module-&amp;gt;content;&lt;br /&gt;
        echo &#039;&amp;lt;h1&amp;gt;Bar&amp;lt;/h1&amp;gt;&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use $module-&amp;gt;content to access the content generated by the module.  You may access the module parameters and attributes by using the appropriate variables passed to this function.&lt;br /&gt;
&lt;br /&gt;
=== Ancillary Customisation:Pagination ===&lt;br /&gt;
The second area has to do with controlling the pagination controls when viewing lists of data. We will look at that in more detail later.&lt;br /&gt;
&lt;br /&gt;
== Component Output Types and Layout Overrides ==&lt;br /&gt;
&lt;br /&gt;
To understand layout overrides we must first understand the file structure of a component. While there are many parts to a component, all fulfilling different roles and responsibilities, we want to look just in the /views/ directory. Here is the partial structure for two of the com_content views:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/components&lt;br /&gt;
  /com_content&lt;br /&gt;
	/views&lt;br /&gt;
	  /articles&lt;br /&gt;
		/tmpl&lt;br /&gt;
		  default.php (this is a layout)&lt;br /&gt;
		  form.php	(this is a layout)&lt;br /&gt;
		view.html.php (this is the view that outputs the HTML)&lt;br /&gt;
		view.pdf.php (this is the view that outputs the PDF)&lt;br /&gt;
	  /category&lt;br /&gt;
		/tmpl&lt;br /&gt;
		  blog.php	   (layout)&lt;br /&gt;
		  blog_items.php (a sub-layout&lt;br /&gt;
		  default.php	(layout)&lt;br /&gt;
		view.html.php	(HTML view)&lt;br /&gt;
		view.feed.php	(RSS feed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
So what you see here is that under the /views/ directory, each view is placed in a directory of its own. The content component actually has three other views not shown: archive, frontpage and section.&lt;br /&gt;
=== Output Types ===&lt;br /&gt;
Under the /articles/ directory we have a number of files. There is almost always a file called view.html.php. This is what we call the view file, but there can be more than one depending on the type of output to produce. It has a specific naming convention, view.output_type.php, where the output type can be html, feed, pdf, raw or error (for more information see JDocument in the API reference and look in the directory /libraries/joomla/document/). What this means is when we want html output for this particular view, the view.html.php file is used. When we want the RSS output, the view.feed.php file is used.&lt;br /&gt;
&lt;br /&gt;
The affect of these different output types is most apparent when the Global Configuration setting for Search Engine Friendly URLs is set to Yes, Use Apache mod_rewrite is set to Yes, and Add suffix to URLs is also set to Yes. When this is done, the site URLs will look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://domain/sports.html&lt;br /&gt;
http://domain/sports.feed&lt;br /&gt;
http://domain/sports/rowing.html&lt;br /&gt;
http://domain/sports/rowing.pdf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The exact URL will vary depending on how you set up your site but the point here is to show that sports.html will use the category view&#039;s view.html.php file to, and that sports.feed will display the RSS feed for the category using view.feed.php. It should be noted that you cannot currently customise feed or PDF output types. However, you can customise the html output type and this is where layouts come into play.&lt;br /&gt;
&lt;br /&gt;
=== Layouts ===&lt;br /&gt;
Under the view directory there is a /tmpl/ directory in which the layout files reside. Each PHP file in this directory represents a layout. For example, article/tmpl/default.php is the default layout for an article whereas article/tmpl/form.php is the edit form for an article; category/tmpl/default.php is the default layout for a category whereas category/tmpl/blog.php displays the list of article differently.&lt;br /&gt;
&lt;br /&gt;
The relationship between component views and layout is most plainly seen when adding a new menu item. The next screenshot represents the typical display of the New Menu Item page. Having clicked on Articles (which represents com_content), the tree expands to show the list of views and each layout within the view.&lt;br /&gt;
&lt;br /&gt;
[[Image:Menu_item_type_articles.png|Screenshot of creating a new menu item fro an article.]]&lt;br /&gt;
&lt;br /&gt;
You will notice that while there are extra files in some of the /tmpl/ directories (like pagebreak.php in the article view), they are missing from the list. This is due to instructions in the XML file for the layout (for example, pagebreak.xml) to hide the layout (or even the view) from the menu item list. However, this is another broad topic which will be covered in another tutorial.&lt;br /&gt;
&lt;br /&gt;
Armed with all that knowledge of how all the parts relate to each other, we are now ready to actually create our layout overrides.&lt;br /&gt;
&lt;br /&gt;
=== Copying or Creating Layout Files ===&lt;br /&gt;
&lt;br /&gt;
Layout overrides only work within the active template and are located under the /html/ directory in the template. For example, the overrides for rhuk_milkyway are located under /templates/rhuk_milkyway/html/, for the JA Purity template under /templates/ja_purity/html/ and for Beez under /templates/beez/html/.&lt;br /&gt;
&lt;br /&gt;
It is important to understand that if you create overrides in one template, they will not be available in other templates. For example, rhuk_milkyway has no component layout overrides at all. When you use this template you are seeing the raw output from all components. When you use the Beez template, almost every piece of component output is being controlled by the layout overrides in the template. JA Purity is in between having overrides for some components and only some views of those components.&lt;br /&gt;
&lt;br /&gt;
The layout overrides must be placed in particular way. Using Beez as an example you will see the following structure:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/templates&lt;br /&gt;
  /beez&lt;br /&gt;
	/html&lt;br /&gt;
	  /com_content	(this directory matches the component directory name)&lt;br /&gt;
		/articles	 (this directory matches the view directory name)&lt;br /&gt;
		  default.php (this file matches the layout file name)&lt;br /&gt;
		  form.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The structure for component overrides is quite simple: /html/com_component_name/view_name/layout_file_name.php. Let&#039;s look at a few examples.&lt;br /&gt;
&lt;br /&gt;
The rhuk_milkyway template does not have any layout overrides for any components. If we want to override the default layout for an article, first we need to copy this file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/components/com_content/views/article/tmpl/default.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this location, creating the appropriate directories in the event they don&#039;t already exist:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/templates/rhuk_milkyway/html/com_content/article/default.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we wanted to override the blog layout in the category view, we would copy this file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/components/com_content/views/category/tmpl/blog.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/templates/rhuk_milkyway/html/com_content/category/blog.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the files are copied, you are free to customise these files as much or as little as required or desired. You do not have to honour parameter settings if you don&#039;t want to.&lt;br /&gt;
=== Overriding Sub-Layouts ===&lt;br /&gt;
&lt;br /&gt;
In some views you will see that some of the layouts have a group of files that start with the same name. The category view has an example of this. The blog layout actually has three parts: the main layout file blog.php and two sub-layout files, blog_item.php and blog_links.php. You can see where these sub-layouts are loaded in the blog.php file using the loadTemplate method, for example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo $this-&amp;gt;loadTemplate(&#039;item&#039;);&lt;br /&gt;
// or&lt;br /&gt;
echo $this-&amp;gt;loadTemplate(&#039;links&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
When loading sub-layouts, the view already knows what layout you are in, so you don&#039;t have to provide the prefix (that is, you load just &#039;item&#039;, not &#039;blog_item&#039;).&lt;br /&gt;
&lt;br /&gt;
What is important to note here is that it is possible to override just a sub-layout without copying the whole set of files. For example, if you were happy with the Joomla! default output for the blog layout, but just wanted to customise the item sub-layout, you could just copy:&lt;br /&gt;
&lt;br /&gt;
/components/com_content/views/category/tmpl/blog_item.php&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
/templates/rhuk_milkyway/html/com_content/category/blog_item.php&lt;br /&gt;
&lt;br /&gt;
When Joomla! is parsing the view, it will automatically know to load blog.php from com_content natively and blog_item.php from your template overrides.&lt;br /&gt;
== Module Layout Overrides ==&lt;br /&gt;
&lt;br /&gt;
Modules, like components, are set up in a particular directory structure.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/modules&lt;br /&gt;
  /mod_latest_news&lt;br /&gt;
	/tmpl&lt;br /&gt;
	  default.php   (the layout)&lt;br /&gt;
	helper.php   (a helper file containing data logic)&lt;br /&gt;
	mod_latest_news.php   (the main module file)&lt;br /&gt;
	mod_latest_news.xml   (the installation XML file)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Similar to components, under the main module directory (in the example, mod_latest_news) there is a /tmpl/ directory. There is usually only one layout file but depending on who wrote the module, and how it is written, there could be more.&lt;br /&gt;
&lt;br /&gt;
As for components, the layout override for a module must be placed in particular way. Using Beez as an example again, you will see the following structure:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/templates&lt;br /&gt;
  /beez&lt;br /&gt;
	/html&lt;br /&gt;
	  /mod_latest_news   (this directory matches the module directory name)&lt;br /&gt;
		default.php   (this file matches the layout file name)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The structure for module overrides is again quite simple: /html/mod_module_name/layout_file_name.php.&lt;br /&gt;
=== Copying or Creating Layout Files ===&lt;br /&gt;
&lt;br /&gt;
The rhuk_milkyway template does not have any layout overrides for any modules. If we want to override the default layout for Latest News module, we need to copy this file:&lt;br /&gt;
&lt;br /&gt;
/modules/mod_latest_news/tmpl/default.php&lt;br /&gt;
&lt;br /&gt;
to this location, creating the approriate directories in the event they don&#039;t already exist:&lt;br /&gt;
&lt;br /&gt;
/templates/rhuk_milkyway/html/mod_latest_news/default.php&lt;br /&gt;
&lt;br /&gt;
You need to take a little care with overriding module layout because there are a number of different ways that modules can or have been designed so you need to treat each one individually.&lt;br /&gt;
&lt;br /&gt;
== Module Chrome ==&lt;br /&gt;
&lt;br /&gt;
Joomla! 1.0 had a number of fixed styles that could display a list of modules in a particular position. These where represented by numbers:&lt;br /&gt;
&lt;br /&gt;
* 0 (the default) displayed modules in a vertical table&lt;br /&gt;
* 1 displayed them in a horizontal table&lt;br /&gt;
* -1 displayed the raw module output&lt;br /&gt;
* -2 displayed the modules in a XHTML compatible format with the title in a H3 tag.&lt;br /&gt;
* -3 displayed modules in a set of nested DIVs that allowed for rounded-corner techniques&lt;br /&gt;
&lt;br /&gt;
It was a great system except for two things:&lt;br /&gt;
&lt;br /&gt;
# Nobody could remember which number was which, and&lt;br /&gt;
# You couldn&#039;t expand on the styles.&lt;br /&gt;
&lt;br /&gt;
Well, in 1.5, the numbers are still recognised, but more commonly the style is represented as a word. As well as that, the syntax for displaying a module position was changed. For example, this snippet displays each module in the left position in the xhtml style:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;left&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The built-in styles that are now available are:&lt;br /&gt;
&lt;br /&gt;
* table (was 0 and is the default)&lt;br /&gt;
* horz (was 1)&lt;br /&gt;
* none (was -1)&lt;br /&gt;
* xhtml (was -2)&lt;br /&gt;
* rounded (was -3)&lt;br /&gt;
* outline (new - used to preview module positions - see screenshot above)&lt;br /&gt;
&lt;br /&gt;
In the source code, these styles are referred to as &amp;quot;chrome&amp;quot;. The default chrome is in the system template of the default Joomla! install:&lt;br /&gt;
&lt;br /&gt;
/templates/system/html/modules.php&lt;br /&gt;
&lt;br /&gt;
This file is maintained by the project so you should never modify it. You will lose your changes when you upgrade your Joomla! installation.&lt;br /&gt;
&lt;br /&gt;
To create your own chrome, or module styles, create or edit modules.php under the templates /html/ directory. (This is the same directory we have been talking about for component and module layout overrides).&lt;br /&gt;
&lt;br /&gt;
The rhuk_milkyway template provides some extra chrome as an example. (It provides an example style called &amp;quot;slider&amp;quot;). This can be found in the following file:&lt;br /&gt;
&lt;br /&gt;
/templates/rhuk_milkyway/html/modules.php&lt;br /&gt;
&lt;br /&gt;
Creating your own chrome is easy. Let&#039;s look at example that displays the module in a Definition List (a set of DL&#039;s, DT&#039;s and DD&#039;s).&lt;br /&gt;
&lt;br /&gt;
Just add the following function to the /html/modules.php file in your default template directory (create it if it does not exist):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Module chrome that wraps the module in a definition list&lt;br /&gt;
 */&lt;br /&gt;
function modChrome_dlist($module, &amp;amp;$params, &amp;amp;$attribs)&lt;br /&gt;
{ ?&amp;gt;&lt;br /&gt;
   &amp;lt;dl class=&amp;quot;&amp;lt;?php echo $params-&amp;gt;get(&#039;moduleclass_sfx&#039;); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;?php if ($module-&amp;gt;showtitle != 0) : ?&amp;gt;&lt;br /&gt;
	 &amp;lt;dt&amp;gt;&lt;br /&gt;
	    &amp;lt;?php echo $module-&amp;gt;title; ?&amp;gt;&lt;br /&gt;
	        &amp;lt;/dt&amp;gt;&lt;br /&gt;
	    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
		&amp;lt;dd&amp;gt;&lt;br /&gt;
	    &amp;lt;?php echo $module-&amp;gt;content; ?&amp;gt;&lt;br /&gt;
	        &amp;lt;/dd&amp;gt;&lt;br /&gt;
	    &amp;lt;/dl&amp;gt;&lt;br /&gt;
	&amp;lt;?php&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We will be calling the style &amp;quot;dlist&amp;quot;, so the name of the function needs to be modChrome_dlist.&lt;br /&gt;
&lt;br /&gt;
The function must take the three arguments as shown for the module object, the module parameters, and lastly the $attribs is an array of all the attributes in the jdoc XML tag.&lt;br /&gt;
&lt;br /&gt;
There are three main properties in the module object to be concerned with:&lt;br /&gt;
&lt;br /&gt;
* showtitle tells you whether to show the title of the module of not&lt;br /&gt;
* title is the title of the module&lt;br /&gt;
* content is the output of the module (from its layout)&lt;br /&gt;
&lt;br /&gt;
This is a very simple case and you can, of course, design more complex styles, possibly using custom atrributes in the XML tag.&lt;br /&gt;
&lt;br /&gt;
== Pagination Links Overrides ==&lt;br /&gt;
&lt;br /&gt;
The final override we will look at is the pagination override. This override can control the display of items-per-page and the pagination links used with lists of information, as shown in the following screenshot.&lt;br /&gt;
&lt;br /&gt;
[[Image:Article_list_pagination.png|Typical Joomla! page showing a paginated list.]]&lt;br /&gt;
&lt;br /&gt;
The rhuk_milkyway template provides a well-commented example for this override. The file is found here:&lt;br /&gt;
&lt;br /&gt;
/templates/rhuk_milkyway/html/pagination.php&lt;br /&gt;
&lt;br /&gt;
When the pagination list is required, Joomla! will look for this file in the default templates. If it is found, it will be loaded and the display functions it contains will be used.&lt;br /&gt;
&lt;br /&gt;
There are four functions that can be used:&lt;br /&gt;
&lt;br /&gt;
pagination_list_footer&lt;br /&gt;
&lt;br /&gt;
This function is responsible for showing the select list for the number of items to display per page.&lt;br /&gt;
&lt;br /&gt;
pagination_list_render&lt;br /&gt;
&lt;br /&gt;
This function is responsible for showing the list of page number links as well at the Start, End, Previous and Next links.&lt;br /&gt;
&lt;br /&gt;
pagination_item_active&lt;br /&gt;
&lt;br /&gt;
This function displays the links to other page numbers other than the &amp;quot;current&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
pagination_item_inactive&lt;br /&gt;
&lt;br /&gt;
This function displays the current page number, usually not hyperlinked.&lt;br /&gt;
&lt;br /&gt;
== Media Files Override ==&lt;br /&gt;
&lt;br /&gt;
This method allows 3rd party developers to override CSS and JS files that where inserted using the functions &amp;lt;code&amp;gt;JHtml::script()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;JHtml::stylesheet()&amp;lt;/code&amp;gt; and are stored inside the Joomla media folder. &lt;br /&gt;
&lt;br /&gt;
=== Supporting Media Files Override ===&lt;br /&gt;
&lt;br /&gt;
For this example we have a module called &amp;lt;code&amp;gt;mod_test&amp;lt;/code&amp;gt;, this module have a CSS file installed at:&lt;br /&gt;
&lt;br /&gt;
 /media/mod_test/css/mystyle.css&lt;br /&gt;
&lt;br /&gt;
That file should be inserted using the following functions and parameters:&lt;br /&gt;
&lt;br /&gt;
 JHtml::stylesheet(&#039;mod_test/mystyle.css&#039;, false, true, false);&lt;br /&gt;
&lt;br /&gt;
Note that the 3rd parameter (true) is the one that makes the Joomla API to look for an override file inside your current template folder.&lt;br /&gt;
&lt;br /&gt;
The override file must be placed as follow at your current template folder:&lt;br /&gt;
&lt;br /&gt;
 /templates/my_template/css/mod_test/mystyle.css&lt;br /&gt;
&lt;br /&gt;
== Cheat Sheet ==&lt;br /&gt;
Using the rhuk_milkyway template as an example, here is a brief summary of the principles we&#039;ve looked at.&lt;br /&gt;
=== Customise the Component Output ===&lt;br /&gt;
To override a component layout (for example the default layout in the article view), copy:&lt;br /&gt;
&lt;br /&gt;
/components/com_content/views/article/tmpl/default.php&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
/templates/rhuk_milkyway/html/com_content/article/default.php&lt;br /&gt;
&lt;br /&gt;
Read more about [[#Component Output Types and Layout Overrides|component output]].&lt;br /&gt;
&lt;br /&gt;
=== Customise the Module Output ===&lt;br /&gt;
To override a module layout (for example the Latest News module using the rhuk_milkyway template), copy:&lt;br /&gt;
&lt;br /&gt;
/modules/mod_latest_news/tmpl/default.php&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
/templates/rhuk_milkyway/html/mod_latest_news/default.php&lt;br /&gt;
&lt;br /&gt;
Read more about [[#Module Layout Overrides|module output]].&lt;br /&gt;
&lt;br /&gt;
=== Add New Module Styles ===&lt;br /&gt;
To add new module styles (chrome), add them to the following file:&lt;br /&gt;
&lt;br /&gt;
/templates/rhuk_milkyway/html/modules.php&lt;br /&gt;
&lt;br /&gt;
Read more about [[#Module Chrome|module chrome]].&lt;br /&gt;
&lt;br /&gt;
=== Customise the Pagination Links ===&lt;br /&gt;
To customise the way the items-per-page selector and pagination links display, edit the following file:&lt;br /&gt;
&lt;br /&gt;
/templates/rhuk_milkyway/html/pagination.php&lt;br /&gt;
&lt;br /&gt;
Read more about [[#Pagination Links Overrides|pagination]].&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Joomla! 1.5, through the use of an MVC paradigm has greatly improved the flexibility that is afforded to Web site designers. By way of a few simple principles, like copying certain files to certain places in your template, the designer is able to override almost all the output generated by Joomla!.&lt;/div&gt;</summary>
		<author><name>Renekorss</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_Content_History_in_your_Component&amp;diff=164760</id>
		<title>Using Content History in your Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_Content_History_in_your_Component&amp;diff=164760"/>
		<updated>2015-03-20T11:04:27Z</updated>

		<summary type="html">&lt;p&gt;Renekorss: added missing description to edit model to make restoring work&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In version 3.2, Joomla added the ability to track content history (also called versions) for all core components. This allows you to view and restore from prior versions of an article, banner, category, and other content types. This feature can easily be added to third-party components. This tutorial shows you how to do this. We will illustrate this by adding content history to an example component.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; This tutorial assumes that the component uses a JTable sub-class for its &amp;quot;CRUD&amp;quot; (create/update/delete) operations. If the component does not use JTable then the simplest thing to do is to re-work it to use JTable&#039;s store() and delete() methods. If you do that, you will be able to use the methods described in this tutorial.&lt;br /&gt;
&lt;br /&gt;
=Set up Working Environment=&lt;br /&gt;
&lt;br /&gt;
# Install a new instance of Joomla version 3.2 on your local workstation.&lt;br /&gt;
# Install the example component using the file com_joomprosubs_3.2.0.zip in the Extension Manager: Install screen. You can get the ZIP archive here: https://github.com/joomla/jdoc-examples/raw/master/zip_archives/com_joomprosubs-3.2.0.zip.&lt;br /&gt;
&lt;br /&gt;
At this point, you should be able to see the Joompro Subscriptions component in the Components menu in the back end of Joomla. This is the component before we have added content history to it.&lt;br /&gt;
&lt;br /&gt;
=Add Rows to Content Types Table=&lt;br /&gt;
The first thing we need to do is to add two new rows into the #__content_types table. This table stores information about the different tables for each content type. As of Joomla version 3.2, this table is used by the com_tags and com_contenthistory components to get information about each content type for which history is stored. The columns for #__content_types are as follows:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;type_id:&#039;&#039;&#039; auto-increment id number.&lt;br /&gt;
*&#039;&#039;&#039;type_title:&#039;&#039;&#039; descriptive title for this table.&lt;br /&gt;
*&#039;&#039;&#039;type_alias:&#039;&#039;&#039; &amp;lt;component name&amp;gt;.&amp;lt;type name&amp;gt;. For example: &amp;quot;com_content.article&amp;quot; or &amp;quot;com_content.category&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;table:&#039;&#039;&#039; JSON string that contains the name of the JTable class and other information about the table.&lt;br /&gt;
*&#039;&#039;&#039;rules:&#039;&#039;&#039; Not used as of Joomla version 3.2. &lt;br /&gt;
*&#039;&#039;&#039;field_mappings:&#039;&#039;&#039; Used by the com_tags component to map database columns from the component table to the ucm_content table.&lt;br /&gt;
*&#039;&#039;&#039;router:&#039;&#039;&#039; Optional location of the component&#039;s router, if any.&lt;br /&gt;
*&#039;&#039;&#039;content_history_options:&#039;&#039;&#039; JSON string used to store information for rendering the pop-up windows in the content history component. We will discuss this in detail later in this tutorial.&lt;br /&gt;
&lt;br /&gt;
Our example component uses a table called #__joompro_subscriptions to store each subscription. In addition, it uses the standard Joomla categories. So we will add a row in #__content_types for the category table and one for the component table.&lt;br /&gt;
&lt;br /&gt;
The row for the categories can be copied from the row for &amp;quot;Weblinks Category&amp;quot; (or any other category row). The only columns that need to be changed are &amp;lt;code&amp;gt;type_title&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;type_alias&amp;lt;/code&amp;gt;. The other columns are the same as for &amp;lt;code&amp;gt;com_weblinks.category&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The SQL statement for adding this row is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
INSERT INTO `#__content_types` (`type_id`, `type_title`, `type_alias`, `table`, `rules`, `field_mappings`, `router`, `content_history_options`) &lt;br /&gt;
VALUES&lt;br /&gt;
(null, &lt;br /&gt;
&#039;Subscription Category&#039;, &lt;br /&gt;
&#039;com_joomprosubs.category&#039;, &lt;br /&gt;
&#039;{&amp;quot;special&amp;quot;:{&amp;quot;dbtable&amp;quot;:&amp;quot;#__categories&amp;quot;,&amp;quot;key&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;Category&amp;quot;,&amp;quot;prefix&amp;quot;:&amp;quot;JTable&amp;quot;,&amp;quot;config&amp;quot;:&amp;quot;array()&amp;quot;},&amp;quot;common&amp;quot;:   {&amp;quot;dbtable&amp;quot;:&amp;quot;#__ucm_content&amp;quot;,&amp;quot;key&amp;quot;:&amp;quot;ucm_id&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;Corecontent&amp;quot;,&amp;quot;prefix&amp;quot;:&amp;quot;JTable&amp;quot;,&amp;quot;config&amp;quot;:&amp;quot;array()&amp;quot;}}&#039;, &lt;br /&gt;
&#039;&#039;, &lt;br /&gt;
&#039;{&amp;quot;common&amp;quot;:{&amp;quot;core_content_item_id&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;core_title&amp;quot;:&amp;quot;title&amp;quot;,&amp;quot;core_state&amp;quot;:&amp;quot;published&amp;quot;,&amp;quot;core_alias&amp;quot;:&amp;quot;alias&amp;quot;,&amp;quot;core_created_time&amp;quot;:&amp;quot;created_time&amp;quot;,&amp;quot;core_modified_time&amp;quot;:&amp;quot;modified_time&amp;quot;,&amp;quot;core_body&amp;quot;:&amp;quot;description&amp;quot;, &amp;quot;core_hits&amp;quot;:&amp;quot;hits&amp;quot;,&amp;quot;core_publish_up&amp;quot;:&amp;quot;null&amp;quot;,&amp;quot;core_publish_down&amp;quot;:&amp;quot;null&amp;quot;,&amp;quot;core_access&amp;quot;:&amp;quot;access&amp;quot;, &amp;quot;core_params&amp;quot;:&amp;quot;params&amp;quot;, &amp;quot;core_featured&amp;quot;:&amp;quot;null&amp;quot;, &amp;quot;core_metadata&amp;quot;:&amp;quot;metadata&amp;quot;, &amp;quot;core_language&amp;quot;:&amp;quot;language&amp;quot;, &amp;quot;core_images&amp;quot;:&amp;quot;null&amp;quot;, &amp;quot;core_urls&amp;quot;:&amp;quot;null&amp;quot;, &amp;quot;core_version&amp;quot;:&amp;quot;version&amp;quot;, &amp;quot;core_ordering&amp;quot;:&amp;quot;null&amp;quot;, &amp;quot;core_metakey&amp;quot;:&amp;quot;metakey&amp;quot;, &amp;quot;core_metadesc&amp;quot;:&amp;quot;metadesc&amp;quot;, &amp;quot;core_catid&amp;quot;:&amp;quot;parent_id&amp;quot;, &amp;quot;core_xreference&amp;quot;:&amp;quot;null&amp;quot;, &amp;quot;asset_id&amp;quot;:&amp;quot;asset_id&amp;quot;}, &amp;quot;special&amp;quot;:{&amp;quot;parent_id&amp;quot;:&amp;quot;parent_id&amp;quot;,&amp;quot;lft&amp;quot;:&amp;quot;lft&amp;quot;,&amp;quot;rgt&amp;quot;:&amp;quot;rgt&amp;quot;,&amp;quot;level&amp;quot;:&amp;quot;level&amp;quot;,&amp;quot;path&amp;quot;:&amp;quot;path&amp;quot;,&amp;quot;extension&amp;quot;:&amp;quot;extension&amp;quot;,&amp;quot;note&amp;quot;:&amp;quot;note&amp;quot;}}&#039;, &lt;br /&gt;
&#039;WeblinksHelperRoute::getCategoryRoute&#039;, &lt;br /&gt;
&#039;{&amp;quot;formFile&amp;quot;:&amp;quot;administrator\\/components\\/com_categories\\/models\\/forms\\/category.xml&amp;quot;, &amp;quot;hideFields&amp;quot;:[&amp;quot;asset_id&amp;quot;,&amp;quot;checked_out&amp;quot;,&amp;quot;checked_out_time&amp;quot;,&amp;quot;version&amp;quot;,&amp;quot;lft&amp;quot;,&amp;quot;rgt&amp;quot;,&amp;quot;level&amp;quot;,&amp;quot;path&amp;quot;,&amp;quot;extension&amp;quot;], &amp;quot;ignoreChanges&amp;quot;:[&amp;quot;modified_user_id&amp;quot;, &amp;quot;modified_time&amp;quot;, &amp;quot;checked_out&amp;quot;, &amp;quot;checked_out_time&amp;quot;, &amp;quot;version&amp;quot;, &amp;quot;hits&amp;quot;, &amp;quot;path&amp;quot;],&amp;quot;convertToInt&amp;quot;:[&amp;quot;publish_up&amp;quot;, &amp;quot;publish_down&amp;quot;], &amp;quot;displayLookup&amp;quot;:[{&amp;quot;sourceColumn&amp;quot;:&amp;quot;created_user_id&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__users&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;name&amp;quot;},{&amp;quot;sourceColumn&amp;quot;:&amp;quot;access&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__viewlevels&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;title&amp;quot;},{&amp;quot;sourceColumn&amp;quot;:&amp;quot;modified_user_id&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__users&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;name&amp;quot;},{&amp;quot;sourceColumn&amp;quot;:&amp;quot;parent_id&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__categories&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;title&amp;quot;}]}&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the actual subscriptions, we only need the following information in the content types table:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;type_title:&#039;&#039;&#039; &amp;lt;code&amp;gt;Subscriptions&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;type_alias:&#039;&#039;&#039; &amp;lt;code&amp;gt;com_joomprosubs.subscription&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;table:&#039;&#039;&#039; &lt;br /&gt;
::&amp;lt;pre&amp;gt;{&amp;quot;special&amp;quot;:{&amp;quot;dbtable&amp;quot;:&amp;quot;#__joompro_subscriptions&amp;quot;,&amp;quot;key&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;Subscription&amp;quot;,&amp;quot;prefix&amp;quot;:&amp;quot;JoomprosubsTable&amp;quot;}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
::This creates a JSON object as follows:&lt;br /&gt;
:::special:&lt;br /&gt;
:::dbtable = #__joompro_subscriptions&lt;br /&gt;
:::key = id&lt;br /&gt;
:::type = Subscription&lt;br /&gt;
:::prefix = JoomprosubsTable&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;type_alias&amp;lt;/code&amp;gt; column is used by the com_contenthistory component to find the row for each component in the #__content_types table. The &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; column gives the com_contenthistory component the information it needs to work with the JTable class for each component. The None of the other columns need to be set for now. Note that we will come back to the &amp;lt;code&amp;gt;content_history_options&amp;lt;/code&amp;gt; column later in the tutorial to improve the appearance of the pop-up window.&lt;br /&gt;
&lt;br /&gt;
The SQL for adding this second row to the #__content_types table is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;INSERT INTO `#__content_types` (`type_id`, `type_title`, `type_alias`, `table`, `rules`, `field_mappings`, `router`, `content_history_options`) &lt;br /&gt;
VALUES&lt;br /&gt;
(null, &lt;br /&gt;
&#039;Subscriptions&#039;, &lt;br /&gt;
&#039;com_joomprosubs.subscription&#039;, &lt;br /&gt;
&#039;{&amp;quot;special&amp;quot;:{&amp;quot;dbtable&amp;quot;:&amp;quot;#__joompro_subscriptions&amp;quot;,&amp;quot;key&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;Subscription&amp;quot;,&amp;quot;prefix&amp;quot;:&amp;quot;JoomprosubsTable&amp;quot;}}&#039;, &lt;br /&gt;
&#039;&#039;, &#039;&#039;, &#039;&#039;, &#039;&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines should be added to the file &amp;lt;code&amp;gt;administrator/components/com_joomprosubs/sql/install.mysql.utf8.sql&amp;lt;/code&amp;gt; so that these rows will be created when the component is installed. You should also run these commands on your database to add the two rows to your #__content_types table before going to the next section. Remember to change the placeholder prefix &amp;quot;#__&amp;quot; to the actual prefix for your database before running the SQL commands on your local database.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; When creating the values for the JSON strings, one trick is to copy from an existing row and edit the strings.&lt;br /&gt;
&lt;br /&gt;
=Add Component Level Options=&lt;br /&gt;
The content history component uses two options as follows.&lt;br /&gt;
*&#039;&#039;&#039;save_history:&#039;&#039;&#039; If Yes, history is saved. Otherwise, no history is saved.&lt;br /&gt;
*&#039;&#039;&#039;history_limit:&#039;&#039;&#039; If &amp;gt; 0, limits the number of different history versions saved in the database. For example, if this is set to 10, then when the 11th history version is saved, the oldest is deleted automatically.&lt;br /&gt;
&lt;br /&gt;
If our example component, we will add the following lines to the file &amp;lt;code&amp;gt;administrator/components/com_joomprosubs/config.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;fieldset name=&amp;quot;component&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;field&lt;br /&gt;
		name=&amp;quot;save_history&amp;quot;&lt;br /&gt;
		type=&amp;quot;radio&amp;quot;&lt;br /&gt;
		class=&amp;quot;btn-group btn-group-yesno&amp;quot;&lt;br /&gt;
		default=&amp;quot;1&amp;quot;&lt;br /&gt;
		label=&amp;quot;JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL&amp;quot;&lt;br /&gt;
		description=&amp;quot;JGLOBAL_SAVE_HISTORY_OPTIONS_DESC&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
		&amp;lt;option&lt;br /&gt;
			value=&amp;quot;0&amp;quot;&amp;gt;JNO&amp;lt;/option&amp;gt;&lt;br /&gt;
		&amp;lt;option&lt;br /&gt;
			value=&amp;quot;1&amp;quot;&amp;gt;JYES&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;/field&amp;gt;&lt;br /&gt;
		&lt;br /&gt;
	&amp;lt;field&lt;br /&gt;
		name=&amp;quot;history_limit&amp;quot;&lt;br /&gt;
		type=&amp;quot;text&amp;quot;&lt;br /&gt;
		filter=&amp;quot;integer&amp;quot;&lt;br /&gt;
		label=&amp;quot;JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL&amp;quot;&lt;br /&gt;
		description=&amp;quot;JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC&amp;quot;&lt;br /&gt;
		default=&amp;quot;5&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
With this code, we will now be able to add and save these options. Go into the Options for the component and set save_history to Yes and history_limit to 10.&lt;br /&gt;
&lt;br /&gt;
=Update Content History During Table Save and Delete=&lt;br /&gt;
Next we need to tell our component to call the content history methods during the save and delete operations. We can do this by adding this line of code to the &amp;lt;code&amp;gt;__construct()&amp;lt;/code&amp;gt; method of the &amp;lt;code&amp;gt;JoomprosubsTableSubscription&amp;lt;/code&amp;gt; class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JObserverMapper::addObserverClassToClass(&#039;JTableObserverContenthistory&#039;, &#039;JoomprosubsTableSubscription&#039;, array(&#039;typeAlias&#039; =&amp;gt; &#039;com_joomprosubs.subscription&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code registers the content history table as an observer class for our component table. When a row is saved or deleted from our table, the appropriate methods are called automatically for the content history table.&lt;br /&gt;
&lt;br /&gt;
At this point, we should be able to see content history working for the Joomprosubs categories. Test this by adding a new category for the component and then clicking on the Versions button in the toolbar. It should work exactly the same as categories for the core Joomla components.&lt;br /&gt;
&lt;br /&gt;
=Add type alias to model=&lt;br /&gt;
&lt;br /&gt;
To make restoring work, you need to add &amp;lt;code&amp;gt;$typeAlias&amp;lt;/code&amp;gt; property to your model class. Model is located in &amp;lt;code&amp;gt;administrator/components/com_joomprosubs/models/subscription.php&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public $typeAlias = &#039;com_joomprosubs.subscription&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If this is not set, you will get &amp;lt;code&amp;gt;Error restoring item version from history.&amp;lt;/code&amp;gt; error, because Joomla! can not find correct row from &amp;lt;code&amp;gt;#__content_types&amp;lt;/code&amp;gt; table.&lt;br /&gt;
&lt;br /&gt;
=Add Versions Button to Tool Bar=&lt;br /&gt;
At this point, categories are working completely and we are saving history versions in the #__ucm_history table for our component. However, we need to be able to access these changes on our edit screen. To do this, we need to add the Versions button to the edit screen&#039;s toolbar. We do this by adding this code to the file &amp;lt;code&amp;gt;administrator/components/com_joomprosubs/views/subscription/view.html.php&amp;lt;/code&amp;gt;, just before the code that adds the &amp;quot;cancel&amp;quot; button, as shown here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
else {&lt;br /&gt;
  if ($this-&amp;gt;state-&amp;gt;params-&amp;gt;get(&#039;save_history&#039;, 1) &amp;amp;&amp;amp; $user-&amp;gt;authorise(&#039;core.edit&#039;)) {&lt;br /&gt;
    JToolbarHelper::versions(&#039;com_joomprosubs.subscription&#039;, $this-&amp;gt;item-&amp;gt;id);&lt;br /&gt;
  }&lt;br /&gt;
  JToolBarHelper::cancel(&#039;subscription.cancel&#039;, &#039;JTOOLBAR_CLOSE&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code checks that we have the save_history option set and that we have edit permission for this component. If so, we show the Versions button using the &amp;lt;code&amp;gt;JToolbarHelper::versions()&amp;lt;/code&amp;gt; method. This method has two arguments: the type_alias and the primary key of the component item row in the database.&lt;br /&gt;
&lt;br /&gt;
With this code added, we can now go into the Joomprosubs component, add and save a new subscription, and now see the Versions button. If we click on it, we will see the Item Version History modal window open with our saved version.&lt;br /&gt;
&lt;br /&gt;
There are still two things missing, however. One is that we don&#039;t have a way to add the Version Note to each version. The second is that we don&#039;t currently have meaningful labels for the versions when we use the Preview or Compare features. We will address these in the next two sections of this tutorial.&lt;br /&gt;
&lt;br /&gt;
=Add Version Note Field to Form=&lt;br /&gt;
The content history feature adds a new field called &amp;quot;version_note&amp;quot; to the component edit form. This optional field is not saved in the component table. Instead, it is used to label the version in the content history table. &lt;br /&gt;
&lt;br /&gt;
To add this field to our component edit screen, we do changes to two files. First, we add the field to the XML form file &amp;lt;code&amp;gt;administrator/components/com_joomprosubs/models/forms/subscription.xml&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;version_note&amp;quot;&lt;br /&gt;
	type=&amp;quot;text&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_VERSION_NOTE_LABEL&amp;quot;&lt;br /&gt;
	description=&amp;quot;JGLOBAL_FIELD_VERSION_NOTE_DESC&amp;quot;&lt;br /&gt;
	class=&amp;quot;inputbox&amp;quot; size=&amp;quot;45&amp;quot;&lt;br /&gt;
	labelclass=&amp;quot;control-label&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can add it anywhere inside the fieldset element. Because we will place the field &amp;quot;created_by_alias&amp;quot; on the screen, we add it in the XML file after this element.&lt;br /&gt;
&lt;br /&gt;
Second, we add this code to the file &amp;lt;code&amp;gt;administrator/components/com_joomprosubs/views/subscription/tmpl/edit.php&amp;lt;/code&amp;gt;, just after the control group for &amp;quot;created_by_alias&amp;quot;, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;control-group&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;div class=&amp;quot;control-label&amp;quot;&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;version_note&#039;); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div class=&amp;quot;controls&amp;quot;&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;version_note&#039;); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can add in a version note and see this in the Item Version History modal window.&lt;br /&gt;
&lt;br /&gt;
=Add Labels to Pop-Up Windows=&lt;br /&gt;
At this point, everything works. However, when we use the pop-up Preview or Compare windows in the Item Version History modal, we see the database column names instead of the translated label from the form. Also, we see the category and user id numbers instead of the category name and user name.&lt;br /&gt;
&lt;br /&gt;
We can improve the readability of windows by entering in some additional about our component&#039;s table. This information is entered as a JSON-formatted string in the content_history_options column of the #__content_types table. The following information can be entered in this column.&lt;br /&gt;
*&#039;&#039;&#039;formfile:&#039;&#039;&#039; This is the path to the XML JForm file for this form. If you add this, the Preview and Compare views will look up the labels from this XML file. This way the user will see translated labels instead of the database column name.&lt;br /&gt;
*&#039;&#039;&#039;hideFields:&#039;&#039;&#039; Some database columns are not meaningful for the user when viewing the item. For example, asset_id or check_out_time are not things that appear in the form and are not helpful to the user when figuring out the contents of an item. This is entered as an array of column names.&lt;br /&gt;
*&#039;&#039;&#039;ignoreChanges:&#039;&#039;&#039; The content history component uses a &amp;quot;hash&amp;quot; calculation (Sha1) to determine whether an item has changed. This allows you to see which version in history matches the current version. It also prevents duplicate versions from being saved in the content history table (for example, if you press the &amp;quot;save&amp;quot; button without making any changes). For this to work properly, we need to exclude some columns from the hash calculate. The &amp;quot;ignoreChanges&amp;quot; lets you exclude some database columns from the hash so that changes to these columns will not be considered real changes to the item. For example, columns such as &amp;quot;hits&amp;quot; or &amp;quot;modified_time&amp;quot; will change with each save, even if no meaningful data was changed in the item. This is an array of database column names.&lt;br /&gt;
*&#039;&#039;&#039;convertToInt:&#039;&#039;&#039; When the hash value is created, it uses a JSON array of the database column values. In some cases, such as start and stop publishing dates, the value might be blank when a row is first created and then a different value after the item is saved. To get a consistent hash value for the first and subsequent saves, these values can be converted to integers before the hash is created. That way, we don&#039;t think a value has changed when it really hasn&#039;t. This is an array of database column names.&lt;br /&gt;
*&#039;&#039;&#039;displayLookup:&#039;&#039;&#039; Here we can define how to display more meaningful data, for example, displaying a category title or user name instead of the ID. This is stored as an array of PHP standard class objects. Each object has the following fields.&lt;br /&gt;
:*&#039;&#039;sourceColumn:&#039;&#039; The column in the form to replace. For example, the &amp;quot;created_user_id&amp;quot; or &amp;quot;catid&amp;quot;.&lt;br /&gt;
:*&#039;&#039;targetTable:&#039;&#039; The database table to get the title or name. For example, &amp;quot;#__users&amp;quot; or &amp;quot;#__categories&amp;quot;.&lt;br /&gt;
:*&#039;&#039;targetColumn:&#039;&#039; The column in the target table to use in the SQL query JOIN statement. For example, &amp;quot;id&amp;quot;.&lt;br /&gt;
:*&#039;&#039;displayColumn:&#039;&#039; The column in the target table to display in the Preview or Compare pop-up window. For example, &amp;quot;name&amp;quot; or &amp;quot;title&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In our example component, we need the following values.&lt;br /&gt;
*&#039;&#039;&#039;formfile:&#039;&#039;&#039; &amp;lt;code&amp;gt;administrator/components/com_joomprosubs/models/forms/subscription.xml&amp;lt;/code&amp;gt;. &lt;br /&gt;
*&#039;&#039;&#039;hideFields:&#039;&#039;&#039; checked_out, checked_out_time, params, langauge. The last two columns are not used.&lt;br /&gt;
*&#039;&#039;&#039;ignoreChanges:&#039;&#039;&#039; modified_by, modified, checked_out, checked_out_time. &lt;br /&gt;
*&#039;&#039;&#039;convertToInt:&#039;&#039;&#039; publish_up, publish_down.&lt;br /&gt;
*&#039;&#039;&#039;displayLookup:&#039;&#039;&#039; We look up five fields: catid, group_id, created_by, access, and modified_by. The values for each are as follows.&lt;br /&gt;
:*&#039;&#039;sourceColumn:&#039;&#039; catid&lt;br /&gt;
:*&#039;&#039;targetTable:&#039;&#039; #__categories&lt;br /&gt;
:*&#039;&#039;targetColumn:&#039;&#039; id&lt;br /&gt;
:*&#039;&#039;displayColumn:&#039;&#039; title&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;sourceColumn:&#039;&#039; group_id&lt;br /&gt;
:*&#039;&#039;targetTable:&#039;&#039; #__usergroups&lt;br /&gt;
:*&#039;&#039;targetColumn:&#039;&#039; id&lt;br /&gt;
:*&#039;&#039;displayColumn:&#039;&#039; title&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;sourceColumn:&#039;&#039; created_by&lt;br /&gt;
:*&#039;&#039;targetTable:&#039;&#039; #__users&lt;br /&gt;
:*&#039;&#039;targetColumn:&#039;&#039; id&lt;br /&gt;
:*&#039;&#039;displayColumn:&#039;&#039; name&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;sourceColumn:&#039;&#039; access&lt;br /&gt;
:*&#039;&#039;targetTable:&#039;&#039; #__viewlevels&lt;br /&gt;
:*&#039;&#039;targetColumn:&#039;&#039; id&lt;br /&gt;
:*&#039;&#039;displayColumn:&#039;&#039; title&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;sourceColumn:&#039;&#039; modified_by&lt;br /&gt;
:*&#039;&#039;targetTable:&#039;&#039; #__users &lt;br /&gt;
:*&#039;&#039;targetColumn:&#039;&#039; id&lt;br /&gt;
:*&#039;&#039;displayColumn:&#039;&#039; name&lt;br /&gt;
&lt;br /&gt;
The entire JSON string for this column is as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
{&amp;quot;formFile&amp;quot;:&amp;quot;administrator\/components\/com_joomprosubs\/models\/forms\/subscription.xml&amp;quot;, &lt;br /&gt;
&amp;quot;hideFields&amp;quot;:[&amp;quot;checked_out&amp;quot;,&amp;quot;checked_out_time&amp;quot;,&amp;quot;params&amp;quot;,&amp;quot;language&amp;quot;], &lt;br /&gt;
&amp;quot;ignoreChanges&amp;quot;:[&amp;quot;modified_by&amp;quot;, &amp;quot;modified&amp;quot;, &amp;quot;checked_out&amp;quot;, &amp;quot;checked_out_time&amp;quot;], &lt;br /&gt;
&amp;quot;convertToInt&amp;quot;:[&amp;quot;publish_up&amp;quot;, &amp;quot;publish_down&amp;quot;], &lt;br /&gt;
&amp;quot;displayLookup&amp;quot;:[&lt;br /&gt;
{&amp;quot;sourceColumn&amp;quot;:&amp;quot;catid&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__categories&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;title&amp;quot;},&lt;br /&gt;
{&amp;quot;sourceColumn&amp;quot;:&amp;quot;group_id&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__usergroups&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;title&amp;quot;},&lt;br /&gt;
{&amp;quot;sourceColumn&amp;quot;:&amp;quot;created_by&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__users&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;name&amp;quot;},&lt;br /&gt;
{&amp;quot;sourceColumn&amp;quot;:&amp;quot;access&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__viewlevels&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;title&amp;quot;},&lt;br /&gt;
{&amp;quot;sourceColumn&amp;quot;:&amp;quot;modified_by&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__users&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;name&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the slashes are escaped inside the JSON string. In order to get this column correctly into the database when our component is installed, we need to modify the file &amp;lt;code&amp;gt;administrator/components/com_joomprosubs/sql/install.mysql.utf8.sql&amp;lt;/code&amp;gt; where we create the #__content_types for for the component as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
INSERT INTO `#__content_types` (`type_id`, `type_title`, `type_alias`, `table`, `rules`, `field_mappings`, `router`, `content_history_options`) VALUES&lt;br /&gt;
(null, &#039;Subscriptions&#039;, &#039;com_joomprosubs.subscription&#039;, &#039;{&amp;quot;special&amp;quot;:{&amp;quot;dbtable&amp;quot;:&amp;quot;#__joompro_subscriptions&amp;quot;,&amp;quot;key&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;Subscription&amp;quot;,&amp;quot;prefix&amp;quot;:&amp;quot;JoomprosubsTable&amp;quot;}}&#039;, &#039;&#039;, &#039;&#039;, &#039;&#039;, &#039;{&amp;quot;formFile&amp;quot;:&amp;quot;administrator\\/components\\/com_joomprosubs\\/models\\/forms\\/subscription.xml&amp;quot;, &amp;quot;hideFields&amp;quot;:[&amp;quot;checked_out&amp;quot;,&amp;quot;checked_out_time&amp;quot;,&amp;quot;params&amp;quot;,&amp;quot;language&amp;quot;], &amp;quot;ignoreChanges&amp;quot;:[&amp;quot;modified_by&amp;quot;, &amp;quot;modified&amp;quot;, &amp;quot;checked_out&amp;quot;, &amp;quot;checked_out_time&amp;quot;], &amp;quot;convertToInt&amp;quot;:[&amp;quot;publish_up&amp;quot;, &amp;quot;publish_down&amp;quot;], &amp;quot;displayLookup&amp;quot;:[{&amp;quot;sourceColumn&amp;quot;:&amp;quot;catid&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__categories&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;title&amp;quot;},{&amp;quot;sourceColumn&amp;quot;:&amp;quot;group_id&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__usergroups&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;title&amp;quot;},{&amp;quot;sourceColumn&amp;quot;:&amp;quot;created_by&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__users&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;name&amp;quot;},{&amp;quot;sourceColumn&amp;quot;:&amp;quot;access&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__viewlevels&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;title&amp;quot;},{&amp;quot;sourceColumn&amp;quot;:&amp;quot;modified_by&amp;quot;,&amp;quot;targetTable&amp;quot;:&amp;quot;#__users&amp;quot;,&amp;quot;targetColumn&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;displayColumn&amp;quot;:&amp;quot;name&amp;quot;} ]}&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;quot;/&amp;quot; characters are now preceeded by two escape &amp;quot;\&amp;quot; characters. The first one is the SQL escape character for the second &amp;quot;\&amp;quot; character. The second &amp;quot;\&amp;quot; is the JSON escape character for the &amp;quot;/&amp;quot; character.&lt;br /&gt;
&lt;br /&gt;
With this change to the SQL install file, the changes for content history are complete.&lt;br /&gt;
&lt;br /&gt;
=Update Extension SQL Files=&lt;br /&gt;
To tidy things up, should should edit the uninstall SQL file to remove the rows from the #__content_types table. Also, if your component uses the one-click update feature, you should create a SQL file to create these rows when the component is updated.&lt;br /&gt;
&lt;br /&gt;
Hopefully, this tutorial will help you as you update your component to take advantage of the content history feature in Joomla. You can download the com_joomprosubs component with the code for content history added here: https://github.com/joomla/jdoc-examples/raw/master/zip_archives/com_joomprosubs-3.2.1.zip. &lt;br /&gt;
&lt;br /&gt;
[[Category:Development]][[Category:Content History]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Renekorss</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Extensions_packing&amp;diff=104569</id>
		<title>Extensions packing</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Extensions_packing&amp;diff=104569"/>
		<updated>2013-10-24T11:51:13Z</updated>

		<summary type="html">&lt;p&gt;Renekorss: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete}}&lt;br /&gt;
{{RightTOC}}&lt;br /&gt;
Recommendations when creating packs to distribute extensions:&lt;br /&gt;
== Single extension ==&lt;br /&gt;
Name it with extension type and version at end&lt;br /&gt;
 * com_extensionxyz_v1.0.zip&lt;br /&gt;
 * mod_extensionxyz_v1.0.zip&lt;br /&gt;
 * plg_extensionxyz_v1.0.zip&lt;br /&gt;
&lt;br /&gt;
== Multiple extensions pack == &lt;br /&gt;
If creating zip/tar files that require unzipping prior to install name the zip accordingly:&lt;br /&gt;
 * extensionxyz_v1.0_UNZIPME.zip&lt;br /&gt;
It&#039;s strongly recommended to use [[Package|Package]] ({{JVer|2.5}} and higher) for multiple extensions. This avoids unpacking and is easily installable.&lt;br /&gt;
== Test it ==&lt;br /&gt;
Please do test the zip/tar file and install it in a Joomla test server before release your file.&lt;br /&gt;
&lt;br /&gt;
[[Category:JED]]{{stub}}&lt;br /&gt;
[[Category:Stubs]]&lt;/div&gt;</summary>
		<author><name>Renekorss</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Deploying_an_Update_Server&amp;diff=104568</id>
		<title>Deploying an Update Server</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Deploying_an_Update_Server&amp;diff=104568"/>
		<updated>2013-10-24T11:18:35Z</updated>

		<summary type="html">&lt;p&gt;Renekorss: /* Contributors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.x}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is designed to teach developers how to create an update server for integration with the update system introduced in Joomla!.  By adding an update server listing to your extension&#039;s manifest, developers enable users to update their extensions via the Extension Manager&#039;s Update (see [[Help25:Extensions Extension Manager Update|Joomla 2.5]] and [[Help31:Extensions Extension Manager Update|Joomla 3.x]] helpscreens) view with only a few clicks.&lt;br /&gt;
&lt;br /&gt;
== Defining an update server ==&lt;br /&gt;
In order to use this feature, an update server must be defined in your extension&#039;s manifest.  This definition can be used in all Joomla! 2.5 and newer compatible extensions but is not available for templates.  You can use two options for your server type; collection or extension.  These will be explained in detail shortly.  This code should be added to the extension manifest file, within the root &amp;quot;extension&amp;quot; element. The update server is defined as follows for each type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;extension&amp;gt;&lt;br /&gt;
 &amp;lt;...&amp;gt;&lt;br /&gt;
 &amp;lt;updateservers&amp;gt;&lt;br /&gt;
    &amp;lt;server type=&amp;quot;collection&amp;quot;&amp;gt;http://example.com/list.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;2&amp;quot; name=&amp;quot;My Extension&#039;s Updates&amp;quot;&amp;gt;http://example.com/extension.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
 &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Multiple servers can be defined within the &amp;lt;updateservers&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
== Server types ==&lt;br /&gt;
=== Collection ===&lt;br /&gt;
The collection server type allows developers to define an extension&#039;s manifest to pull updates from a collection.  This type of server can be used if the developer wants to define all of their extension&#039;s updates in a single file (not recommended) or if their extension has multiple sub-extensions which are not distributed or updated at the same time (such as a package extension type).  The below example is the collection definition used by the updater when processing core Joomla! updates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;extensionset name=&amp;quot;Joomla Core&amp;quot; description=&amp;quot;Joomla! Core&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;extension name=&amp;quot;Joomla&amp;quot; element=&amp;quot;joomla&amp;quot; type=&amp;quot;file&amp;quot; version=&amp;quot;1.7.0&amp;quot; detailsurl=&amp;quot;http://update.joomla.org/core/extension.xml&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/extensionset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All definitions must be defined between &amp;lt;extensionset&amp;gt; tags in your collection manifest.  The &amp;lt;extensionset&amp;gt; tag has two optional parameters; name and description.  For each extension that this collection references, a separate &amp;lt;extension&amp;gt; tag is required.  The &amp;lt;extension&amp;gt; tag has the following parameters, all of which are required for updates to properly process:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - The name of the extension&lt;br /&gt;
* &#039;&#039;&#039;element&#039;&#039;&#039; - The untranslated extension name i.e. mod_custom&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; - The extension type (component, module, plugin, etc.)&lt;br /&gt;
* &#039;&#039;&#039;version&#039;&#039;&#039; - The latest version of the extension&lt;br /&gt;
* &#039;&#039;&#039;detailsurl&#039;&#039;&#039; - The URL of the XML file which contains that extension&#039;s individual update definitions&lt;br /&gt;
&lt;br /&gt;
=== Extension ===&lt;br /&gt;
The extension server type allows developers to define an extension&#039;s manifest to pull updates from a single extension&#039;s manifest.  All collection manifests eventually point to this XML file.  All updates in this file must be defined after an &amp;lt;updates&amp;gt; tag at the beginning of the file.  The below example is the update definition for the Joomla! 1.7.0 release:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;update&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;Joomla! 1.7&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;Joomla! 1.7 CMS&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;element&amp;gt;joomla&amp;lt;/element&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;file&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.7.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;infourl title=&amp;quot;Joomla!&amp;quot;&amp;gt;http://www.joomla.org/&amp;lt;/infourl&amp;gt;&lt;br /&gt;
    &amp;lt;downloads&amp;gt;&lt;br /&gt;
        &amp;lt;downloadurl type=&amp;quot;full&amp;quot; format=&amp;quot;zip&amp;quot;&amp;gt;http://joomlacode.org/gf/download/frsrelease/15279/66552/Joomla_1.6.5_to_1.7.0_Package.zip&amp;lt;/downloadurl&amp;gt;&lt;br /&gt;
    &amp;lt;/downloads&amp;gt;&lt;br /&gt;
    &amp;lt;tags&amp;gt;&lt;br /&gt;
        &amp;lt;tag&amp;gt;stable&amp;lt;/tag&amp;gt;&lt;br /&gt;
    &amp;lt;/tags&amp;gt;&lt;br /&gt;
    &amp;lt;maintainer&amp;gt;Sam Moffatt&amp;lt;/maintainer&amp;gt;&lt;br /&gt;
    &amp;lt;maintainerurl&amp;gt;http://sammoffatt.com.au&amp;lt;/maintainerurl&amp;gt;&lt;br /&gt;
    &amp;lt;section&amp;gt;Testing&amp;lt;/section&amp;gt;&lt;br /&gt;
    &amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;1.6&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following section describes the elements of a single update entity.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - The name of the extension, this name will appear in the Name column of the Extension Manager&#039;s Update view (required)&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; - A short description of the extension (optional) -- if you choose to use &amp;lt;![CDATA[]]&amp;gt;, double-quotes will break the HTML formatting.  Use single quotes with your HTML entities.&lt;br /&gt;
* &#039;&#039;&#039;element&#039;&#039;&#039; - The installed name of the extension (required). For plugins, this needs to be same as plugin attribute value for main file in plugin manifest. For &amp;lt;filename plugin=&amp;quot;pluginname&amp;quot;&amp;gt;pluginname.php&amp;lt;/filename&amp;gt;, element value should be &#039;&#039;&#039;pluginname&#039;&#039;&#039;. &lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; - The type of extension (component, module, plugin, etc.) (required)&lt;br /&gt;
* &#039;&#039;&#039;folder&#039;&#039;&#039; - Specific to plugins, this tag describes the type of plugin being updated (content, system, etc.) (required for plugins)&lt;br /&gt;
* &#039;&#039;&#039;client&#039;&#039;&#039; (usually optional, required for J! 1.7.3 due to a regression; but highly encouraged regardless) - The client ID of the extension, which can be found by looking inside the #__extensions table. To date, use 0 for &amp;quot;site&amp;quot; and 1 for &amp;quot;administrator&amp;quot;. Plugins and front-end modules are automatically installed with a client of 0 (site), but you will need to specify the client in an update or it will default to 1 (administrator) and then found update would not be shown because it would not match any extension. Components are automatically installed with a client of 1, which is currently the default.&lt;br /&gt;
** &#039;&#039;Warning&#039;&#039;: The tag name is &amp;lt;&#039;&#039;&#039;client&#039;&#039;&#039;&amp;gt; for Joomla! 2.5 and &amp;lt;&#039;&#039;&#039;client_id&#039;&#039;&#039;&amp;gt; for 1.6 and 1.7. If you use &amp;lt;client_id&amp;gt; (rather than &amp;lt;client&amp;gt;) on a 2.5 site, it will be ignored.&lt;br /&gt;
* &#039;&#039;&#039;version&#039;&#039;&#039; - The version of the release (required)&lt;br /&gt;
* &#039;&#039;&#039;infourl&#039;&#039;&#039; - A URL to point users to containing information about the update (optional) (In CMS 2.5, if set, this URL will be displayed in the update view)&lt;br /&gt;
* &#039;&#039;&#039;downloads&#039;&#039;&#039; - The section which lists all download locations&lt;br /&gt;
** &#039;&#039;&#039;downloadurl&#039;&#039;&#039; - The URL to download the extension from; the &amp;lt;downloadurl&amp;gt; tag has two required parameters:&lt;br /&gt;
*** &#039;&#039;&#039;type&#039;&#039;&#039; - The type of package (full or upgrade)&lt;br /&gt;
*** &#039;&#039;&#039;format&#039;&#039;&#039; - The format of the package (zip, tar, etc.)&lt;br /&gt;
* &#039;&#039;&#039;tags&#039;&#039;&#039; - Optional (unknown use)&lt;br /&gt;
* &#039;&#039;&#039;maintainer&#039;&#039;&#039; - The name of the extension maintainer (similar to the &amp;lt;author&amp;gt; tag in a manifest) (optional)&lt;br /&gt;
* &#039;&#039;&#039;maintainerurl&#039;&#039;&#039; - The website of the extension maintainer (similar to the &amp;lt;authorUrl&amp;gt; tag in a manifest) (optional)&lt;br /&gt;
* &#039;&#039;&#039;section&#039;&#039;&#039; - Optional (unknown use)&lt;br /&gt;
* &#039;&#039;&#039;targetplatform&#039;&#039;&#039; - A tag to define platform requirements, requires the following elements&lt;br /&gt;
** &#039;&#039;&#039;name&#039;&#039;&#039; - The name of the platform dependency; as of this writing, it should ONLY be &amp;quot;joomla&amp;quot;&lt;br /&gt;
** &#039;&#039;&#039;version&#039;&#039;&#039; - The version of Joomla! the extension supports&lt;br /&gt;
** &#039;&#039;&#039;min_dev_level&#039;&#039;&#039; and &#039;&#039;&#039;max_dev_level&#039;&#039;&#039; - These attributes were added in 3.0.1 to allow you to select a target platform based on the developer level (&amp;quot;z&amp;quot; in x.y.z). They are optional. You can specifiy either one or both. If omitted, all developer levels are matched. For example, the following matches versions 4.0.0 and 4.0.1. &amp;lt;code&amp;gt;&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;4.0&amp;quot; min_dev_level=&amp;quot;0&amp;quot; max_dev_level=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &#039;&#039;&#039;Note:&#039;&#039;&#039; If your extension is Joomla! 2.5 and/or 3.1 compatible, you will be required to have separate &amp;lt;update&amp;gt; definitions for each version due to the manner in which the updater checks the version if you specify a number. However to show your extension on all Joomla versions that support automatic updates add &amp;lt;code&amp;gt;&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;.*&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;. If you want your extension to show on all {{JVer|3.x}} versions then rather than specifying a version in the version tag add in &amp;lt;code&amp;gt;&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;3.[012345]&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;. This will show the update to all 3.x versions.&lt;br /&gt;
&lt;br /&gt;
A separate &amp;lt;update&amp;gt; definition will be required for each version of your extension you release.&lt;br /&gt;
&lt;br /&gt;
The values of &#039;&#039;&#039;element&#039;&#039;&#039;, &#039;&#039;&#039;type&#039;&#039;&#039;, &#039;&#039;&#039;client_id&#039;&#039;&#039; and &#039;&#039;&#039;folder&#039;&#039;&#039; should match those in the table #__extensions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important for plugins:&#039;&#039;&#039; Plugins have to include &amp;lt;folder&amp;gt; and &amp;lt;client&amp;gt; elements to work properly&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
* &#039;&#039;&#039;SQL update script is not executed during update.&#039;&#039;&#039; &lt;br /&gt;
:If the SQL update script (for example, in the folder &amp;lt;code&amp;gt;sql/updates/mysql&amp;lt;/code&amp;gt;) does not get executed during the update process, it could be because there is no version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table for this extension &#039;&#039;prior to the update&#039;&#039;. This value is determined by the last script name in the SQL updates folder. If this value is blank, no SQL scripts will be executed during that update cycle. To make sure this value is set correctly, make sure you have a SQL script in this folder with its name as the version number (for example, 1.2.3.sql if the version is 1.2.3). The file can be empty or just have a SQL comment line. This should be done in the old version -- the one before the update. Alternatively, you can add this value to the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; using a SQL query. &lt;br /&gt;
&lt;br /&gt;
== Supporting Tools ==&lt;br /&gt;
Maintaining your update server files can be difficult depending on the manner in which you set up your files.  An extension which can help you to maintain this is the Akeeba Release System, available free of charge from https://www.akeebabackup.com&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:mbabker|Michael Babker]]&lt;br /&gt;
*[[User:Renekorss|Rene Korss]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Renekorss</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Deploying_an_Update_Server&amp;diff=104565</id>
		<title>Deploying an Update Server</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Deploying_an_Update_Server&amp;diff=104565"/>
		<updated>2013-10-22T10:36:00Z</updated>

		<summary type="html">&lt;p&gt;Renekorss: Element confusion. Developers often add plg_ in front.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.x}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is designed to teach developers how to create an update server for integration with the update system introduced in Joomla!.  By adding an update server listing to your extension&#039;s manifest, developers enable users to update their extensions via the Extension Manager&#039;s Update (see [[Help25:Extensions Extension Manager Update|Joomla 2.5]] and [[Help31:Extensions Extension Manager Update|Joomla 3.x]] helpscreens) view with only a few clicks.&lt;br /&gt;
&lt;br /&gt;
== Defining an update server ==&lt;br /&gt;
In order to use this feature, an update server must be defined in your extension&#039;s manifest.  This definition can be used in all Joomla! 2.5 and newer compatible extensions but is not available for templates.  You can use two options for your server type; collection or extension.  These will be explained in detail shortly.  This code should be added to the extension manifest file, within the root &amp;quot;extension&amp;quot; element. The update server is defined as follows for each type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;extension&amp;gt;&lt;br /&gt;
 &amp;lt;...&amp;gt;&lt;br /&gt;
 &amp;lt;updateservers&amp;gt;&lt;br /&gt;
    &amp;lt;server type=&amp;quot;collection&amp;quot;&amp;gt;http://example.com/list.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;2&amp;quot; name=&amp;quot;My Extension&#039;s Updates&amp;quot;&amp;gt;http://example.com/extension.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
 &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Multiple servers can be defined within the &amp;lt;updateservers&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
== Server types ==&lt;br /&gt;
=== Collection ===&lt;br /&gt;
The collection server type allows developers to define an extension&#039;s manifest to pull updates from a collection.  This type of server can be used if the developer wants to define all of their extension&#039;s updates in a single file (not recommended) or if their extension has multiple sub-extensions which are not distributed or updated at the same time (such as a package extension type).  The below example is the collection definition used by the updater when processing core Joomla! updates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;extensionset name=&amp;quot;Joomla Core&amp;quot; description=&amp;quot;Joomla! Core&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;extension name=&amp;quot;Joomla&amp;quot; element=&amp;quot;joomla&amp;quot; type=&amp;quot;file&amp;quot; version=&amp;quot;1.7.0&amp;quot; detailsurl=&amp;quot;http://update.joomla.org/core/extension.xml&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/extensionset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All definitions must be defined between &amp;lt;extensionset&amp;gt; tags in your collection manifest.  The &amp;lt;extensionset&amp;gt; tag has two optional parameters; name and description.  For each extension that this collection references, a separate &amp;lt;extension&amp;gt; tag is required.  The &amp;lt;extension&amp;gt; tag has the following parameters, all of which are required for updates to properly process:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - The name of the extension&lt;br /&gt;
* &#039;&#039;&#039;element&#039;&#039;&#039; - The untranslated extension name i.e. mod_custom&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; - The extension type (component, module, plugin, etc.)&lt;br /&gt;
* &#039;&#039;&#039;version&#039;&#039;&#039; - The latest version of the extension&lt;br /&gt;
* &#039;&#039;&#039;detailsurl&#039;&#039;&#039; - The URL of the XML file which contains that extension&#039;s individual update definitions&lt;br /&gt;
&lt;br /&gt;
=== Extension ===&lt;br /&gt;
The extension server type allows developers to define an extension&#039;s manifest to pull updates from a single extension&#039;s manifest.  All collection manifests eventually point to this XML file.  All updates in this file must be defined after an &amp;lt;updates&amp;gt; tag at the beginning of the file.  The below example is the update definition for the Joomla! 1.7.0 release:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;update&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;Joomla! 1.7&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;Joomla! 1.7 CMS&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;element&amp;gt;joomla&amp;lt;/element&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;file&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.7.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;infourl title=&amp;quot;Joomla!&amp;quot;&amp;gt;http://www.joomla.org/&amp;lt;/infourl&amp;gt;&lt;br /&gt;
    &amp;lt;downloads&amp;gt;&lt;br /&gt;
        &amp;lt;downloadurl type=&amp;quot;full&amp;quot; format=&amp;quot;zip&amp;quot;&amp;gt;http://joomlacode.org/gf/download/frsrelease/15279/66552/Joomla_1.6.5_to_1.7.0_Package.zip&amp;lt;/downloadurl&amp;gt;&lt;br /&gt;
    &amp;lt;/downloads&amp;gt;&lt;br /&gt;
    &amp;lt;tags&amp;gt;&lt;br /&gt;
        &amp;lt;tag&amp;gt;stable&amp;lt;/tag&amp;gt;&lt;br /&gt;
    &amp;lt;/tags&amp;gt;&lt;br /&gt;
    &amp;lt;maintainer&amp;gt;Sam Moffatt&amp;lt;/maintainer&amp;gt;&lt;br /&gt;
    &amp;lt;maintainerurl&amp;gt;http://sammoffatt.com.au&amp;lt;/maintainerurl&amp;gt;&lt;br /&gt;
    &amp;lt;section&amp;gt;Testing&amp;lt;/section&amp;gt;&lt;br /&gt;
    &amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;1.6&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following section describes the elements of a single update entity.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - The name of the extension, this name will appear in the Name column of the Extension Manager&#039;s Update view (required)&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; - A short description of the extension (optional) -- if you choose to use &amp;lt;![CDATA[]]&amp;gt;, double-quotes will break the HTML formatting.  Use single quotes with your HTML entities.&lt;br /&gt;
* &#039;&#039;&#039;element&#039;&#039;&#039; - The installed name of the extension (required). For plugins, this needs to be same as plugin attribute value for main file in plugin manifest. For &amp;lt;filename plugin=&amp;quot;pluginname&amp;quot;&amp;gt;pluginname.php&amp;lt;/filename&amp;gt;, element value should be &#039;&#039;&#039;pluginname&#039;&#039;&#039;. &lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; - The type of extension (component, module, plugin, etc.) (required)&lt;br /&gt;
* &#039;&#039;&#039;folder&#039;&#039;&#039; - Specific to plugins, this tag describes the type of plugin being updated (content, system, etc.) (required for plugins)&lt;br /&gt;
* &#039;&#039;&#039;client&#039;&#039;&#039; (usually optional, required for J! 1.7.3 due to a regression; but highly encouraged regardless) - The client ID of the extension, which can be found by looking inside the #__extensions table. To date, use 0 for &amp;quot;site&amp;quot; and 1 for &amp;quot;administrator&amp;quot;. Plugins and front-end modules are automatically installed with a client of 0 (site), but you will need to specify the client in an update or it will default to 1 (administrator) and then found update would not be shown because it would not match any extension. Components are automatically installed with a client of 1, which is currently the default.&lt;br /&gt;
** &#039;&#039;Warning&#039;&#039;: The tag name is &amp;lt;&#039;&#039;&#039;client&#039;&#039;&#039;&amp;gt; for Joomla! 2.5 and &amp;lt;&#039;&#039;&#039;client_id&#039;&#039;&#039;&amp;gt; for 1.6 and 1.7. If you use &amp;lt;client_id&amp;gt; (rather than &amp;lt;client&amp;gt;) on a 2.5 site, it will be ignored.&lt;br /&gt;
* &#039;&#039;&#039;version&#039;&#039;&#039; - The version of the release (required)&lt;br /&gt;
* &#039;&#039;&#039;infourl&#039;&#039;&#039; - A URL to point users to containing information about the update (optional) (In CMS 2.5, if set, this URL will be displayed in the update view)&lt;br /&gt;
* &#039;&#039;&#039;downloads&#039;&#039;&#039; - The section which lists all download locations&lt;br /&gt;
** &#039;&#039;&#039;downloadurl&#039;&#039;&#039; - The URL to download the extension from; the &amp;lt;downloadurl&amp;gt; tag has two required parameters:&lt;br /&gt;
*** &#039;&#039;&#039;type&#039;&#039;&#039; - The type of package (full or upgrade)&lt;br /&gt;
*** &#039;&#039;&#039;format&#039;&#039;&#039; - The format of the package (zip, tar, etc.)&lt;br /&gt;
* &#039;&#039;&#039;tags&#039;&#039;&#039; - Optional (unknown use)&lt;br /&gt;
* &#039;&#039;&#039;maintainer&#039;&#039;&#039; - The name of the extension maintainer (similar to the &amp;lt;author&amp;gt; tag in a manifest) (optional)&lt;br /&gt;
* &#039;&#039;&#039;maintainerurl&#039;&#039;&#039; - The website of the extension maintainer (similar to the &amp;lt;authorUrl&amp;gt; tag in a manifest) (optional)&lt;br /&gt;
* &#039;&#039;&#039;section&#039;&#039;&#039; - Optional (unknown use)&lt;br /&gt;
* &#039;&#039;&#039;targetplatform&#039;&#039;&#039; - A tag to define platform requirements, requires the following elements&lt;br /&gt;
** &#039;&#039;&#039;name&#039;&#039;&#039; - The name of the platform dependency; as of this writing, it should ONLY be &amp;quot;joomla&amp;quot;&lt;br /&gt;
** &#039;&#039;&#039;version&#039;&#039;&#039; - The version of Joomla! the extension supports&lt;br /&gt;
** &#039;&#039;&#039;min_dev_level&#039;&#039;&#039; and &#039;&#039;&#039;max_dev_level&#039;&#039;&#039; - These attributes were added in 3.0.1 to allow you to select a target platform based on the developer level (&amp;quot;z&amp;quot; in x.y.z). They are optional. You can specifiy either one or both. If omitted, all developer levels are matched. For example, the following matches versions 4.0.0 and 4.0.1. &amp;lt;code&amp;gt;&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;4.0&amp;quot; min_dev_level=&amp;quot;0&amp;quot; max_dev_level=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &#039;&#039;&#039;Note:&#039;&#039;&#039; If your extension is Joomla! 2.5 and/or 3.1 compatible, you will be required to have separate &amp;lt;update&amp;gt; definitions for each version due to the manner in which the updater checks the version if you specify a number. However to show your extension on all Joomla versions that support automatic updates add &amp;lt;code&amp;gt;&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;.*&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;. If you want your extension to show on all {{JVer|3.x}} versions then rather than specifying a version in the version tag add in &amp;lt;code&amp;gt;&amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;3.[012345]&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;. This will show the update to all 3.x versions.&lt;br /&gt;
&lt;br /&gt;
A separate &amp;lt;update&amp;gt; definition will be required for each version of your extension you release.&lt;br /&gt;
&lt;br /&gt;
The values of &#039;&#039;&#039;element&#039;&#039;&#039;, &#039;&#039;&#039;type&#039;&#039;&#039;, &#039;&#039;&#039;client_id&#039;&#039;&#039; and &#039;&#039;&#039;folder&#039;&#039;&#039; should match those in the table #__extensions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important for plugins:&#039;&#039;&#039; Plugins have to include &amp;lt;folder&amp;gt; and &amp;lt;client&amp;gt; elements to work properly&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
* &#039;&#039;&#039;SQL update script is not executed during update.&#039;&#039;&#039; &lt;br /&gt;
:If the SQL update script (for example, in the folder &amp;lt;code&amp;gt;sql/updates/mysql&amp;lt;/code&amp;gt;) does not get executed during the update process, it could be because there is no version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table for this extension &#039;&#039;prior to the update&#039;&#039;. This value is determined by the last script name in the SQL updates folder. If this value is blank, no SQL scripts will be executed during that update cycle. To make sure this value is set correctly, make sure you have a SQL script in this folder with its name as the version number (for example, 1.2.3.sql if the version is 1.2.3). The file can be empty or just have a SQL comment line. This should be done in the old version -- the one before the update. Alternatively, you can add this value to the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; using a SQL query. &lt;br /&gt;
&lt;br /&gt;
== Supporting Tools ==&lt;br /&gt;
Maintaining your update server files can be difficult depending on the manner in which you set up your files.  An extension which can help you to maintain this is the Akeeba Release System, available free of charge from https://www.akeebabackup.com&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:mbabker|Michael Babker]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Renekorss</name></author>
	</entry>
</feed>