<?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=Samwilsonau</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=Samwilsonau"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Samwilsonau"/>
	<updated>2026-07-08T18:19:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:File_Structure_and_Naming_Conventions&amp;diff=118191</id>
		<title>J2.5:File Structure and Naming Conventions</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:File_Structure_and_Naming_Conventions&amp;diff=118191"/>
		<updated>2014-05-15T05:40:47Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: /* The /site folder */ Update view and model parent class names.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.1}}&lt;br /&gt;
{{page|needs version review}}&lt;br /&gt;
{{RightTOC}}&lt;br /&gt;
Components in Jooomla! 2.5+ can now benefit from the flexibility and power of using Object Oriented Programming (OOP) practices. &lt;br /&gt;
Components will follow the Model-View-Controller (MVC) design pattern. This pattern separates the data gathering (Model), presentation (View) and user interaction (Controller) activities of a component. Such separation allows for expanding or revising properties and methods of one section without requiring additional changes to the other sections. Please see [[Developing_a_Model-View-Controller_Component|the MVC tutorial]], then select a Joomla! version for an explanations of the MVC structure.&lt;br /&gt;
&lt;br /&gt;
Joomla!&#039;s file loading system enables developers to work with separate files for controllers, views and models without worrying about importing the right file in the right place. However, for this to work, certain naming conventions need to be observed.&lt;br /&gt;
&lt;br /&gt;
The Joomla! framework is extremely flexible, and it is possible to diverge from these conventions in many ways. It is nonetheless recommended to apply standard naming wherever possible to increase readability and maintainability. Additionally, the framework will take care of the many tedious class management tasks when the files and classes of a component are named correctly.&lt;br /&gt;
&lt;br /&gt;
Throughout this article, {ComponentName} is used to represent the name of the component (for example, Content). Notice also that case is important. {componentname} will refer to the lowercase version of {ComponentName}, eg. &amp;lt;code&amp;gt;CamelCasedController&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;camelcasedcontroller&amp;lt;/code&amp;gt;.&lt;br /&gt;
Similarly, {ViewName} and {viewname}, {ModelName} and {modelname}, {ControllerName} and {controllername}.&lt;br /&gt;
&lt;br /&gt;
== Reserved words ==&lt;br /&gt;
&lt;br /&gt;
There are reserved words which can&#039;t be used in names of classes and components.&lt;br /&gt;
&lt;br /&gt;
An example is the word &amp;quot;view&amp;quot; (in any case) for view classes (except &amp;quot;view&amp;quot; that must be second part of that class name)&amp;lt;ref&amp;gt;Reason is in line 420 of file libraries/joomla/application/component/view.php: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;if (!preg_match(&#039;/View((view)*(.*(view)?.*))$/i&#039;, get_class($this), $r)) {&amp;lt;/source&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
Because the first part of the name of view classes is the same as the controller class name, controller class names can&#039;t contain the word &amp;quot;view&amp;quot; either. And because of the conventions (although violating of it won&#039;t produce an error), controller class names must contain the component name, so component names can&#039;t contain the word &amp;quot;view&amp;quot; either. So components can&#039;t be named &amp;quot;com_reviews&amp;quot;, or if they are, they must violate the naming conventions and have a different base controller class name (or have some other hacks).&lt;br /&gt;
&lt;br /&gt;
== Installation package vs. actual file placement ==&lt;br /&gt;
&lt;br /&gt;
All Joomla! extensions must be packaged as a .zip installation file. According to the most common file arrangement, the package should contain at least the following two folders as a basic structure:&lt;br /&gt;
* &amp;lt;code&amp;gt;site&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt;&lt;br /&gt;
If you set up your XML manifest file according to standard practice, the contents of &amp;lt;code&amp;gt;site&amp;lt;/code&amp;gt; will be installed to &amp;lt;code&amp;gt;/components/com_{componentname}&amp;lt;/code&amp;gt;, whereas the contents of &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; will be installed to &amp;lt;code&amp;gt;/administrator/components/com_{componentname}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The /site folder==&lt;br /&gt;
This folder keeps the files for the frontend part of the component.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/{componentname}.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This is the component&#039;s main file and entry point &#039;&#039;for the frontend part&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/controller.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This file holds the default frontend controller, which is a class called &amp;lt;code&amp;gt;{ComponentName}Controller&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This folder holds the different views for the component.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::This folder holds the files for the view {ViewName}.&lt;br /&gt;
&lt;br /&gt;
:::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}/view.html.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::This file is the entry point for the view {ViewName}. It should declare the class &amp;lt;code&amp;gt;{ComponentName}View{ViewName}&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JViewLegacy&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;.html&amp;lt;/code&amp;gt; section of the filename is related to the format the view will be loaded in. For example, if the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; URL parameter is set to &amp;lt;code&amp;gt;format=feed&amp;lt;/code&amp;gt;, the file &amp;lt;code&amp;gt;view.feed.php&amp;lt;/code&amp;gt; will be loaded.&lt;br /&gt;
&lt;br /&gt;
:::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}/tmpl&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::This folder holds the template files for the view {ViewName}.&lt;br /&gt;
&lt;br /&gt;
::::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}/tmpl/default.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::This is the default template for the view {ViewName}. In this PHP file, the &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; keyword refers to the view class that the template belongs to.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/models&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This folder holds additional models, if needed by the application.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/models/{modelname}.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::This file holds the model class &amp;lt;code&amp;gt;{ComponentName}Model{ModelName}&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JModelLegacy&amp;lt;/code&amp;gt;. Note that the view named {ViewName} will by default load a model called {ViewName} if it exists. Most models are named after the view they are intended to be used with, but this is &#039;&#039;&#039;not&#039;&#039;&#039; a requirement. See [[Using multiple models in an MVC component]] for more information.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/controllers&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This folder holds additional controllers, if needed by the application.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/controllers/{controllername}.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::This file holds the controller class &amp;lt;code&amp;gt;{ComponentName}Controller{ControllerName}&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The /admin folder ==&lt;br /&gt;
The file structure is exactly the same as in the /site folder. Note that the view, models, controllers etc. of the site and admin parts are by default completely separated, and have nothing to do with each other - the site part and the admin part can be thought of as two different components! A view in the /admin folder may have a counterpart with the same name in the /site folder, yet the two views have nothing in common but their name.&lt;br /&gt;
&lt;br /&gt;
However, it might sometimes make sense to share classes between the site and admin parts of the component. Especially models can be shared to avoid duplicating model code. The Joomla! framework supports this strategy. When sharing any code between site and admin applications, the classes should be designed with great care to avoid the possibility of a site user executing admin actions.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
[[Category:References]][[Category:Component Development]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=118190</id>
		<title>J3.x:Developing an MVC Component/Using the database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=118190"/>
		<updated>2014-05-15T04:48:53Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: /* Adding a new field type */ Updated link to point to 3.3 tutorial rather than 2.5.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.3:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.3:Developing a MVC Component | Developing a MVC Component for Joomla! 3.3]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Using the database ==&lt;br /&gt;
Components usually manage their contents using the database. During the install/uninstall/update phase of a component, you can execute SQL queries through the use of SQL text files.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor create two files called &#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and &#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;. They should both have the same content, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and &#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
  `id` int(11) NOT NULL auto_increment,&lt;br /&gt;
  `greeting` varchar(25) NOT NULL,&lt;br /&gt;
   PRIMARY KEY  (`id`)&lt;br /&gt;
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
	(&#039;Hello World!&#039;),&lt;br /&gt;
	(&#039;Good bye World!&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file &#039;&#039;install.mysql.utf8.sql&#039;&#039; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NO BOM or the query will fail with MySQL error #1064.&lt;br /&gt;
&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &#039;&#039;helloworld.xml&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do the same for the uninstall file:&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a new field type ==&lt;br /&gt;
For the moment, we have used a [[J3.3:Developing a MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file and put these lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
		name=&amp;quot;request&amp;quot;&lt;br /&gt;
		addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;id&amp;quot;&lt;br /&gt;
				type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
				description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
			/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &#039;&#039;/administrator/components/com_helloworld/models/fields&#039;&#039; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// import the list field type&lt;br /&gt;
jimport(&#039;joomla.form.helper&#039;);&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var		string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	array		An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions() &lt;br /&gt;
	{&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options = array();&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach($messages as $message) &lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Display the chosen message ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/models/helloworld.php&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns a reference to the a Table object, always creating it.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	type	The table type to instantiate&lt;br /&gt;
	 * @param	string	A prefix for the table class name. Optional.&lt;br /&gt;
	 * @param	array	Configuration array for model. Optional.&lt;br /&gt;
	 * @return	JTable	A database object&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array()) &lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @param  int    The corresponding id of the message to be retrieved&lt;br /&gt;
	 * @return string The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1) &lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id])) &lt;br /&gt;
		{&lt;br /&gt;
                        //request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039; );&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &#039;&#039;admin/tables/helloworld.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/tables/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla table library&lt;br /&gt;
jimport(&#039;joomla.database.table&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param object Database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db) &lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding a variable request in the menu type &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Basic backend &amp;lt;!-- next article subpage name --&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=118189</id>
		<title>J3.x:Developing an MVC Component/Using the database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=118189"/>
		<updated>2014-05-15T04:45:36Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Updated version numbers to be consistent with the rest of the tutorial.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.3:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.3:Developing a MVC Component | Developing a MVC Component for Joomla! 3.3]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Using the database ==&lt;br /&gt;
Components usually manage their contents using the database. During the install/uninstall/update phase of a component, you can execute SQL queries through the use of SQL text files.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor create two files called &#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and &#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;. They should both have the same content, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and &#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
  `id` int(11) NOT NULL auto_increment,&lt;br /&gt;
  `greeting` varchar(25) NOT NULL,&lt;br /&gt;
   PRIMARY KEY  (`id`)&lt;br /&gt;
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
	(&#039;Hello World!&#039;),&lt;br /&gt;
	(&#039;Good bye World!&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file &#039;&#039;install.mysql.utf8.sql&#039;&#039; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NO BOM or the query will fail with MySQL error #1064.&lt;br /&gt;
&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &#039;&#039;helloworld.xml&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do the same for the uninstall file:&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a new field type ==&lt;br /&gt;
For the moment, we have used a [[Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!2.5_-_Part_03|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file and put these lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
		name=&amp;quot;request&amp;quot;&lt;br /&gt;
		addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;id&amp;quot;&lt;br /&gt;
				type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
				description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
			/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &#039;&#039;/administrator/components/com_helloworld/models/fields&#039;&#039; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// import the list field type&lt;br /&gt;
jimport(&#039;joomla.form.helper&#039;);&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var		string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	array		An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions() &lt;br /&gt;
	{&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options = array();&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach($messages as $message) &lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Display the chosen message ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/models/helloworld.php&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns a reference to the a Table object, always creating it.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	type	The table type to instantiate&lt;br /&gt;
	 * @param	string	A prefix for the table class name. Optional.&lt;br /&gt;
	 * @param	array	Configuration array for model. Optional.&lt;br /&gt;
	 * @return	JTable	A database object&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array()) &lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @param  int    The corresponding id of the message to be retrieved&lt;br /&gt;
	 * @return string The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1) &lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id])) &lt;br /&gt;
		{&lt;br /&gt;
                        //request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039; );&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &#039;&#039;admin/tables/helloworld.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/tables/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla table library&lt;br /&gt;
jimport(&#039;joomla.database.table&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param object Database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db) &lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding a variable request in the menu type &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Basic backend &amp;lt;!-- next article subpage name --&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part&amp;diff=118188</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part&amp;diff=118188"/>
		<updated>2014-05-15T04:16:09Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Making the paths agree with the previous tutorial page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|3.2}}&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!3.1 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing_a_MVC_Component|Developing a Model-View-Controller (MVC) Component for Joomla! 3.x]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
In the Joomla!3.x framework, third party component authors divide their code into three main parts:&lt;br /&gt;
* &#039;&#039;models&#039;&#039; They manage the data &lt;br /&gt;
* &#039;&#039;controllers&#039;&#039; They perform tasks, set and get the states of the models and ask the views to display&lt;br /&gt;
* &#039;&#039;views&#039;&#039; They display the content according to the type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) and the layout chosen by the controllers&lt;br /&gt;
&lt;br /&gt;
== Setting the controller ==&lt;br /&gt;
In the core code of Joomla, there is a class able to manage controllers: &#039;&#039;[http://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. This class has to be extended to be used in our component. In the file &#039;&#039;yoursite/components/com_helloworld/helloworld.php&#039;&#039; (entry point of our &#039;&#039;Hello World&#039;&#039; component), put these lines:&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;[http://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; static method of the &#039;&#039;JControllerLegacy&#039;&#039; class will create a controller. In the code above, it will instantiate a controller object of a class named &#039;&#039;HelloWorldController&#039;&#039;. Joomla will look for the declaration of that class in an aptly named file called &#039;&#039;yoursite/components/com_helloworld/controller.php&#039;&#039; (it&#039;s a default behavior).&lt;br /&gt;
&lt;br /&gt;
Now, &#039;&#039;controller.php&#039;&#039; needs to be created and &#039;&#039;HelloWorldController&#039;&#039; needs to be declared and defined. So with your favorite file manager and editor, create a &#039;&#039;yoursite/components/com_helloworld/controller.php&#039;&#039; file containing&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Component Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When no task is given in the request variables, the default task will be executed. It&#039;s the &#039;&#039;display&#039;&#039; task by default. The &#039;&#039;JControllerLegacy&#039;&#039; class has such a task. In our example, it will display a view named &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
So with &#039;&#039;task&#039;&#039; simply a public function display() of &#039;&#039;JControllerLegacy&#039;&#039; is refered to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{tip|Just a side note for completion, you could call another function aside from &#039;&#039;display()&#039;&#039; by using an URL like this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would try to call a function &#039;&#039;insert()&#039;&#039; of our controller (which we would actually have to implement in &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Setting the view ==&lt;br /&gt;
&lt;br /&gt;
When JControllerLegacy wants to display a view, it will look for certain files in the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder. &lt;br /&gt;
&lt;br /&gt;
The name of the folder of the default view is the name of the component itself. In our case the path is &#039;&#039;yoursite/components/com_helloworld/views/helloworld/&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The file that will contain the code of the view is called &#039;&#039;view.[view_mode].php&#039;&#039;. The default view mode, and probably the only view a component might need is the &#039;&#039;html&#039;&#039; mode. So this give us our file name which is &#039;&#039;view.html.php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;yoursite/components/com_helloworld/views/helloworld/view.html.php&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[http://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;yoursite/components/com_helloworld/views/helloworld/tmpl/default.php&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;lt;/code&amp;gt; (this would default to the &#039;&#039;yoursite/components/com_helloworld/views/helloworld/&#039;&#039; folder) or we could explicitly call the folder by calling: &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=helloworld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if we change &amp;lt;code&amp;gt;&amp;amp;view=helloworld&amp;lt;/code&amp;gt; to something else, e.g. &amp;lt;code&amp;gt;&amp;amp;view=fluffy&amp;lt;/code&amp;gt; we would have to create a folder &amp;lt;code&amp;gt;components/com_helloworld/views/fluffy/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &amp;lt;code&amp;gt;views/helloworld&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;views/fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58226/com_helloworld-1.6-part02.zip archive] and install it using the extension manager of Joomla. You can test this basic component by putting &#039;&#039;index.php?option=com_helloworld&#039;&#039; in your browser address.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result:&#039;&#039;&#039;&lt;br /&gt;
You will see by default the message contained in the variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; in the &#039;&#039;view.html.php&#039;&#039; file.&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate|prev=Developing a Basic Component|next=Adding a menu type to the site part}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Component Development]] [[Category:Joomla! 3.0]] [[Category:Joomla! 3.1]][[Category:Joomla! 3.2]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Category:Wiki_Templates&amp;diff=118187</id>
		<title>Category:Wiki Templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Category:Wiki_Templates&amp;diff=118187"/>
		<updated>2014-05-15T03:22:27Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Added link to JDOC:Wiki Templates Project.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{cat header|&lt;br /&gt;
:{{about|page=category|MediaWiki Templates|Joomla! Templates|Templates}}&lt;br /&gt;
These templates are used for the content formatting of articles, navigating the Wiki and its namespaces, cross-linking pages, and to create the documentation of &#039;&#039;Wiki Templates&#039;&#039; themself. For more information, see [[JDOC:Wiki Templates Project]].&lt;br /&gt;
&lt;br /&gt;
This category contains pages in the {{ns:template}} namespace. It &#039;&#039;&#039;must not&#039;&#039;&#039; be used to categorize articles or pages in other namespaces.}}&lt;br /&gt;
[[Category:{{SITENAME}} Wiki|Wiki Templates]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x_talk:Developing_a_MVC_Component/Developing_a_Basic_Component&amp;diff=118178</id>
		<title>J3.x talk:Developing a MVC Component/Developing a Basic Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x_talk:Developing_a_MVC_Component/Developing_a_Basic_Component&amp;diff=118178"/>
		<updated>2014-05-14T03:29:32Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Discover?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Install or discover required? ==&lt;br /&gt;
I am trying to follow the instructions on this page, but am felled at the first hurdle: navigating to &amp;lt;code&amp;gt; index.php?option=com_helloworld&amp;lt;/code&amp;gt; results in &#039;&#039;&#039;404 Component not found&#039;&#039;&#039;. Any ideas? [[User:Samwilsonau|Sam Wilson]] ([[User talk:Samwilsonau|talk]]) 22:29, 13 May 2014 (CDT)&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:LDAP&amp;diff=82571</id>
		<title>Chunk:LDAP</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:LDAP&amp;diff=82571"/>
		<updated>2013-03-15T02:17:08Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Updated a bit, but not sure where to put &amp;#039;how-to&amp;#039; info.  Probably in LDAP rather than here.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[[wp:LDAP|LDAP]]&#039;&#039;&#039; (or &#039;&#039;Lightweight Directory Access Protocol&#039;&#039;) is a protocol designed to access directory systems over TCP/IP. Because of this various databases provide an LDAP interface such as [[wp:Active Directory|Microsoft&#039;s Active Directory]], [[wp:Novell eDirectory|Novell&#039;s eDirectory]], as well as more dedicated LDAP solutions such as [[wp:OpenLDAP|OpenLDAP]].&lt;br /&gt;
&lt;br /&gt;
Since the release of {{jVer|1.5}} Joomla! has had a native LDAP library (&amp;lt;code&amp;gt;[http://api.joomla.org/Joomla-Platform/Client/JLDAP.html joomla.client.ldap]&amp;lt;/code&amp;gt;) and a native LDAP authentication plugin. This allows Joomla! to authenticate against LDAP systems out of the box: to configure, go to the Plugin Manager and enable and edit the &#039;&#039;Authentication - LDAP&#039;&#039; plugin.&lt;br /&gt;
&lt;br /&gt;
You can also read a tutorial on [http://community.joomla.org/component/zine/article/507-developer-ldap-from-scratch-sam-moffatt.html getting started from scratch with LDAP].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Before 1.5:&#039;&#039;&#039; In Joomla! {{jVer|1.0}}, there was no native LDAP library or authentication plugin. The [http://sammoffatt.com.au/jauthtools JAuthTools project] provides a Joomla! 1.0 solution for authentication without hacks as well as configuration resources for both Joomla! 1.0 and 1.5 LDAP authentication solutions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Glossary definitions|{{PAGENAME}}]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Entering_search_engine_meta-data&amp;diff=82570</id>
		<title>Entering search engine meta-data</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Entering_search_engine_meta-data&amp;diff=82570"/>
		<updated>2013-03-15T00:18:53Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: /* Controlled Crawling */ Simplify.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Meta-data is information about the website in the header portion of the webpage.  This information is used by search engines to determine the relevance of the give page to the search request it is processing at any given time.  This data is constantly collected by various means by all search engines such as Google, Yahoo, Ask and others. The following list is a partial list of things to consider when building and publishing a web site.&lt;br /&gt;
&lt;br /&gt;
GoDaddy hosting has a web site analysis tool to examine your site and report how each of these rules is violated.  The report is shaky at best but it helps in identifying your website&#039;s weaknesses.&lt;br /&gt;
&lt;br /&gt;
== Title Tags ==&lt;br /&gt;
Well-constructed title tags contain the main keyword for the page, followed by a brief description of the page content. It will be less than 65 characters and avoid using stop words such as: a, if, the, then, and, an, to, etc. Your title tag should also be limited to the use of alphanumeric characters, hyphens, and commas. &lt;br /&gt;
&lt;br /&gt;
== Description Tags ==&lt;br /&gt;
Good description tags contain information about the page&#039;s content and persuade search engine users to visit your web site. They should be between 25 and 35 words in length. &lt;br /&gt;
&lt;br /&gt;
== Keywords Tags ==&lt;br /&gt;
Your keywords meta tag should contain between 5-10 keywords or keyword phrases that are also found in page content. &lt;br /&gt;
&lt;br /&gt;
== Heading Tags ==&lt;br /&gt;
Each page of your site should use at least the H1 heading tag for the search engines that examine it when crawling your site. &lt;br /&gt;
&lt;br /&gt;
== Page Content ==&lt;br /&gt;
Pages should have between 300 and 700 words of descriptive content that contains the keywords specified in the keywords meta tag for the page. A page&#039;s meta tag keywords should also be those that occur most frequently on the page. &lt;br /&gt;
 &lt;br /&gt;
== Proper Navigation ==&lt;br /&gt;
Each page of your site should contain links to every other page so search engine spiders can find every page. This is a critical step for the proper indexing and page rank distribution of your site. &lt;br /&gt;
&lt;br /&gt;
== Proper Sitemap ==&lt;br /&gt;
It&#039;s important to use two site maps for your website--an XML version and a static version. The XML table protocol is explained in detail on http://www.sitemaps.org.  The static version should sit on a static HTML page and contain links to every other page. &lt;br /&gt;
 &lt;br /&gt;
== Controlled Crawling ==&lt;br /&gt;
It&#039;s important that search engine spiders find your [[Robots.txt file]] that guides spiders to pages and directories you want crawled and denies them entry to protected areas of your site.&lt;br /&gt;
&lt;br /&gt;
== Duplicate Content/Tags ==&lt;br /&gt;
Because search engines treat web sites as a grouping of pages and not a single entity, each page on your site should be unique so that the tags and content differ between each page. Doing so increases the number of pages that will rank. &lt;br /&gt;
&lt;br /&gt;
== Word Density ==&lt;br /&gt;
Pages should contain 300 to 700 words of unique and descriptive content.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tips and tricks]]&lt;br /&gt;
[[Category:Article Management]]&lt;br /&gt;
[[Category:Search Engine Optimization]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Making_your_site_Search_Engine_Friendly&amp;diff=82569</id>
		<title>Making your site Search Engine Friendly</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Making_your_site_Search_Engine_Friendly&amp;diff=82569"/>
		<updated>2013-03-15T00:17:40Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: /* Title tag */ Link.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightTOC}}&lt;br /&gt;
==Why Create a Search Engine Friendly Site?==&lt;br /&gt;
In order to add your pages to its database, a search engine (such as Google) will send out so-called crawlers, spiders or bots to harvest the text on your site. These bots cannot harvest things that are created by Javascript, or &#039;see&#039; images (though they do check alt tags) and the don&#039;t play well with Flash files if at all. &lt;br /&gt;
&lt;br /&gt;
While all these things may make the site look better, they do little to nothing in terms of search engine optimisation (SEO).&lt;br /&gt;
&lt;br /&gt;
It is important that your website can be found by people who are looking for its content, therefore you must serve content to search engine &#039;bots&#039; in a way that they can interpret, analyse and identify how relevant it is to the search query.&lt;br /&gt;
&lt;br /&gt;
For this to happen, you need to bring to the attention of the &#039;bots&#039; important information about the page using various techniques detailed below - almost like a &#039;signpost&#039; telling the &#039;bot&#039; what the page contains.  It will then compare what you tell it the page is about, with what it finds by itself, and run various algorithms to check if the page is in fact relevant.  It also runs other checks to make sure that you are not trying to cheat the system using &#039;black hat&#039; or &#039;grey hat&#039; tactics to make your page rank higher.&lt;br /&gt;
&lt;br /&gt;
==Update Frequency==&lt;br /&gt;
{{review|section}}&lt;br /&gt;
While you can manually specify in your Sitemap how frequently search engine spiders should visit your website, they have in-built systems which automatically adjust the frequency of return visits based on how often the page in question has changed.&lt;br /&gt;
&lt;br /&gt;
So, for example, if you tell search engine bots to visit your page on a daily basis, but when it visits the page nothing has changed for a week, it may adjust the frequency of revisits accordingly and not return as often as you told it to.  You can request, via the various webmasters portals, for the revisit rate to be amended if required.&lt;br /&gt;
&lt;br /&gt;
This would suggest, therefore, that if you have regularly changing content, your website will be &#039;spidered&#039; more frequently - leading to content being indexed quickly.&lt;br /&gt;
&lt;br /&gt;
[http://productforums.google.com/forum/#!category-topic/webmasters/sitemaps/-w7T6qg8o7s Google Webmaster Tools thread on Googlebot requests &amp;amp; sitemap frequencies]&lt;br /&gt;
&lt;br /&gt;
==Title tag==&lt;br /&gt;
{{review|section}}&lt;br /&gt;
The TITLE tag is found in the HEAD portion of your pages. This TITLE tag becomes the clickable title in search engine result pages (SERPs). A title should be under 70 characters in length. It should also include your keywords for the specific page, as close to the start of the TITLE tag as possible.&lt;br /&gt;
&lt;br /&gt;
Google recommends that you create &#039;&#039;unique, descriptive page titles to describe to searchers what the page is about&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If a title page is not specified, or importantly &#039;&#039;&#039;if Google determines that the title is not appropriate for the content being returned for the search term&#039;&#039;&#039;, algorithms may be used to generate alternative titles which are more relevant.&lt;br /&gt;
&lt;br /&gt;
Google recommends that you follow these key principles when creating a title:&lt;br /&gt;
&lt;br /&gt;
* Specify a title for every page&lt;br /&gt;
* Make your title descriptive, and concise&lt;br /&gt;
* Avoid keyword stuffing (repeatedly using similar words like  &amp;quot;Foobar, foo bar, foobars, foo bars&amp;quot;)&lt;br /&gt;
* Avoid using generic titles - each page should have an unique title, ideally dynamically updated in relation to the content being displayed&lt;br /&gt;
* Brand your titles, but do it concisely and in relation to the content being served&lt;br /&gt;
* Use [[robots.txt file|robots.txt]] carefully, don&#039;t disallow search engines from visiting your website&lt;br /&gt;
&lt;br /&gt;
There are various webmaster tools which can be used to identify if there are problems with your listings in a particular search engine - it is always worth paying attention and correcting any problems.&lt;br /&gt;
&lt;br /&gt;
[http://support.google.com/webmasters/bin/answer.py?hl=en&amp;amp;answer=35624 Google support article on using titles for your web pages]&lt;br /&gt;
&lt;br /&gt;
==Meta Description==&lt;br /&gt;
{{review|section}}&lt;br /&gt;
The META DESCRIPTION tag keeps a summary of the content on the page. The tag is used by search engines to display a description of the page when displaying it in search engine result pages (SERPs). This, however, only applies if the word searched for is included in the description. Otherwise, the search engine might display another portion of the page, which includes the keyword. When writing META DESCRIPTION tags for your pages, keep them below 155 characters. Also make sure to include the most important keywords for the page in question. Consider the description to be your sales copy to get people to click the link. Thus, the description should be written for humans, not search engines.&lt;br /&gt;
&lt;br /&gt;
Even though Joomla has a global field for Meta Description (Global Configuration &amp;gt; Site &amp;gt; Global Site Meta Description), you should in most cases leave this blank. Google (and possibly other search engines as well) does not like duplicate title or meta description tags. If you add something to the global field, it will be duplicated on all pages that do not have a specific meta description.&lt;br /&gt;
&lt;br /&gt;
Google recommends the following to ensure that you gain the most from your search engine indexing:&lt;br /&gt;
&lt;br /&gt;
* Ensure every page has unique, relevant meta descriptions&lt;br /&gt;
* Ensure you apply metadata for listing pages (e.g. blog &amp;amp; list layouts) in addition to individual articles - this is commonly overlooked on Joomla! websites&lt;br /&gt;
* Include factual information if relevant (e.g. blog articles may include the author, products might include the price or manufacturer)&lt;br /&gt;
* Consider using automatically generated metadata - but make sure it&#039;s relevant, readable and accurate&lt;br /&gt;
* Make your descriptions descriptive!&lt;br /&gt;
&lt;br /&gt;
[http://support.google.com/webmasters/bin/answer.py?hl=en&amp;amp;answer=35624 Google support article on using metadata]&lt;br /&gt;
&lt;br /&gt;
==Keywords==&lt;br /&gt;
{{review|section}}&lt;br /&gt;
&lt;br /&gt;
There are two major parts to understanding keywords: one is the meta tag and the other is density. If you are starting a brand new site you will need to do a little planning for both SEO and simple Joomla structure. Keywords are the focus of your content. You should come up with a list of no more than 25 keywords that describe your site&#039;s message. Once you have your list of keywords, keep them in focus as you write content and create Joomla sections, categories, and articles. Use these keywords through your site to improve SEO.&lt;br /&gt;
&lt;br /&gt;
The meta keyword tag found in the head of most Web documents has little effect for Google, Bing and many of the other larger search engines. Yahoo still uses the meta tag as part of the algorithm, as well as some of the meta crawlers. Search engines all read the text in the tag; they just do not apply the information to their ranking algorithms.  If your page has a keyword tag, you must make sure that word is on the same page in the content.&lt;br /&gt;
&lt;br /&gt;
Density is the number of times a word is placed in the readable content of a page. If you have ten readable words and one word is a keyword the density of 10%. If you have 100 words and one of them is a keyword you now have a density of 1%. Keep your density between 3.5 and 7 percent. Look for an online density analyzer to get an estimated density of a keyword.  &lt;br /&gt;
&lt;br /&gt;
Make sure to use keywords in your titles or aliases, links, and content. DO NOT STUFF keywords. Content that does not make sense and is full of keywords for the sole purpose of raising the keyword density to a high level will cause your site to be penalized in the search engines. It is very difficult to write an article that someone will enjoy reading or find usable and increase the density over 7 percent.&lt;br /&gt;
&lt;br /&gt;
This section has a keyword density on the term “keyword” of 1.79% and on the term “keywords” of 2.05%. The combined density is approximately 3.8%. You can see how deliberate you would have to be to stuff a site greater than 7%.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To Add Meta Keywords to Your Site:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Add the 25 keywords to your Global Configuration &amp;gt; Site &amp;gt; Global Site Meta Keywords.&lt;br /&gt;
* Add specific meta keywords to articles using the metadata information. Make sure the keywords listed here are in the content of the article also.&lt;br /&gt;
* Adding the data does not harm your rankings in search engines, and will help you in Yahoo, and meta crawlers. Never add more than 25 words in the meta data. Separate words and phrases with a comma. Do not repeat keywords.&lt;br /&gt;
&lt;br /&gt;
==Use Semantic HTML==&lt;br /&gt;
&lt;br /&gt;
What is Semantic HTML?&lt;br /&gt;
&lt;br /&gt;
Semantic HTML is a way of using HTML coding to create or enhance the structure of a page.  In other words, it&#039;s a way of using HTML - classes, divs, tags and so forth - to compliment the actual words or resources on a page.  Again, this helps &#039;bots&#039; to understand the importance, relevance, and links between the content on your page.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important, therefore, that you have an understanding of semantic HTML and how to use it.  For example, we often see people using a H2 tag in the middle of content because it has the style that they want to use - but it&#039;s not actually a heading.  How the content looks has nothing to do with the structure of the page - it&#039;s important to remember that the two are quite different.&lt;br /&gt;
&lt;br /&gt;
For example, lets say we have an article:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source class=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Using headings&amp;lt;/h1&amp;gt;&lt;br /&gt;
This is an article about the importance of headings&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Why use headings?&amp;lt;/h2&amp;gt;&lt;br /&gt;
It is important to use headings so that search engine bots can tell what is an &amp;lt;strong&amp;gt;important&amp;lt;/strong&amp;gt; part of your article&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Types of headings&amp;lt;/h3&amp;gt;&lt;br /&gt;
You can use set types of headings, but they should be ordered, and structured, within your page.  H1 should be your page title, with H2 being used for sub-headings of the page.  Any headings within your sub-headings should cascade using H3, H4, and H5 as appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Is it hard to implement headings?&amp;lt;/h2&amp;gt;&lt;br /&gt;
It is really easy to implement headings, you just use the appropriate HTML code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Using headings on dynamic pages&amp;lt;/h3&amp;gt;&lt;br /&gt;
On dynamic pages, simply wrap your main heading within a H1 (for example, the title of a category listing page would be H1) then wrap all subsequent headings in H2.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, a search engine bot could clearly see the structure - h1, h2, h3 - but if we were to simply make these titles bold, underlined and larger font, it would be much more difficult to identify the structure.  It is also possible to identify that the word &#039;important&#039; is an emphasised word, something that is important within the page.&lt;br /&gt;
&lt;br /&gt;
Semantic HTML is also&lt;br /&gt;
* Easier to read (in the code)&lt;br /&gt;
* Easier for accessibility purposes - screen readers function in a similar way to search engine bots to identify important headings&lt;br /&gt;
* Potentially better for search engine optimisation&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Semantic_HTML Wikipedia article on Semantic HTML]&lt;br /&gt;
&lt;br /&gt;
==Use Links in Your Content==&lt;br /&gt;
{{review | section }}&lt;br /&gt;
It is important that you ensure any links within your content inform the user what they are linking to, but without being &#039;spammy&#039; - i.e. stuffed full of keywords.&lt;br /&gt;
&lt;br /&gt;
Ideally you should include words which feature in the URL to which you are linking, and the hyperlinked text should be descriptive of the content you&#039;re about to view.  An example where this is often done poorly on Joomla! websites is where &#039;Read more&#039; links display &#039;&#039;Read More&#039;&#039; rather than the title of the article, in the hyperlinked text. Another common habit is for sites to only include a link on the word &#039;&#039;here&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This also gives the person visiting your site confidence in the link they are clicking - they know what to expect when visiting the link, so it may be more likely that they do so.&lt;br /&gt;
&lt;br /&gt;
This is true for both internal links (if you&#039;re linking to another page or area on your website) and also on external links to other sites.&lt;br /&gt;
&lt;br /&gt;
Be aware, however, that with recent updates to Google&#039;s algorithms (named Panda, and more recently Penguin), sites with unnatural linking profiles may be down-ranked in search engine positions.  One of the main factors in the Penguin update targeted websites which had a large amount of its traffic coming from keyword-stuffed anchor text on hyperlinks from low-value websites.  Keep your links relevant, appropriate and relating to what you are linking to.&lt;br /&gt;
&lt;br /&gt;
Where possible, it&#039;s also wise to regularly check that your links are still valid. The user experience is tainted somewhat if 50% of the links on your site result in a &#039;&#039;404 - Page Not Found&#039;&#039; error. There are components and plugins available which will automate these checks for you.&lt;br /&gt;
&lt;br /&gt;
In short, use links appropriately, but don&#039;t make the mistake of not using them where relevant. The user experience is improved greatly when you link to any article you may be referencing (whether internal or external), and the Search Engines generally recognise this.&lt;br /&gt;
&lt;br /&gt;
==Have a Structured or Planned Navigation==&lt;br /&gt;
{{stub|section}}&lt;br /&gt;
Having a good navigation system is hugely beneficial for allowing bots to effectively crawl your site. Joomla goes a long way in doing this for you when used correctly.&lt;br /&gt;
Using keywords in the actual link title (anchor text) will help improve rankings.&lt;br /&gt;
&lt;br /&gt;
Your site structure starts with your content management - this should be structured according to your website function.  A news website might categorise based on the topic (e.g. technology, business, world, etc) but a sports news website might categorise based on sport (e.g. Football, Rugby, Hockey, Cycling).&lt;br /&gt;
&lt;br /&gt;
This is a critical factor in creating your website, and if used properly can have huge implications with regards to your search engine optimisation - as you can use your category name in your Search Engine Friendly URL&#039;s.&lt;br /&gt;
&lt;br /&gt;
Once you have defined your content structure, the next step is to create a sitemap - even if it&#039;s on the back of a napkin - to identify what your &#039;top level&#039; menu items will be, and any sub-items under them.  This helps you to form an idea of how the visitor will browse your website.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are using sub-menus as drop-downs, it is sensible to use text separators at your top level, and the top level for any child menu items - this ensures that users who have touch-screen devices, or those using speech control, can easily click or hover over the top item, and have the sub-menu items display without being directed to a new page before having a chance to select a sub-menu item.&lt;br /&gt;
&lt;br /&gt;
Website navigation is all about improving how users find content in your website. The easier users can find information on your site, the easier search engines will too.&lt;br /&gt;
&lt;br /&gt;
== Have an HTML Sitemap ==&lt;br /&gt;
{{review}}&lt;br /&gt;
An HTML sitemap is essentially a table of contents for your site. This serves two purposes:&lt;br /&gt;
&lt;br /&gt;
# It provides a place where visitors can go to easily get to any content on your site, even if it isn&#039;t necessarily easy to access by other navigation aids on the site.&lt;br /&gt;
# It provides a centralized store of links to the content on your site that can be easily indexed by search engines.&lt;br /&gt;
# It allows users with disabilities to be able to quickly navigate your website with a simple list of links, rather than through complex menus&lt;br /&gt;
&lt;br /&gt;
At the very least, a sitemap should link to the main sections and pages within your site, but the more detailed you can make it, the better.&lt;br /&gt;
&lt;br /&gt;
There are available extensions that create sitemaps automatically based on Joomla content.&lt;br /&gt;
&lt;br /&gt;
== Have an XML Sitemap ==&lt;br /&gt;
Sitemaps are an easy way for webmasters to inform search engines about pages on their sites that are available for crawling. In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site.&lt;br /&gt;
&lt;br /&gt;
Web crawlers usually discover pages from links within the site and from other sites. Sitemaps supplement this data to allow crawlers that support Sitemaps to pick up all URLs in the Sitemap and learn about those URLs using the associated metadata. Using the Sitemap protocol does not guarantee that web pages are included in search engines, but provides hints for web crawlers to do a better job of crawling your site.&lt;br /&gt;
&lt;br /&gt;
# An XML sitemap provides a list of links to the content on your site that can be easily indexed by search engines.&lt;br /&gt;
# It is possible to create specific sitemaps for News, Images, Multimedia.&lt;br /&gt;
&lt;br /&gt;
There are available extensions that create XML sitemaps automatically based on Joomla content.&lt;br /&gt;
[http://sitemaps.org/protocol.php More about the Sitemap protocol]&lt;br /&gt;
&lt;br /&gt;
== Things to Remember ==&lt;br /&gt;
{{review|section}}&lt;br /&gt;
&lt;br /&gt;
There are perhaps a few basic points that readers should away;&lt;br /&gt;
&lt;br /&gt;
* Anything that requires a login will not be &#039;seen&#039; by a search engine (though some search engines will allow you to tell them how to bypass these).&lt;br /&gt;
* This article only just starts to scrape the surface.&lt;br /&gt;
* Frequent maintenance and updates are a big part of Search Engine Optimization (SEO).&lt;br /&gt;
* SEO is only the start - it might help people find your site through search engines but you&#039;ve got to work out how to get them to stay or come back or use your site.&lt;br /&gt;
&lt;br /&gt;
Search Engine Optimization is an ongoing task, the &#039;rules&#039; used change frequently and simply undertaking SEO work once wont guarantee you a high ranking. Unique content is important, but so is site navigation. If a search engine finds it difficult to navigate your site (e.g. needs 7 &#039;clicks&#039; to reach an article) it will assume that real users will encounter similar difficulties. Sitemaps can help with this issue tremendously.&lt;br /&gt;
&lt;br /&gt;
Although Search Engine Optimization is important, focusing on the basic elements of the user experience (easy navigation paths, unique and compelling content etc.) is often one of the best ways to ensure a higher ranking. Simple steps like ensuring appropriate Meta Keywords and Internal links will help to improve that experience further.&lt;br /&gt;
&lt;br /&gt;
[[Category:Search Engine Optimization]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Creating_a_Custom_404_Error&amp;diff=82568</id>
		<title>Archived:Creating a Custom 404 Error</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Creating_a_Custom_404_Error&amp;diff=82568"/>
		<updated>2013-03-15T00:17:27Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: /* Additional Steps Toward a Better Custom 404 Error Page */ Link.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial will show you how to create a custom 404 error page for use in your Joomla Webssite.&lt;br /&gt;
&lt;br /&gt;
== Four Steps to Creating a Custom 404 Error Page ==&lt;br /&gt;
# &#039;&#039;&#039;Create an Uncategorized &#039;404&#039; Article&#039;&#039;&#039;&lt;br /&gt;
#: Create an &#039;uncategorized&#039; article in Joomla! to serve as your 404 Page.  Include some text such as &#039;&#039;Sorry, we could not find the page you were looking for...&#039;&#039; and if necessary, also any useful navigational links.  For example, you may wish to add a link back to your site&#039;s home page.&lt;br /&gt;
# &#039;&#039;&#039;Create and copy a link to that new 404 Article.&#039;&#039;&#039;&lt;br /&gt;
#: Create a menu item which links to the new 404 Article and &#039;apply&#039; your changes.  Then copy the URL information (index.php?optio...), set the menu item as &#039;unpublished&#039; and close out of the menu editing page.  You may want to paste the copied URL into Notepad or somewhere accessible for the time-being.&lt;br /&gt;
# &#039;&#039;&#039;Copy error.php to your Template&#039;s Directory&#039;&#039;&#039;&lt;br /&gt;
#: In your Joomla! installation copy the file error.php from the templates/system directory, to your Template directory.  For example, if I was using a template named &#039;Cleancloud&#039; I would copy the error.php file to the templates/cleancloud directory.&lt;br /&gt;
# &#039;&#039;&#039;Modify error.php to Redirect 404 Errors to your 404 Article   &#039;&#039;&#039; &lt;br /&gt;
#: Edit the error.php file as follows, adding the code below immediately under the &#039;restricted access&#039; line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if (($this-&amp;gt;error-&amp;gt;code) == &#039;404&#039;) {&lt;br /&gt;
header(&#039;Location: /index.php?option=com_content&amp;amp;view=article&amp;amp;id=75&#039;);&lt;br /&gt;
exit;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you are using Joomla 1.6, 1.7 and 2.5, use this detection code instead:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if (($this-&amp;gt;error-&amp;gt;getCode()) == &#039;404&#039;) {&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Replace the location information (index.php?option..) with the URL from the menu item you created.&lt;br /&gt;
&lt;br /&gt;
== Additional Steps Toward a Better Custom 404 Error Page ==&lt;br /&gt;
* Add the following line to the [[robots.txt file|robots.txt]] file located in the root directory of your Joomla! installation.&lt;br /&gt;
*: &amp;lt;code&amp;gt;Disallow: /index.php?option=com_content&amp;amp;view=article&amp;amp;id=75&amp;lt;/code&amp;gt;&lt;br /&gt;
* Replacing the (index.php?option..) location with your 404 Article URL.&lt;br /&gt;
* Follow the Best-Practices described here:  http://www.alistapart.com/articles/perfect404/&lt;br /&gt;
* Be creative, add a [http://www.geekhaiku.com/tag/404/ 404 Haiku] or maybe an [http://www.smashingmagazine.com/2007/08/17/404-error-pages-reloaded Interesting Photo]&lt;br /&gt;
&lt;br /&gt;
== More Custom Error Page Information ==&lt;br /&gt;
* [[Custom_error_pages|Custom Error Pages]]&lt;br /&gt;
* [[System_error_pages|System Error Pages]]&lt;br /&gt;
* [http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html HTTP/1.1 Status Code Definitions]&lt;br /&gt;
* [http://www.google.com/support/webmasters/bin/answer.py?answer=83040&amp;amp;topic=8474 Google Webmaster - Analyzing Crawl Errors]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Robots.txt_file&amp;diff=82567</id>
		<title>Robots.txt file</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Robots.txt_file&amp;diff=82567"/>
		<updated>2013-03-15T00:11:23Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Some formatting etc.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightTOC}}&lt;br /&gt;
{{review}}&lt;br /&gt;
Web Robots (Crawlers, Web Wanderers or Spiders) are programs that traverse the Web automatically. Among many uses, search engines use them to index the web content.&lt;br /&gt;
Robots.txt implements the REP ([[wp:Robots exclusion standard|Robots Exclusion Protocol]]), which allows the web site administrator to define what parts of the site are off-limits to specific robot user agent names. Web administrators can Allow access to their web content and Disallow access to cgi, private and temporary directories, for example, if they do not want pages in those areas indexed. &lt;br /&gt;
&lt;br /&gt;
==Where to place my robots.txt file?==&lt;br /&gt;
A standard robots.txt its included in your joomla root.&lt;br /&gt;
The robots.txt file must reside in the root of the domain or subdomain and must be named &amp;lt;code&amp;gt;robots.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Joomla in a subdirectory===&lt;br /&gt;
A robots.txt file located in a subdirectory isn&#039;t valid, as bots only check for this file in the root of the domain.&lt;br /&gt;
If the Joomla site is installed within a folder such as at e.g. &amp;lt;code&amp;gt;example.com/joomla/&amp;lt;/code&amp;gt; the robots.txt file MUST be moved to the site root at e.g. &amp;lt;code&amp;gt;example.com/robots.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
Note: The joomla folder name MUST be prefixed to the disallowed path, e.g. the Disallow rule for the &amp;lt;code&amp;gt;/administrator/&amp;lt;/code&amp;gt; folder MUST be changed to read &amp;lt;code&amp;gt;Disallow: /joomla/administrator/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Joomla robots.txt contents==&lt;br /&gt;
This is the contents of a [https://github.com/joomla/joomla-cms/blob/master/robots.txt standard Joomla robots.txt]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
User-agent: *&lt;br /&gt;
Disallow: /administrator/&lt;br /&gt;
Disallow: /cache/&lt;br /&gt;
Disallow: /cli/&lt;br /&gt;
Disallow: /components/&lt;br /&gt;
Disallow: /images/&lt;br /&gt;
Disallow: /includes/&lt;br /&gt;
Disallow: /installation/&lt;br /&gt;
Disallow: /language/&lt;br /&gt;
Disallow: /libraries/&lt;br /&gt;
Disallow: /logs/&lt;br /&gt;
Disallow: /media/&lt;br /&gt;
Disallow: /modules/&lt;br /&gt;
Disallow: /plugins/&lt;br /&gt;
Disallow: /templates/&lt;br /&gt;
Disallow: /tmp/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Robot exclusion==&lt;br /&gt;
You can exclude directories or block robots from your site adding Disallow rule to robots.txt.  E.g. to prevent any robots from visiting the &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt; directory, add the following rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disallow: /tmp/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also:&lt;br /&gt;
* [http://www.robotstxt.org/wc/robots.html A Standard for Robot Exclusion] — specification of the robots.txt standard&lt;br /&gt;
* [http://support.google.com/webmasters/bin/answer.py?hl=en-GB&amp;amp;answer=156449 Block or remove pages using a robots.txt file]&lt;br /&gt;
&lt;br /&gt;
==Syntax checking==&lt;br /&gt;
For syntax checking you can use a validator for robots.txt files.&lt;br /&gt;
Try one of these:&lt;br /&gt;
* [http://tool.motoricerca.info/robots-checker.phtml Robots.txt Checker (by Motoricerca)]&lt;br /&gt;
* [http://www.frobee.com/robots-txt-check Robots.txt Checker (by Frobee)]&lt;br /&gt;
* [http://www.searchenginepromotionhelp.com/m/robots-text-tester/robots-checker.php robots.txt Checker (by Search Engine Promotion Help)]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
For additional information please read:&lt;br /&gt;
&lt;br /&gt;
=== Joomla! Documentation ===&lt;br /&gt;
* [[Creating a Custom 404 Error Page]]&lt;br /&gt;
* [[Custom error pages]]&lt;br /&gt;
* [[System error pages]]&lt;br /&gt;
* [[Making your site Search Engine Friendly]]&lt;br /&gt;
* [[Entering search engine meta-data]]&lt;br /&gt;
&lt;br /&gt;
=== How to: Robots.txt and Joomla ===&lt;br /&gt;
* [http://www.kangainternet.com.au/joomla-seo-blog/joomla-google-the-robots.txt-file.html Joomla &amp;amp; Google Robots Text File]&lt;br /&gt;
* [http://www.joomlablogger.net/seo/joomla-seo/how-to-set-up-the-robotstxt-file-in-joomla How to set up the robots.txt file in Joomla]&lt;br /&gt;
&lt;br /&gt;
=== General information ===&lt;br /&gt;
* http://www.robotstxt.org/ — main website for robots.txt&lt;br /&gt;
* [http://www.robotstxt.org/wc/robots.html A Standard for Robot Exclusion] — specification of the robots.txt standard&lt;br /&gt;
* [https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag Robots meta tag and X-Robots-Tag HTTP header specifications]&lt;br /&gt;
* [http://www.searchtools.com/robots/robots-txt.html Robots.txt and Search Indexing]&lt;br /&gt;
&lt;br /&gt;
=== Tools for Webmasters ===&lt;br /&gt;
* [https://www.google.com/webmasters/tools Google Webmaster Tools]&lt;br /&gt;
&lt;br /&gt;
[[Category:Search Engine Optimization]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Samwilsonau&amp;diff=82566</id>
		<title>User:Samwilsonau</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Samwilsonau&amp;diff=82566"/>
		<updated>2013-03-15T00:05:38Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Updated with link.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My personal website: http://samwilson.id.au/&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Robots.txt_file&amp;diff=82565</id>
		<title>Robots.txt file</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Robots.txt_file&amp;diff=82565"/>
		<updated>2013-03-14T23:20:09Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: /* Joomla in a subdomain */ Subdirectory, not subdomain.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightTOC}}&lt;br /&gt;
{{review}}&lt;br /&gt;
Web Robots (Crawlers, Web Wanderers or Spiders) are programs that traverse the Web automatically. Among many uses, search engines use them to index the web content.&lt;br /&gt;
Robots.txt implements the REP (Robots Exclusion Protocol), which allows the web site administrator to define what parts of the site are off-limits to specific robot user agent names. Web administrators can Allow access to their web content and Disallow access to cgi, private and temporary directories, for example, if they do not want pages in those areas indexed. &lt;br /&gt;
&lt;br /&gt;
==Where to place my robots.txt file?==&lt;br /&gt;
A standard robots.txt its included in your joomla root.&lt;br /&gt;
The robots.txt file must reside in the root of the domain and must be named &amp;quot;robots.txt&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Joomla in a subdirectory===&lt;br /&gt;
A robots.txt file located in a subdirectory isn&#039;t valid, as bots only check for this file in the root of the domain.&lt;br /&gt;
If the Joomla site is installed within a folder such as at e.g. &amp;lt;code&amp;gt;example.com/joomla/&amp;lt;/code&amp;gt; the robots.txt file MUST be moved to the site root at e.g. &amp;lt;code&amp;gt;example.com/robots.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
Note: The joomla folder name MUST be prefixed to the disallowed path, e.g. the Disallow rule for the &amp;lt;code&amp;gt;/administrator/&amp;lt;/code&amp;gt; folder MUST be changed to read &amp;lt;code&amp;gt;Disallow: /joomla/administrator/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Joomla robots.txt contents==&lt;br /&gt;
This is the contents of a standard Joomla robots.txt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
User-agent: *&lt;br /&gt;
Disallow: /administrator/&lt;br /&gt;
Disallow: /cache/&lt;br /&gt;
Disallow: /cli/&lt;br /&gt;
Disallow: /components/&lt;br /&gt;
Disallow: /images/&lt;br /&gt;
Disallow: /includes/&lt;br /&gt;
Disallow: /installation/&lt;br /&gt;
Disallow: /language/&lt;br /&gt;
Disallow: /libraries/&lt;br /&gt;
Disallow: /logs/&lt;br /&gt;
Disallow: /media/&lt;br /&gt;
Disallow: /modules/&lt;br /&gt;
Disallow: /plugins/&lt;br /&gt;
Disallow: /templates/&lt;br /&gt;
Disallow: /tmp/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Robot Exclusion==&lt;br /&gt;
You can exclude directories or block robots from your site adding Disallow rule to the robots.txt&lt;br /&gt;
&lt;br /&gt;
Infos:&lt;br /&gt;
* [http://www.robotstxt.org/orig.html A Standard for Robot Exclusion]&lt;br /&gt;
* [http://support.google.com/webmasters/bin/answer.py?hl=en-GB&amp;amp;answer=156449 Block or remove pages using a robots.txt file]&lt;br /&gt;
&lt;br /&gt;
==Syntax checking==&lt;br /&gt;
For syntax checking you can use a validator for robots.txt files.&lt;br /&gt;
Try one of these:&lt;br /&gt;
* [http://tool.motoricerca.info/robots-checker.phtml Robots.txt Checker (by Motoricerca)]&lt;br /&gt;
* [http://www.frobee.com/robots-txt-check Robots.txt Checker (by Frobee)]&lt;br /&gt;
* [http://www.searchenginepromotionhelp.com/m/robots-text-tester/robots-checker.php robots.txt Checker (by Search Engine Promotion Help)]&lt;br /&gt;
&lt;br /&gt;
==Infos==&lt;br /&gt;
For additional infos please read:&lt;br /&gt;
===Joomla! Documentation===&lt;br /&gt;
* [[Creating_a_Custom_404_Error_Page|Creating a Custom 404 Error Page]]&lt;br /&gt;
* [[Custom_error_pages|Custom Error Pages]]&lt;br /&gt;
* [[System_error_pages|System Error Pages]]&lt;br /&gt;
* [[Making_your_site_Search_Engine_Friendly|Making your site Search Engine Friendly]]&lt;br /&gt;
* [[Entering_search_engine_meta-data|Entering search engine meta-data]]&lt;br /&gt;
&lt;br /&gt;
===How to: Robots.txt and Joomla===&lt;br /&gt;
* [http://www.kangainternet.com.au/joomla-seo-blog/joomla-google-the-robots.txt-file.html Joomla &amp;amp; Google Robots Text File]&lt;br /&gt;
* [http://www.joomlablogger.net/seo/joomla-seo/how-to-set-up-the-robotstxt-file-in-joomla How to set up the robots.txt file in Joomla]&lt;br /&gt;
&lt;br /&gt;
===General informations===&lt;br /&gt;
* [http://www.robotstxt.org/orig.html The Web Robots Pages]&lt;br /&gt;
* [https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag Robots meta tag and X-Robots-Tag HTTP header specifications]&lt;br /&gt;
* [http://www.searchtools.com/robots/robots-txt.html Robots.txt and Search Indexing]&lt;br /&gt;
&lt;br /&gt;
===Tools for Webmasters===&lt;br /&gt;
* [https://www.google.com/webmasters/tools Google Webmaster Tools]&lt;br /&gt;
&lt;br /&gt;
[[Category:Search Engine Optimization]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component&amp;diff=82549</id>
		<title>J3.x:Developing an MVC Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component&amp;diff=82549"/>
		<updated>2013-03-14T07:14:28Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Copyedit.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|3.0|alt=1.5,1.6,1.7,2.5|altlink=Developing a Model-View-Controller Component|alttitle=these guides!}}&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!3.0 - Contents}}&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|3.0}}.&lt;br /&gt;
&lt;br /&gt;
Begin with the [[Developing a Model-View-Controller Component/3.0/Introduction|Introduction]], and navigate the articles in this series by using the navigation box to the right (the &#039;&#039;Articles in this series&#039;&#039;).&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!3.1_-_Contents&amp;diff=82548</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!3.1 - Contents</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!3.1_-_Contents&amp;diff=82548"/>
		<updated>2013-03-14T07:12:06Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Added &amp;#039;Developing a Basic Component&amp;#039;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Navbox&lt;br /&gt;
|style  = float:right; width:200px; margin-left: 10px;&lt;br /&gt;
|name       = Developing a MVC 3.0&lt;br /&gt;
|state      = off&lt;br /&gt;
|navbar     = off&lt;br /&gt;
|title      = Developing an MVC Component in {{JVer|3.0}}&lt;br /&gt;
|titlestyle = font-weight:bold; font-size:1.10em;&lt;br /&gt;
|above      = __TOC__&lt;br /&gt;
|abovestyle = width:200px; background-color:darkgray;&lt;br /&gt;
|list1       = {{Navbox|child&lt;br /&gt;
|style      = width:99%; max-width:220px;&lt;br /&gt;
|name       = Joomla! MVC 3.0 Screen child&lt;br /&gt;
|state      = off&lt;br /&gt;
|navbar     = off&lt;br /&gt;
|title      = &#039;&#039;Articles in this series&#039;&#039;&lt;br /&gt;
|titlestyle = font-weight:bold; font-size:.90em; width:99%;&lt;br /&gt;
|list1     = &lt;br /&gt;
* [[Developing a Model-View-Controller Component/3.0/Introduction|Introduction]]&lt;br /&gt;
* [[Developing a Model-View-Controller Component/3.0/Developing a Basic Component|Developing a Basic Component]]&lt;br /&gt;
|list1style  = background-color: cornsilk; padding:2px; font-size:.92em; text-align:left; width:100%;&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Tutorials in a Series]]&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorial Series Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=82547</id>
		<title>J3.x:Developing an MVC Component/Developing a Basic Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=82547"/>
		<updated>2013-03-14T07:03:33Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: First draft.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:Developing a Model-View-Controller Component/3.0}}&lt;br /&gt;
&lt;br /&gt;
= Developing a Basic Component =&lt;br /&gt;
&lt;br /&gt;
This page goes through the basic steps required to make the simplest possible component that will output &#039;&#039;Hello, world!&#039;&#039; to the [[Site (Application)|front-end]] of a Joomla!{{JVer|3.0}} website.&lt;br /&gt;
&lt;br /&gt;
== Main Output ==&lt;br /&gt;
&lt;br /&gt;
First set up the basic public output for this component.  Create &amp;lt;code&amp;gt;yoursite/components/com_helloworld/helloworld.php&amp;lt;/code&amp;gt; with the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
echo &#039;Hello world&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manifest file ==&lt;br /&gt;
&lt;br /&gt;
Every extension needs a [[manifest files|manifest file]] that specifies installation and configuration information for the extension.  The manifest file is named &amp;lt;code&amp;gt;&#039;&#039;componentname&#039;&#039;.xml&amp;lt;/code&amp;gt;.  For a simple component we need only include a minimal number of the possible elements in this XML file.&lt;br /&gt;
&lt;br /&gt;
Create &amp;lt;code&amp;gt;helloworld.xml&amp;lt;/code&amp;gt; in the same directory as your &amp;lt;code&amp;gt;helloworld.php&amp;lt;/code&amp;gt; above, with the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; element is actually optional, but it makes for easier identification in the next step.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Next, we need to tell Joomla! to &#039;discover&#039; this new component, so that it can be installed and used.  This is done by going to the &#039;&#039;Extension Manager -&amp;gt; Discover&#039;&#039; and clicking &#039;Discover&#039; in the toolbar.  This will scan the &amp;lt;code&amp;gt;components&amp;lt;/code&amp;gt; directory (amongst others), looking for components that have not yet been installed.&lt;br /&gt;
&lt;br /&gt;
The new component should be listed in the resulting table, and to install it you just select it (with the checkbox) and click &#039;Install&#039; in the toolbar.&lt;br /&gt;
&lt;br /&gt;
Note: Don&#039;t worry about the message &#039;&#039;&amp;quot;Component Install: The XML file did not contain an administration element&amp;quot;&#039;&#039;, as our component does not yet have any [[Administrator (Application)|administration]] features.  We&#039;ll add these later in the tutorial.&lt;br /&gt;
&lt;br /&gt;
== Hello, world! ==&lt;br /&gt;
&lt;br /&gt;
You can now see the basic component in action, by navigating to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://localhost/joomla/index.php?option=com_helloworld&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (replacing &amp;lt;code&amp;gt;localhost/joomla&amp;lt;/code&amp;gt; with your own installation location).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Samwilsonau&amp;diff=82546</id>
		<title>User:Samwilsonau</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Samwilsonau&amp;diff=82546"/>
		<updated>2013-03-14T04:53:35Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Link to my site.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My personal website is at &amp;lt;code&amp;gt;samwilson dot id dot au&amp;lt;/code&amp;gt; (spam-filter here won&#039;t let me post a link).&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Setting_up_a_directory_structure&amp;diff=82544</id>
		<title>Setting up a directory structure</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Setting_up_a_directory_structure&amp;diff=82544"/>
		<updated>2013-03-14T03:54:26Z</updated>

		<summary type="html">&lt;p&gt;Samwilsonau: Code tag typo.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To make the most basic template, &#039;&#039;&#039;create a new folder&#039;&#039;&#039; in the &amp;lt;tt&amp;gt;&#039;&#039;templates&#039;&#039;&amp;lt;/tt&amp;gt; folder. Name this folder after your template i.e. &amp;lt;tt&amp;gt;&#039;&#039;mynewtemplate&#039;&#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using a [[wikipedia:Text editor|text editor]] &#039;&#039;&#039;create the files &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;templateDetails.xml&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To keep things organized, make &#039;&#039;&#039;2 new folders called &amp;lt;tt&amp;gt;&#039;&#039;images&#039;&#039;&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;&#039;&#039;css&#039;&#039;&amp;lt;/tt&amp;gt;&#039;&#039;&#039;. Inside the &amp;lt;tt&amp;gt;&#039;&#039;css&#039;&#039;&amp;lt;/tt&amp;gt; folder create a file called &amp;lt;tt&amp;gt;template.css&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Although it is fine to place all your [[CSS]] code directly in your &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; file to start, many web developers prefer to place their CSS code in a separate file that can be linked from multiple pages using the &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; tag. This may also shorten the loading time of your pages, since the separate file can be cached.&lt;br /&gt;
&lt;br /&gt;
This is the most basic practical setup.&lt;br /&gt;
&lt;br /&gt;
Outline of folder and file structure:&lt;br /&gt;
* &amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;mynewtemplate/&#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;&#039;&#039;css/&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
*** &amp;lt;tt&amp;gt;template.css&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;&#039;&#039;images/&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;templateDetails.xml&amp;lt;/tt&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samwilsonau</name></author>
	</entry>
</feed>