<?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=Arcturusweb</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=Arcturusweb"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Arcturusweb"/>
	<updated>2026-08-17T04:27:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=DocType_header_for_templates&amp;diff=21883</id>
		<title>DocType header for templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=DocType_header_for_templates&amp;diff=21883"/>
		<updated>2010-02-24T18:13:49Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Which DocType header to use ===&lt;br /&gt;
&lt;br /&gt;
Current thinking is that XHTML 1.0 Transitional should be used for Joomla! templates.&lt;br /&gt;
&lt;br /&gt;
{{:Recommended DocTypes|}}&lt;br /&gt;
&lt;br /&gt;
{{:References about DocTypes|}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:Topics]]&lt;br /&gt;
[[Category:HTML|DocType]]&lt;br /&gt;
[[Category:Template FAQ]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Setting_up_page_width&amp;diff=21882</id>
		<title>Setting up page width</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Setting_up_page_width&amp;diff=21882"/>
		<updated>2010-02-24T18:10:53Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
&lt;br /&gt;
=== Setting up Page Width ===&lt;br /&gt;
&lt;br /&gt;
Some templates provide the opportunity to select the type of page width, through its parameter settings. In case this does not meet the requirements, the template manager also allows the modification of the cascading style sheets. It is in those files, usually with the extension .css, that most, if not all, of the style (graphical) attributes are defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is CSS?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
CSS stands for Cascading Style Sheet. HTML tags specify the graphical flow of the elements, be it text, images or flash animations, on a webpage. CSS allows us to define the appearances of those html tags with their content, somewhere, so that other pages, if want be, may adhere to. This brings along consistency throughout a website. The cascading effect stipulates that the style of a tag (parent) may be inherited by other tags (children) inside it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CSS Statements&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The definition of an html tag is as follows: &lt;br /&gt;
&lt;br /&gt;
tagname { attribute: value; attribute: value; }&lt;br /&gt;
&lt;br /&gt;
Tagname may be any html tag but for the sake of setting up page width, what is of interest to us is an html tag that gives structure to a webpage. Some webpages are constructed from div tags while others are constructed on table tags. Usually, the tag has a &#039;width&#039; attribute. You set up a page width by varying the value of the &#039;width&#039; attribute.&lt;br /&gt;
&lt;br /&gt;
Sometimes, html tags are not defined directly. They are given an id or a class name and CSS refers to those specific tags by their ids or their class names.&lt;br /&gt;
&lt;br /&gt;
The definition of an id in CSS is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#35;idname { attribute: value; attribute: value; }&lt;br /&gt;
&lt;br /&gt;
while the definition of a class in CSS is as follows:&lt;br /&gt;
&lt;br /&gt;
.classname { attribute: value; attribute: value; }&lt;br /&gt;
&lt;br /&gt;
Again setting up a page width means modifying the value of the &#039;width&#039; attribute of any one of these definitions.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Value of the &#039;width&#039; attribute&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The value of the &#039;width&#039; attribute may be in pixels or percentage. Pixels are fixed values; hence in this case, the width does not vary according to window resizing or changing screen resolutions. Percentage usually means that the width is a fraction of the width of its container. So if we have a screen resolution of 1024 pixels by 768 pixels and our page width is set to 80% of the browser window container, our page would be approximately 820 pixels (80% of 1024) provided that the window browser is open at its fullest.&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=References_about_DocTypes&amp;diff=21881</id>
		<title>References about DocTypes</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=References_about_DocTypes&amp;diff=21881"/>
		<updated>2010-02-24T18:10:19Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== References about DocTypes ===&lt;br /&gt;
&lt;br /&gt;
References about recommended DocTypes:&lt;br /&gt;
&lt;br /&gt;
* http://www.w3.org/QA/2002/04/Web-Quality&lt;br /&gt;
* http://www.alistapart.com/stories/doctype&lt;br /&gt;
* http://htmlhelp.com/tools/validator/doctype.html&lt;br /&gt;
* http://vivalaweb.info/blog/musing/2005/05/14/choosing-the-right-doctype-a-straight-forward-guide/&lt;br /&gt;
* http://hsivonen.iki.fi/doctype/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Reference]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Itemised lists]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Recommended_DocTypes&amp;diff=21880</id>
		<title>Recommended DocTypes</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Recommended_DocTypes&amp;diff=21880"/>
		<updated>2010-02-24T18:09:23Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Recommended DocTypes===&lt;br /&gt;
List of recommended DocTypes for different circumstances:-&lt;br /&gt;
&lt;br /&gt;
* HTML 4.01 Strict: &amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01//EN&amp;quot; &amp;quot;http://www.w3.org/TR/html4/strict.dtd&amp;quot;&amp;gt;&lt;br /&gt;
* HTML 4.01 Transitional: &amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/html4/loose.dtd&amp;quot;&amp;gt;&lt;br /&gt;
* HTML 4.01 Frameset: &amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01 Frameset//EN&amp;quot; &amp;quot;http://www.w3.org/TR/html4/frameset.dtd&amp;quot;&amp;gt;&lt;br /&gt;
* XHTML 1.0 Strict: &amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;&amp;gt;&lt;br /&gt;
* XHTML 1.0 Transitional: &amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;
* XHTML 1.0 Frameset: &amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Frameset//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&amp;quot;&amp;gt;&lt;br /&gt;
* XHTML 1.1 DTD: &amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.1//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Reference]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Itemised lists]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Horizontal_centering&amp;diff=21878</id>
		<title>Horizontal centering</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Horizontal_centering&amp;diff=21878"/>
		<updated>2010-02-24T18:07:56Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Headline text ===&lt;br /&gt;
&lt;br /&gt;
Horizontal centering is achieved with CSS in one of two ways, depending on what you are centering.&lt;br /&gt;
&lt;br /&gt;
For the first example, let&#039;s say you have a horizontal menu at the top of your page that you want centered in your layout. You would do it with a block of code in the linked CSS file like this:&lt;br /&gt;
&lt;br /&gt;
 #horz_menu {margin: auto; width: 800px; height: 25px; }&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;auto&amp;quot; value in the &amp;quot;margin&amp;quot; attribute centers the item, so this would create a menu area that is 800 pixels wide and 25 pixels tall and would be centered in whatever space it is placed in.&lt;br /&gt;
&lt;br /&gt;
If you need to add some margin space above and below the menu and still keep it centered you would adjust the code like this:&lt;br /&gt;
&lt;br /&gt;
 #horz_menu { margin: 20px auto 20px auto; width: 800px; height: 25px; }&lt;br /&gt;
&lt;br /&gt;
This would add 20 pixles of space on the top and bottom of the menu while keeping the left and right margin in a centered mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second example is when you simply want to center text, in which case you just add the &amp;quot;text-align&amp;quot; code.&lt;br /&gt;
&lt;br /&gt;
 #horz_menu a { padding: .75em 0 .52em 0; font-size: 0.8em; font-weight: bold; color: #0033CC; background-color: transparent; text-align: center; }&lt;br /&gt;
&lt;br /&gt;
This would cause any links within the horz_menu div tag of the html code to be centered in the horizontal menu. They would also have .75em of padding above and .52em of padding below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These same techniques work for the overall page layout as well. Let&#039;s say you want the shell content area of your page to be 900 pixels wide and to be centered on the page and that you want the headline to be centered within it. Your CSS code would look something like this:&lt;br /&gt;
&lt;br /&gt;
 #page_container {margin: auto; width: 900px; background-color: #FFFFFF; border: 1pt solid #660000; }&lt;br /&gt;
&lt;br /&gt;
 #page_container h1 {margin: 50px 0 20px 0 ; font-size: 1.25em; font-weight: bold; color: #0033CC; background-color: transparent; text-align: center; }&lt;br /&gt;
&lt;br /&gt;
This would create a page that has a main content box centered in the browser window with a white background and a brown border.&lt;br /&gt;
&lt;br /&gt;
Any text inside a h1 tag that is inside the page_container div tag in the html code of the page would also be centered inside that main content box.&lt;br /&gt;
&lt;br /&gt;
Of course the example above is a simplified example for demonstration and you would have more structure involved (left column, right column, etc).&lt;br /&gt;
&lt;br /&gt;
So as you can see, horizontal centering for structural items is achieved with the &amp;quot;margin&amp;quot; attribute whereas horizontal centering for text items is achieved using the &amp;quot;text-align&amp;quot; attribute.&lt;br /&gt;
&lt;br /&gt;
--[[User:Daganray|daganray]] 09:54, 15 November 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Finding_module_positions_on_any_given_page&amp;diff=21877</id>
		<title>Finding module positions on any given page</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Finding_module_positions_on_any_given_page&amp;diff=21877"/>
		<updated>2010-02-24T18:06:53Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: /* Finding module positions on any given page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Finding module positions on any given page ===&lt;br /&gt;
&lt;br /&gt;
To get a visual indication of all module positions used on a page you can follow this procedure:-&lt;br /&gt;
&lt;br /&gt;
* navigate to the page in your web browser.&lt;br /&gt;
* click into the URL field in your browser.&lt;br /&gt;
* look for any &amp;quot;parameters&amp;quot; at the end of the URL. These are separated from the main part of the URL by a question mark.  For example, in the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://mydomain.com/index.php?id=17&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, the &amp;quot;id=17&amp;quot; is a parameter.&lt;br /&gt;
* if there are no parameters, append &amp;quot;?tp=1&amp;quot; to the URL and press RETURN.  For example, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://mydomain.com/index.php?tp=1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* if there are already parameters in the URL, append &amp;quot;&amp;amp;tp=1&amp;quot; to the URL and press RETURN.  For example, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://mydomain.com/index.php?id=17&amp;amp;tp=1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* the module positions will be outlined in red.&lt;br /&gt;
&lt;br /&gt;
Note that in some circumstances there may be module positions available that are not outlined in red. This can happen when a template defines those module positions as conditional on there being modules enabled in that position. If there are no modules enabled in that position then the template may adapt and the position will not be visible.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Modules]][[Category:Procedures]][[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Changing_the_site_favicon&amp;diff=21876</id>
		<title>Changing the site favicon</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Changing_the_site_favicon&amp;diff=21876"/>
		<updated>2010-02-24T18:06:16Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: /* Changing the Site Favicon */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Changing the Site Favicon===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Create a 16x16 pixel image.&#039;&#039;&#039;  You may use graphic software such as [[wikipedia:Photoshop|Photoshop]], [[wikipedia:Gimp|Gimp]] or [[wikipedia:Windows_Paint|Windows Paint]] or an online tool such as http://antifavicon.com/&lt;br /&gt;
# &#039;&#039;&#039;Convert to ico format&#039;&#039;&#039; using free online sites such as:&lt;br /&gt;
#* http://converticon.com/&lt;br /&gt;
#* http://www.favicongenerator.com/&lt;br /&gt;
#* http://www.htmlkit.com/services/favicon/&lt;br /&gt;
#* http://tools.dynamicdrive.com/favicon/&lt;br /&gt;
#* http://www.favicon.cc/&lt;br /&gt;
# The file you created in this way will have the extension .ico. &#039;&#039;&#039;Copy the file&#039;&#039;&#039; to the /joomla/templates/&amp;lt;your template&amp;gt; directory and &#039;&#039;&#039;name it&#039;&#039;&#039; favicon.ico.&lt;br /&gt;
# Open a browser. Do you see your new icon? If so, congratulations. If not, that doesn&#039;t necessarily mean you did anything wrong. Browsers are designed to minimize data traffic, so they don&#039;t refresh the favicon every time they show a page. Even refreshing the page (F5) wont help. So you need to refresh more thoroughly:&lt;br /&gt;
#* &#039;&#039;Mozilla / Firefox / Safari&#039;&#039;: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac);&lt;br /&gt;
#* &#039;&#039;IE&#039;&#039;: hold Ctrl while clicking Refresh, or press Ctrl-F5;&lt;br /&gt;
#* &#039;&#039;Konqueror&#039;&#039;: simply click the Reload button, or press F5;&lt;br /&gt;
#* &#039;&#039;Opera&#039;&#039; users may need to completely clear their cache in Tools→Preferences.&lt;br /&gt;
If this doesn&#039;t work you will need to delete the temporary internet files and the history and then open your page again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some templates contain code that redirects the browser to another directory or another icon file. To determine where your new favicon should be, examine http://yoursite.com/templates/your_template/index.php and look for code that contains the text &amp;lt;link rel=&amp;quot;shortcut icon&amp;quot;. There you will find the directory and the name of the icon file. Copy your icon to that place and give it the the name that link is pointing to (you might want to backup the old file). Make sure you set the security correctly such that you webserver has access to that file. Look at the example below. &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;http://yoursite.com/templates/your_template/icon/favicon.ico&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to just change the &#039;&#039;&#039;favicon.ico&#039;&#039;&#039; file in its respective template directory you can find the reference to the &#039;&#039;&#039;favicon.ico&#039;&#039;&#039; file in the &#039;&#039;&#039;html.php&#039;&#039;&#039; document. The path is &#039;&#039;&#039;&amp;quot;........\libraries\joomla\document\html\html.php&amp;quot;&#039;&#039;&#039;. This should prevent the icon from toggling if you use &lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;http://yoursite.com/templates/your_template/icon/youricon.ico&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
in the template html and you don&#039;t remove the favicon.ico file. (why call the icon twice?)&lt;br /&gt;
&lt;br /&gt;
From the html.php &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Try to find a favicon by checking the template and root folder&lt;br /&gt;
		$path = $directory . DS;&lt;br /&gt;
		$dirs = array( $path, JPATH_BASE . DS );&lt;br /&gt;
		foreach ($dirs as $dir )&lt;br /&gt;
		{&lt;br /&gt;
			$icon =   $dir . &#039;favicon.ico&#039;;&lt;br /&gt;
			if (file_exists( $icon ))&lt;br /&gt;
			{&lt;br /&gt;
				$path = str_replace( JPATH_BASE . DS, &#039;&#039;, $dir );&lt;br /&gt;
				$path = str_replace( &#039;\\&#039;, &#039;/&#039;, $path );&lt;br /&gt;
				$this-&amp;gt;addFavicon( JURI::base(true).&#039;/&#039;.$path . &#039;favicon.ico&#039; );&lt;br /&gt;
				break;&#039;&#039;&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_images&amp;diff=21875</id>
		<title>Adding images</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_images&amp;diff=21875"/>
		<updated>2010-02-24T18:05:50Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: /* Adding Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Adding Images===&lt;br /&gt;
* Upload Using Media Manager&lt;br /&gt;
The simplest way to add images is to upload them from your computer using the Media Manager.  First, of course, you have to download the image onto your computer and be able to find it.  Then, from the Control Panel (back-end administrative interface) navigate to Site -&amp;gt; Media Manager.&lt;br /&gt;
&lt;br /&gt;
On the left is a directory tree, with the root directory &amp;quot;Media&amp;quot;.  This corresponds to the default &amp;quot;images&amp;quot; directory, yoursite/joomla/images. Pick a subdirectory where you want the image located, or else do nothing to upload the image to the default images directory.&lt;br /&gt;
&lt;br /&gt;
At the bottom of the page is a typical Upload box.  Click &amp;quot;Browse&amp;quot; to locate the image on your computer, then &amp;quot;Upload&amp;quot; to upload the file to the server. &lt;br /&gt;
&lt;br /&gt;
* FTP&lt;br /&gt;
&lt;br /&gt;
Of course, you can upload images to a server using any standard FTP client.  You might find this handier for adding images to template directories; however, if you have FTP set up, you probably don&#039;t need an explanation of how to add an image.  Also, many server administration panels such as Cpanel and Plesk have upload capabilities.&lt;br /&gt;
&lt;br /&gt;
* Extensions&lt;br /&gt;
&lt;br /&gt;
There are several extensions, available from the Joomla extensions section, that handle image uploads.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Administration FAQ]]&lt;br /&gt;
[[Category:Getting Started FAQ]]&lt;br /&gt;
[[Category:Version 1.5 FAQ]]&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21872</id>
		<title>More advanced Joomla! templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21872"/>
		<updated>2010-02-24T18:04:13Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:Quirks mode and how to avoid it|Quirks mode and how to avoid it}}&lt;br /&gt;
&lt;br /&gt;
{{:Which DocType header to use|Which DocType header to use}}&lt;br /&gt;
&lt;br /&gt;
{{:Setting up page width|Setting up page width}}&lt;br /&gt;
&lt;br /&gt;
{{:About CSS page layouts|About CSS page layouts}}&lt;br /&gt;
&lt;br /&gt;
{{:Source ordering|Source ordering}}&lt;br /&gt;
&lt;br /&gt;
{{:Horizontal centering|Horizontal centering}}&lt;br /&gt;
&lt;br /&gt;
{{:PHP essentials|PHP essentials}} (eg. echo, if-then-else)&lt;br /&gt;
&lt;br /&gt;
{{:Adding images|Adding images}}&lt;br /&gt;
&lt;br /&gt;
{{:Declaring module positions|Declaring module positions}}&lt;br /&gt;
&lt;br /&gt;
{{:Finding module positions on any given page|Finding module positions on any given page}}&lt;br /&gt;
&lt;br /&gt;
{{:Changing the site favicon|Changing the site favicon}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21871</id>
		<title>More advanced Joomla! templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21871"/>
		<updated>2010-02-24T18:03:38Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Undo revision 21870 by Arcturusweb (Talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====  Quirks mode and how to avoid it ====&lt;br /&gt;
{{:Quirks mode and how to avoid it|Quirks mode and how to avoid it}}&lt;br /&gt;
==== Which DocType header to use ====&lt;br /&gt;
{{:Which DocType header to use|Which DocType header to use}}&lt;br /&gt;
&lt;br /&gt;
{{:Setting up page width|Setting up page width}}&lt;br /&gt;
&lt;br /&gt;
{{:About CSS page layouts|About CSS page layouts}}&lt;br /&gt;
&lt;br /&gt;
{{:Source ordering|Source ordering}}&lt;br /&gt;
&lt;br /&gt;
{{:Horizontal centering|Horizontal centering}}&lt;br /&gt;
&lt;br /&gt;
{{:PHP essentials|PHP essentials}} (eg. echo, if-then-else)&lt;br /&gt;
&lt;br /&gt;
{{:Adding images|Adding images}}&lt;br /&gt;
&lt;br /&gt;
{{:Declaring module positions|Declaring module positions}}&lt;br /&gt;
&lt;br /&gt;
{{:Finding module positions on any given page|Finding module positions on any given page}}&lt;br /&gt;
&lt;br /&gt;
{{:Changing the site favicon|Changing the site favicon}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21870</id>
		<title>More advanced Joomla! templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21870"/>
		<updated>2010-02-24T18:03:21Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Undo revision 21869 by Arcturusweb (Talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====  Quirks mode and how to avoid it ====&lt;br /&gt;
{{:Quirks mode and how to avoid it|Quirks mode and how to avoid it}}&lt;br /&gt;
==== Which DocType header to use ====&lt;br /&gt;
{{:Which DocType header to use|Which DocType header to use}}&lt;br /&gt;
====Setting up page width====&lt;br /&gt;
{{:Setting up page width|Setting up page width}}&lt;br /&gt;
====About CSS page layouts====&lt;br /&gt;
{{:About CSS page layouts|About CSS page layouts}}&lt;br /&gt;
====Source Ordering====&lt;br /&gt;
{{:Source ordering|Source ordering}}&lt;br /&gt;
====Horizontal Centering====&lt;br /&gt;
{{:Horizontal centering|Horizontal centering}}&lt;br /&gt;
====PHP Essentials====&lt;br /&gt;
{{:PHP essentials|PHP essentials}} (eg. echo, if-then-else)&lt;br /&gt;
====Adding Images====&lt;br /&gt;
{{:Adding images|Adding images}}&lt;br /&gt;
====Declaring Module Positions====&lt;br /&gt;
{{:Declaring module positions|Declaring module positions}}&lt;br /&gt;
====Finding module positions on any given page====&lt;br /&gt;
{{:Finding module positions on any given page|Finding module positions on any given page}}&lt;br /&gt;
====Changing the site favicon====&lt;br /&gt;
{{:Changing the site favicon|Changing the site favicon}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21869</id>
		<title>More advanced Joomla! templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21869"/>
		<updated>2010-02-24T18:02:26Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Undo revision 21865 by Arcturusweb (Talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====  Quirks mode and how to avoid it ====&lt;br /&gt;
{{:Quirks mode and how to avoid it|Quirks mode and how to avoid it}}&lt;br /&gt;
==== Which DocType header to use ====&lt;br /&gt;
{{:Which DocType header to use|Which DocType header to use}}&lt;br /&gt;
&lt;br /&gt;
{{:Setting up page width|Setting up page width}}&lt;br /&gt;
&lt;br /&gt;
{{:About CSS page layouts|About CSS page layouts}}&lt;br /&gt;
&lt;br /&gt;
{{:Source ordering|Source ordering}}&lt;br /&gt;
&lt;br /&gt;
{{:Horizontal centering|Horizontal centering}}&lt;br /&gt;
&lt;br /&gt;
{{:PHP essentials|PHP essentials}} (eg. echo, if-then-else)&lt;br /&gt;
&lt;br /&gt;
{{:Adding images|Adding images}}&lt;br /&gt;
&lt;br /&gt;
{{:Declaring module positions|Declaring module positions}}&lt;br /&gt;
&lt;br /&gt;
{{:Finding module positions on any given page|Finding module positions on any given page}}&lt;br /&gt;
&lt;br /&gt;
{{:Changing the site favicon|Changing the site favicon}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=PHP_essentials&amp;diff=21868</id>
		<title>PHP essentials</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=PHP_essentials&amp;diff=21868"/>
		<updated>2010-02-24T18:01:29Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Undo revision 21867 by Arcturusweb (Talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
===PHP essentials===&lt;br /&gt;
----&lt;br /&gt;
Many web designers and casual website owners are not conversant with the&lt;br /&gt;
PHP language in which Joomla! is written and since Joomla! templates&lt;br /&gt;
usually contain PHP statements it is necessary to understand at least a&lt;br /&gt;
little of the language in order to be able to create or customize&lt;br /&gt;
templates. This chunk will describe, in simple terms, how to use each aspect of PHP in the&lt;br /&gt;
context of a Joomla! template. For example, a simple explanation of the PHP&lt;br /&gt;
if-then-else syntax using extracts from a template for illustration.&lt;br /&gt;
&lt;br /&gt;
The best resource to learn PHP is probably hands on experience and Joomla can provide that to you thanks to it&#039;s native PHP code.  This can be overwhelming for people who have not programmed before. Though Joomla is easy enough to [[Installation|install]] with the help of the community and a little of your time you&#039;ll have people asking you to do their websites.&lt;br /&gt;
&lt;br /&gt;
One place that has a nice short list if functions and examples is http://en.wikiversity.org/wiki/25_Essential_PHP_Functions which is good to get familiar with PHP. Though for an extensive function list, explanations, and examples go to http://www.php.net.&lt;br /&gt;
&lt;br /&gt;
Once you have the basics of PHP you&#039;ll need to get the basics of the Joomla PHP syntax.  Start by looking at some existing {{jsite|ext|extensions}} and check out the code and also take a look at some these Tutorials about Joomla:&lt;br /&gt;
&lt;br /&gt;
[http://developer.joomla.org/tutorials/184-how-to-create-a-joomla-plugin.html How to create a Joomla! Plugin]&lt;br /&gt;
&lt;br /&gt;
[http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1 Developing a Model-View-Controller Component - Part 1]&lt;br /&gt;
&lt;br /&gt;
[http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_2_-_Adding_a_Model Developing a Model-View-Controller Component - Part 2 - Adding a Model]&lt;br /&gt;
&lt;br /&gt;
[http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_3_-_Using_the_Database Developing a Model-View-Controller Component - Part 3 - Using the Database]&lt;br /&gt;
&lt;br /&gt;
[http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_4_-_Creating_an_Administrator_Interface Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]&lt;br /&gt;
&lt;br /&gt;
That will help you get familiar with some of the functions available within Joomla&#039;s system and what they do (using the API).  Take particular care to understand the MVC (model view control) setup.&lt;br /&gt;
&lt;br /&gt;
If however, you are absolutely new to PHP, following may help as very brief introduction to PHP.&lt;br /&gt;
&lt;br /&gt;
==== PHP Introduction ====&lt;br /&gt;
PHP is a scripting language and is designed primarily for producing dynamic web pages. It is in general embedded into a HTML page with tags like &amp;lt;?php ... ?&amp;gt;. When such a page is passed on to the PHP engine, the engine translates the PHP tags into HTML and which can then be rendered by a browser. Further during translation the script may require to pull data from a database and thus a database is needed. So for creating PHP pages we require in general, the PHP engine, a database typically MySQL and finally the webserver which will co-ordinate these actions and forward the final HTML to the browser. These 3 components can be installed separately, however, for convenience we have packages like WAMP for windows, MAMP for mac and LAMP for Linux. Installing the packages is discussed next.&lt;br /&gt;
&lt;br /&gt;
==== PHP Installation ====&lt;br /&gt;
The packages can be downloaded from [http://www.wampserver.com/en/download.php WAMP]. WAMP stands for Windows Apache MySQL PHP. The instructions can be followed as given in the site and is pretty straightforward. The installation can be done is any directory (say D:/wamp). Once installed, it can be started from the program-&amp;gt;start-&amp;gt;WampServer. This should give a small icon in the system tray using which the server can be started/stopped/restarted. It also gives links to all important files like php.ini and other configuration files. For Mac users MAMP can be found [http://www.macupdate.com/info.php/id/16197 here]. For the purpose of this tutorial [http://www.apachefriends.org/en/xampp.html XAMPP] can also be used.&lt;br /&gt;
&lt;br /&gt;
==== PHP Round trip ====&lt;br /&gt;
Our primary target here is to write a small PHP page and get it rendered by the Apache web server. To render a page WAMP by default looks into the www folder of the WAMP install directory referred henceforth as WAMP_HOME for convenience. Fire up your primary text editor and create a page say first.php and save it in the WAMP_HOME/www/x/y folder, where x, y are folders (which you can create for organizing your scripts). Write the following in the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
   &amp;lt;title&amp;gt;Basic PHP Page&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
echo (&amp;quot;My first php snippet&amp;quot;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this file and point your browser to http://localhost/x/y/first.php and you should be able to see the echo message. &lt;br /&gt;
&lt;br /&gt;
Primary things to note here are &amp;lt;pre&amp;gt;&lt;br /&gt;
1. It is strongly advised to start any PHP code by &amp;quot;&amp;lt;?php&amp;quot; and end with a &amp;quot;?&amp;gt;&amp;quot; tag. &lt;br /&gt;
2. To have a semicolon after each PHP statement.&lt;br /&gt;
3. The directory in which this script resides needs to be given in the URL. &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This completes our round trip. Now for the sake of learning either you can keep including new elements in this file or may create separate scripts and load them in the browser.&lt;br /&gt;
&lt;br /&gt;
==== PHP Variable declaration and Data types ====&lt;br /&gt;
For any programming we need to hold data. In PHP following are the ways in which you can define variables.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$variable_name = 0; &amp;lt;/li&amp;gt;&lt;br /&gt;
Note here we did not define what is the type of variable, whether integer or string that the variable should hold. This is referred to as dynamic scoping. &lt;br /&gt;
&amp;lt;li&amp;gt; the variable names should start with an alphabet and can contain alphanumeric characters and &amp;quot;_&amp;quot;&lt;br /&gt;
&amp;lt;li&amp;gt; Defining constants - &amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt; define (&amp;quot;NAME_OF_THE_CONSTANT&amp;quot; , $value); &amp;lt;/source&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic operators ====&lt;br /&gt;
The general operators are as below and explained.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a.	+   e.g. 6 + 3, addition operator, answer is 9&lt;br /&gt;
b.	–   e.g. 6 - 3, subtraction operator, answer is 3&lt;br /&gt;
c.	/   e.g. 6 / 3, division operator, answer is 2&lt;br /&gt;
d.	*   e.g. 6 * 3, multiplication operator, answer is 18&lt;br /&gt;
e.	%   e.g. 6 % 3, modulus operator, answer is 0&lt;br /&gt;
f.	.   e.g. &#039;6&#039;.&#039;3&#039;, concatenation operator, gives string &#039;63&#039;&lt;br /&gt;
g.	+=   e.g. $x += 6, adds 6&lt;br /&gt;
h.	-=   e.g. $x -= 6, subtracts 6&lt;br /&gt;
i.	/=   e.g. $x /= 6, divides by 6&lt;br /&gt;
j.	%=   e.g. $x %= 6, modulus by 6&lt;br /&gt;
k.	.=   e.g. $x .= &#039;6&#039;, concats 6 to x&lt;br /&gt;
l.	&amp;lt;   e.g. $x &amp;lt; $y, evaluates to true if $x is &amp;lt; $y&lt;br /&gt;
m.	&amp;gt;   e.g. $x &amp;gt; $y, evaluates to true if $x is &amp;gt; $y&lt;br /&gt;
n.	==  e.g. $x == $y, evaluates to true if $x is equal by value to $y&lt;br /&gt;
o.	!=  e.g. $x != $y, evaluates to true if $x is not equal to $y&lt;br /&gt;
p.	===   e.g. $x === $y, evaluates to true if $x is and $y is identical i.e both of same type both value and reference&lt;br /&gt;
q.	&amp;gt;=  e.g. $x &amp;gt;= $y, evaluates to true if $x is &amp;gt;= $y&lt;br /&gt;
r.	&amp;lt;=  e.g. $x &amp;lt;= $y, evaluates to true if $x is &amp;lt;= $y&lt;br /&gt;
s.	&amp;amp;&amp;amp;  e.g. ($x == 2 &amp;amp;&amp;amp; $y == 3) , evaluates to true if $x equals 2 and $y equals 3&lt;br /&gt;
t.	||  e.g. ($x == 2 || $y == 3) , evaluates to true if either $x equals 2 or $y equals 3&lt;br /&gt;
u.	xor e.g. ($x == 2 xor $y == 3) , evaluates to true if either $x equals 2 or $y equals 3 but not both&lt;br /&gt;
v.	++  e.g. $x++, increments $x&lt;br /&gt;
w.	–-  e.g. $x--, decrements $x&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Defining array Structures ====&lt;br /&gt;
&#039;&#039;&#039;Ways of declaring arrays&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;br&amp;gt; Suppose we want many variables, we could have done in the way declaring variables as above, however, that is not elegant, for suppose u want a 100 variables; declaring arrays come to the rescue. Note that index in PHP starts from 0.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$my_guitar_heroes = array (&amp;quot;Hendrix&amp;quot;, &amp;quot;Schenker&amp;quot;, &amp;quot;Gilmour&amp;quot;, &amp;quot;to_name_a_few!&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$my_guitar_heroes [] = &amp;quot;Hendrix&amp;quot;;&lt;br /&gt;
$my_guitar_heroes [] = &amp;quot;Schenker&amp;quot;;&lt;br /&gt;
$my_guitar_heroes [] = &amp;quot;Gilmour&amp;quot;;&lt;br /&gt;
$my_guitar_heroes [] = &amp;quot;to_name_a_few!&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here PHP automatically assigns the index.&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$my_guitar_heroes [0] = &amp;quot;Hendrix&amp;quot;;&lt;br /&gt;
$my_guitar_heroes [10000] = &amp;quot;Mainak&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here in I just knew the first element and the 10,001st element and that&#039;s me!&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
a combination of the above means&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Set the elements at positions 1 through 9999 to the value, &amp;quot;to be decided&amp;quot;.&lt;br /&gt;
$my_guitar_heroes  = array_fill( 1, 9999, &amp;quot;to be decided&amp;quot; ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Accessing the arrays&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
print $my_guitar_heroes[2]; //Access the 2nd element&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Access the last element (Note that the element positions are numbered zero to &lt;br /&gt;
// [number of elements] minus one.)&lt;br /&gt;
$my_guitar_heroes[count($my_guitar_heroes)-1]; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Access the last element using a function call.&lt;br /&gt;
end($my_guitar_heroes); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Iterating over the element of an array&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
foreach ( $my_guitar_heroes as $temp) {&lt;br /&gt;
  print &amp;quot;$temp&amp;lt;br /&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Control expressions ====&lt;br /&gt;
To execute a statement of collection of statements over and over, we use Control expressions. The  following are general syntax of the control structures&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;if statements&#039;&#039;&#039;&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if( $x &amp;gt; 0) {	&lt;br /&gt;
 print(&amp;quot;$x is positive&amp;quot;);&lt;br /&gt;
}  else if( $x &amp;lt; 0 ) {	&lt;br /&gt;
 print(&amp;quot;$x is negative&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
 print(&amp;quot;$x is 0&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;for loop&#039;&#039;&#039;&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
for ( $x=1; $x&amp;lt;= 10; $x++ ) {&lt;br /&gt;
 print &amp;quot;$x&amp;lt;BR/&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;while loop&#039;&#039;&#039;&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$x = 1&lt;br /&gt;
while ( $x &amp;lt;= 10 ) {&lt;br /&gt;
 print &amp;quot;$x&amp;lt;BR/&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;do while loop&#039;&#039;&#039;&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$x = 1;&lt;br /&gt;
do {&lt;br /&gt;
 print &amp;quot;$x&amp;lt;BR/&amp;gt;&amp;quot;;&lt;br /&gt;
 $x++;&lt;br /&gt;
}while($x &amp;lt;= 10);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Defining functions ====&lt;br /&gt;
Code which is duplicated at many places are best placed in a function. Following are the ways of describing the function.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function name_of_the_function( $arguments, $size=&#039;default_values_if_any&#039; ) {&lt;br /&gt;
  print &amp;quot;here goes in the code&amp;quot;; &lt;br /&gt;
  return &amp;quot;this value is returned, return statement is optional&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The arguments are passed by value. If they are to be passed by reference then an argument is prefixed by &amp;quot;&amp;amp;&amp;quot; as below&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function name_of_the_function( &amp;amp;$arguments, $size=&#039;default_values_if_any&#039; ) {&lt;br /&gt;
  print &amp;quot;here goes in the code&amp;quot;; &lt;br /&gt;
  return &amp;quot;this value is returned, return statement is optional&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Scope of a variables defined within a function is valid within the function only. &lt;br /&gt;
&lt;br /&gt;
Calling a function&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$x = add(5, 3);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Debugging ====&lt;br /&gt;
&#039;&#039;&#039;Basic printing options&#039;&#039;&#039; &amp;lt;br/&amp;gt;&lt;br /&gt;
A basic way to debug is to print the value of the variable. The following basic statments acheives that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;echo &amp;quot;if double quotes are used then dollar variables are resolved&amp;quot;;&lt;br /&gt;
&amp;lt;li&amp;gt;echo &#039;if single quote are used then dollar variables are not resolved&#039;;&lt;br /&gt;
&amp;lt;li&amp;gt;print &amp;quot;another way to print&amp;quot;;&lt;br /&gt;
&amp;lt;li&amp;gt;nl2br(&amp;quot;any new line characters like \n get automatically resolved to HTML line breaks&amp;quot;);&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from these the log files are very helpful and can be found in the WAMP_HOME/logs directory.&lt;br /&gt;
&lt;br /&gt;
==== Handling forms ====&lt;br /&gt;
PHP does not change any HTML structure, thus any syntax of HTML remains the same. The part that PHP plays is making any part dynamic for e.g the action attribute of a form can be coded as action=&amp;lt;?php my_own_action(); ?&amp;gt; so that it is dynamically generated. The part where PHP kicks in is after the form is submitted, to say obtain the values of the form fields, set cookies etc. For this super global variables are used which are always available to PHP code. Some of these are  &lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_GET - get the data from a GET request&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_POST - get the data from a POST request&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_REQUEST - get the request&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_COOKIE - obtain the cookies from the browser&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_SESSION - obtain the session&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of these are arrays and behave accordingly.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:Templates]]&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=PHP_essentials&amp;diff=21867</id>
		<title>PHP essentials</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=PHP_essentials&amp;diff=21867"/>
		<updated>2010-02-24T17:57:39Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Removed Level 4 Heading for article.  If importing this page into another article, include the heading for this page in THAT article.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
----&lt;br /&gt;
Many web designers and casual website owners are not conversant with the&lt;br /&gt;
PHP language in which Joomla! is written and since Joomla! templates&lt;br /&gt;
usually contain PHP statements it is necessary to understand at least a&lt;br /&gt;
little of the language in order to be able to create or customize&lt;br /&gt;
templates. This chunk will describe, in simple terms, how to use each aspect of PHP in the&lt;br /&gt;
context of a Joomla! template. For example, a simple explanation of the PHP&lt;br /&gt;
if-then-else syntax using extracts from a template for illustration.&lt;br /&gt;
&lt;br /&gt;
The best resource to learn PHP is probably hands on experience and Joomla can provide that to you thanks to it&#039;s native PHP code.  This can be overwhelming for people who have not programmed before. Though Joomla is easy enough to [[Installation|install]] with the help of the community and a little of your time you&#039;ll have people asking you to do their websites.&lt;br /&gt;
&lt;br /&gt;
One place that has a nice short list if functions and examples is http://en.wikiversity.org/wiki/25_Essential_PHP_Functions which is good to get familiar with PHP. Though for an extensive function list, explanations, and examples go to http://www.php.net.&lt;br /&gt;
&lt;br /&gt;
Once you have the basics of PHP you&#039;ll need to get the basics of the Joomla PHP syntax.  Start by looking at some existing {{jsite|ext|extensions}} and check out the code and also take a look at some these Tutorials about Joomla:&lt;br /&gt;
&lt;br /&gt;
[http://developer.joomla.org/tutorials/184-how-to-create-a-joomla-plugin.html How to create a Joomla! Plugin]&lt;br /&gt;
&lt;br /&gt;
[http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1 Developing a Model-View-Controller Component - Part 1]&lt;br /&gt;
&lt;br /&gt;
[http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_2_-_Adding_a_Model Developing a Model-View-Controller Component - Part 2 - Adding a Model]&lt;br /&gt;
&lt;br /&gt;
[http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_3_-_Using_the_Database Developing a Model-View-Controller Component - Part 3 - Using the Database]&lt;br /&gt;
&lt;br /&gt;
[http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_4_-_Creating_an_Administrator_Interface Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]&lt;br /&gt;
&lt;br /&gt;
That will help you get familiar with some of the functions available within Joomla&#039;s system and what they do (using the API).  Take particular care to understand the MVC (model view control) setup.&lt;br /&gt;
&lt;br /&gt;
If however, you are absolutely new to PHP, following may help as very brief introduction to PHP.&lt;br /&gt;
&lt;br /&gt;
==== PHP Introduction ====&lt;br /&gt;
PHP is a scripting language and is designed primarily for producing dynamic web pages. It is in general embedded into a HTML page with tags like &amp;lt;?php ... ?&amp;gt;. When such a page is passed on to the PHP engine, the engine translates the PHP tags into HTML and which can then be rendered by a browser. Further during translation the script may require to pull data from a database and thus a database is needed. So for creating PHP pages we require in general, the PHP engine, a database typically MySQL and finally the webserver which will co-ordinate these actions and forward the final HTML to the browser. These 3 components can be installed separately, however, for convenience we have packages like WAMP for windows, MAMP for mac and LAMP for Linux. Installing the packages is discussed next.&lt;br /&gt;
&lt;br /&gt;
==== PHP Installation ====&lt;br /&gt;
The packages can be downloaded from [http://www.wampserver.com/en/download.php WAMP]. WAMP stands for Windows Apache MySQL PHP. The instructions can be followed as given in the site and is pretty straightforward. The installation can be done is any directory (say D:/wamp). Once installed, it can be started from the program-&amp;gt;start-&amp;gt;WampServer. This should give a small icon in the system tray using which the server can be started/stopped/restarted. It also gives links to all important files like php.ini and other configuration files. For Mac users MAMP can be found [http://www.macupdate.com/info.php/id/16197 here]. For the purpose of this tutorial [http://www.apachefriends.org/en/xampp.html XAMPP] can also be used.&lt;br /&gt;
&lt;br /&gt;
==== PHP Round trip ====&lt;br /&gt;
Our primary target here is to write a small PHP page and get it rendered by the Apache web server. To render a page WAMP by default looks into the www folder of the WAMP install directory referred henceforth as WAMP_HOME for convenience. Fire up your primary text editor and create a page say first.php and save it in the WAMP_HOME/www/x/y folder, where x, y are folders (which you can create for organizing your scripts). Write the following in the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
   &amp;lt;title&amp;gt;Basic PHP Page&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
echo (&amp;quot;My first php snippet&amp;quot;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this file and point your browser to http://localhost/x/y/first.php and you should be able to see the echo message. &lt;br /&gt;
&lt;br /&gt;
Primary things to note here are &amp;lt;pre&amp;gt;&lt;br /&gt;
1. It is strongly advised to start any PHP code by &amp;quot;&amp;lt;?php&amp;quot; and end with a &amp;quot;?&amp;gt;&amp;quot; tag. &lt;br /&gt;
2. To have a semicolon after each PHP statement.&lt;br /&gt;
3. The directory in which this script resides needs to be given in the URL. &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This completes our round trip. Now for the sake of learning either you can keep including new elements in this file or may create separate scripts and load them in the browser.&lt;br /&gt;
&lt;br /&gt;
==== PHP Variable declaration and Data types ====&lt;br /&gt;
For any programming we need to hold data. In PHP following are the ways in which you can define variables.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$variable_name = 0; &amp;lt;/li&amp;gt;&lt;br /&gt;
Note here we did not define what is the type of variable, whether integer or string that the variable should hold. This is referred to as dynamic scoping. &lt;br /&gt;
&amp;lt;li&amp;gt; the variable names should start with an alphabet and can contain alphanumeric characters and &amp;quot;_&amp;quot;&lt;br /&gt;
&amp;lt;li&amp;gt; Defining constants - &amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt; define (&amp;quot;NAME_OF_THE_CONSTANT&amp;quot; , $value); &amp;lt;/source&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic operators ====&lt;br /&gt;
The general operators are as below and explained.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a.	+   e.g. 6 + 3, addition operator, answer is 9&lt;br /&gt;
b.	–   e.g. 6 - 3, subtraction operator, answer is 3&lt;br /&gt;
c.	/   e.g. 6 / 3, division operator, answer is 2&lt;br /&gt;
d.	*   e.g. 6 * 3, multiplication operator, answer is 18&lt;br /&gt;
e.	%   e.g. 6 % 3, modulus operator, answer is 0&lt;br /&gt;
f.	.   e.g. &#039;6&#039;.&#039;3&#039;, concatenation operator, gives string &#039;63&#039;&lt;br /&gt;
g.	+=   e.g. $x += 6, adds 6&lt;br /&gt;
h.	-=   e.g. $x -= 6, subtracts 6&lt;br /&gt;
i.	/=   e.g. $x /= 6, divides by 6&lt;br /&gt;
j.	%=   e.g. $x %= 6, modulus by 6&lt;br /&gt;
k.	.=   e.g. $x .= &#039;6&#039;, concats 6 to x&lt;br /&gt;
l.	&amp;lt;   e.g. $x &amp;lt; $y, evaluates to true if $x is &amp;lt; $y&lt;br /&gt;
m.	&amp;gt;   e.g. $x &amp;gt; $y, evaluates to true if $x is &amp;gt; $y&lt;br /&gt;
n.	==  e.g. $x == $y, evaluates to true if $x is equal by value to $y&lt;br /&gt;
o.	!=  e.g. $x != $y, evaluates to true if $x is not equal to $y&lt;br /&gt;
p.	===   e.g. $x === $y, evaluates to true if $x is and $y is identical i.e both of same type both value and reference&lt;br /&gt;
q.	&amp;gt;=  e.g. $x &amp;gt;= $y, evaluates to true if $x is &amp;gt;= $y&lt;br /&gt;
r.	&amp;lt;=  e.g. $x &amp;lt;= $y, evaluates to true if $x is &amp;lt;= $y&lt;br /&gt;
s.	&amp;amp;&amp;amp;  e.g. ($x == 2 &amp;amp;&amp;amp; $y == 3) , evaluates to true if $x equals 2 and $y equals 3&lt;br /&gt;
t.	||  e.g. ($x == 2 || $y == 3) , evaluates to true if either $x equals 2 or $y equals 3&lt;br /&gt;
u.	xor e.g. ($x == 2 xor $y == 3) , evaluates to true if either $x equals 2 or $y equals 3 but not both&lt;br /&gt;
v.	++  e.g. $x++, increments $x&lt;br /&gt;
w.	–-  e.g. $x--, decrements $x&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Defining array Structures ====&lt;br /&gt;
&#039;&#039;&#039;Ways of declaring arrays&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;br&amp;gt; Suppose we want many variables, we could have done in the way declaring variables as above, however, that is not elegant, for suppose u want a 100 variables; declaring arrays come to the rescue. Note that index in PHP starts from 0.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$my_guitar_heroes = array (&amp;quot;Hendrix&amp;quot;, &amp;quot;Schenker&amp;quot;, &amp;quot;Gilmour&amp;quot;, &amp;quot;to_name_a_few!&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$my_guitar_heroes [] = &amp;quot;Hendrix&amp;quot;;&lt;br /&gt;
$my_guitar_heroes [] = &amp;quot;Schenker&amp;quot;;&lt;br /&gt;
$my_guitar_heroes [] = &amp;quot;Gilmour&amp;quot;;&lt;br /&gt;
$my_guitar_heroes [] = &amp;quot;to_name_a_few!&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here PHP automatically assigns the index.&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$my_guitar_heroes [0] = &amp;quot;Hendrix&amp;quot;;&lt;br /&gt;
$my_guitar_heroes [10000] = &amp;quot;Mainak&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here in I just knew the first element and the 10,001st element and that&#039;s me!&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
a combination of the above means&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Set the elements at positions 1 through 9999 to the value, &amp;quot;to be decided&amp;quot;.&lt;br /&gt;
$my_guitar_heroes  = array_fill( 1, 9999, &amp;quot;to be decided&amp;quot; ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Accessing the arrays&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
print $my_guitar_heroes[2]; //Access the 2nd element&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Access the last element (Note that the element positions are numbered zero to &lt;br /&gt;
// [number of elements] minus one.)&lt;br /&gt;
$my_guitar_heroes[count($my_guitar_heroes)-1]; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Access the last element using a function call.&lt;br /&gt;
end($my_guitar_heroes); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Iterating over the element of an array&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
foreach ( $my_guitar_heroes as $temp) {&lt;br /&gt;
  print &amp;quot;$temp&amp;lt;br /&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Control expressions ====&lt;br /&gt;
To execute a statement of collection of statements over and over, we use Control expressions. The  following are general syntax of the control structures&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;if statements&#039;&#039;&#039;&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if( $x &amp;gt; 0) {	&lt;br /&gt;
 print(&amp;quot;$x is positive&amp;quot;);&lt;br /&gt;
}  else if( $x &amp;lt; 0 ) {	&lt;br /&gt;
 print(&amp;quot;$x is negative&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
 print(&amp;quot;$x is 0&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;for loop&#039;&#039;&#039;&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
for ( $x=1; $x&amp;lt;= 10; $x++ ) {&lt;br /&gt;
 print &amp;quot;$x&amp;lt;BR/&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;while loop&#039;&#039;&#039;&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$x = 1&lt;br /&gt;
while ( $x &amp;lt;= 10 ) {&lt;br /&gt;
 print &amp;quot;$x&amp;lt;BR/&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;do while loop&#039;&#039;&#039;&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$x = 1;&lt;br /&gt;
do {&lt;br /&gt;
 print &amp;quot;$x&amp;lt;BR/&amp;gt;&amp;quot;;&lt;br /&gt;
 $x++;&lt;br /&gt;
}while($x &amp;lt;= 10);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Defining functions ====&lt;br /&gt;
Code which is duplicated at many places are best placed in a function. Following are the ways of describing the function.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function name_of_the_function( $arguments, $size=&#039;default_values_if_any&#039; ) {&lt;br /&gt;
  print &amp;quot;here goes in the code&amp;quot;; &lt;br /&gt;
  return &amp;quot;this value is returned, return statement is optional&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The arguments are passed by value. If they are to be passed by reference then an argument is prefixed by &amp;quot;&amp;amp;&amp;quot; as below&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function name_of_the_function( &amp;amp;$arguments, $size=&#039;default_values_if_any&#039; ) {&lt;br /&gt;
  print &amp;quot;here goes in the code&amp;quot;; &lt;br /&gt;
  return &amp;quot;this value is returned, return statement is optional&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Scope of a variables defined within a function is valid within the function only. &lt;br /&gt;
&lt;br /&gt;
Calling a function&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$x = add(5, 3);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Debugging ====&lt;br /&gt;
&#039;&#039;&#039;Basic printing options&#039;&#039;&#039; &amp;lt;br/&amp;gt;&lt;br /&gt;
A basic way to debug is to print the value of the variable. The following basic statments acheives that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;echo &amp;quot;if double quotes are used then dollar variables are resolved&amp;quot;;&lt;br /&gt;
&amp;lt;li&amp;gt;echo &#039;if single quote are used then dollar variables are not resolved&#039;;&lt;br /&gt;
&amp;lt;li&amp;gt;print &amp;quot;another way to print&amp;quot;;&lt;br /&gt;
&amp;lt;li&amp;gt;nl2br(&amp;quot;any new line characters like \n get automatically resolved to HTML line breaks&amp;quot;);&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from these the log files are very helpful and can be found in the WAMP_HOME/logs directory.&lt;br /&gt;
&lt;br /&gt;
==== Handling forms ====&lt;br /&gt;
PHP does not change any HTML structure, thus any syntax of HTML remains the same. The part that PHP plays is making any part dynamic for e.g the action attribute of a form can be coded as action=&amp;lt;?php my_own_action(); ?&amp;gt; so that it is dynamically generated. The part where PHP kicks in is after the form is submitted, to say obtain the values of the form fields, set cookies etc. For this super global variables are used which are always available to PHP code. Some of these are  &lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_GET - get the data from a GET request&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_POST - get the data from a POST request&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_REQUEST - get the request&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_COOKIE - obtain the cookies from the browser&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;$_SESSION - obtain the session&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of these are arrays and behave accordingly.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:Templates]]&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Horizontal_centering&amp;diff=21866</id>
		<title>Horizontal centering</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Horizontal_centering&amp;diff=21866"/>
		<updated>2010-02-24T17:56:13Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Horizontal centering is achieved with CSS in one of two ways, depending on what you are centering.&lt;br /&gt;
&lt;br /&gt;
For the first example, let&#039;s say you have a horizontal menu at the top of your page that you want centered in your layout. You would do it with a block of code in the linked CSS file like this:&lt;br /&gt;
&lt;br /&gt;
 #horz_menu {margin: auto; width: 800px; height: 25px; }&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;auto&amp;quot; value in the &amp;quot;margin&amp;quot; attribute centers the item, so this would create a menu area that is 800 pixels wide and 25 pixels tall and would be centered in whatever space it is placed in.&lt;br /&gt;
&lt;br /&gt;
If you need to add some margin space above and below the menu and still keep it centered you would adjust the code like this:&lt;br /&gt;
&lt;br /&gt;
 #horz_menu { margin: 20px auto 20px auto; width: 800px; height: 25px; }&lt;br /&gt;
&lt;br /&gt;
This would add 20 pixles of space on the top and bottom of the menu while keeping the left and right margin in a centered mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second example is when you simply want to center text, in which case you just add the &amp;quot;text-align&amp;quot; code.&lt;br /&gt;
&lt;br /&gt;
 #horz_menu a { padding: .75em 0 .52em 0; font-size: 0.8em; font-weight: bold; color: #0033CC; background-color: transparent; text-align: center; }&lt;br /&gt;
&lt;br /&gt;
This would cause any links within the horz_menu div tag of the html code to be centered in the horizontal menu. They would also have .75em of padding above and .52em of padding below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These same techniques work for the overall page layout as well. Let&#039;s say you want the shell content area of your page to be 900 pixels wide and to be centered on the page and that you want the headline to be centered within it. Your CSS code would look something like this:&lt;br /&gt;
&lt;br /&gt;
 #page_container {margin: auto; width: 900px; background-color: #FFFFFF; border: 1pt solid #660000; }&lt;br /&gt;
&lt;br /&gt;
 #page_container h1 {margin: 50px 0 20px 0 ; font-size: 1.25em; font-weight: bold; color: #0033CC; background-color: transparent; text-align: center; }&lt;br /&gt;
&lt;br /&gt;
This would create a page that has a main content box centered in the browser window with a white background and a brown border.&lt;br /&gt;
&lt;br /&gt;
Any text inside a h1 tag that is inside the page_container div tag in the html code of the page would also be centered inside that main content box.&lt;br /&gt;
&lt;br /&gt;
Of course the example above is a simplified example for demonstration and you would have more structure involved (left column, right column, etc).&lt;br /&gt;
&lt;br /&gt;
So as you can see, horizontal centering for structural items is achieved with the &amp;quot;margin&amp;quot; attribute whereas horizontal centering for text items is achieved using the &amp;quot;text-align&amp;quot; attribute.&lt;br /&gt;
&lt;br /&gt;
--[[User:Daganray|daganray]] 09:54, 15 November 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21865</id>
		<title>More advanced Joomla! templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21865"/>
		<updated>2010-02-24T17:55:07Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Added Level 4 Subheadings to All the importated template articles&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====  Quirks mode and how to avoid it ====&lt;br /&gt;
{{:Quirks mode and how to avoid it|Quirks mode and how to avoid it}}&lt;br /&gt;
==== Which DocType header to use ====&lt;br /&gt;
{{:Which DocType header to use|Which DocType header to use}}&lt;br /&gt;
====Setting up page width====&lt;br /&gt;
{{:Setting up page width|Setting up page width}}&lt;br /&gt;
====About CSS page layouts====&lt;br /&gt;
{{:About CSS page layouts|About CSS page layouts}}&lt;br /&gt;
====Source Ordering====&lt;br /&gt;
{{:Source ordering|Source ordering}}&lt;br /&gt;
====Horizontal Centering====&lt;br /&gt;
{{:Horizontal centering|Horizontal centering}}&lt;br /&gt;
====PHP Essentials====&lt;br /&gt;
{{:PHP essentials|PHP essentials}} (eg. echo, if-then-else)&lt;br /&gt;
====Adding Images====&lt;br /&gt;
{{:Adding images|Adding images}}&lt;br /&gt;
====Declaring Module Positions====&lt;br /&gt;
{{:Declaring module positions|Declaring module positions}}&lt;br /&gt;
====Finding module positions on any given page====&lt;br /&gt;
{{:Finding module positions on any given page|Finding module positions on any given page}}&lt;br /&gt;
====Changing the site favicon====&lt;br /&gt;
{{:Changing the site favicon|Changing the site favicon}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21863</id>
		<title>More advanced Joomla! templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21863"/>
		<updated>2010-02-24T17:51:10Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====  Quirks mode and how to avoid it ====&lt;br /&gt;
{{:Quirks mode and how to avoid it|Quirks mode and how to avoid it}}&lt;br /&gt;
==== Which DocType header to use ====&lt;br /&gt;
{{:Which DocType header to use|Which DocType header to use}}&lt;br /&gt;
&lt;br /&gt;
{{:Setting up page width|Setting up page width}}&lt;br /&gt;
&lt;br /&gt;
{{:About CSS page layouts|About CSS page layouts}}&lt;br /&gt;
&lt;br /&gt;
{{:Source ordering|Source ordering}}&lt;br /&gt;
&lt;br /&gt;
{{:Horizontal centering|Horizontal centering}}&lt;br /&gt;
&lt;br /&gt;
{{:PHP essentials|PHP essentials}} (eg. echo, if-then-else)&lt;br /&gt;
&lt;br /&gt;
{{:Adding images|Adding images}}&lt;br /&gt;
&lt;br /&gt;
{{:Declaring module positions|Declaring module positions}}&lt;br /&gt;
&lt;br /&gt;
{{:Finding module positions on any given page|Finding module positions on any given page}}&lt;br /&gt;
&lt;br /&gt;
{{:Changing the site favicon|Changing the site favicon}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=DocType_header_for_templates&amp;diff=21862</id>
		<title>DocType header for templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=DocType_header_for_templates&amp;diff=21862"/>
		<updated>2010-02-24T17:50:48Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Removed subheading - redundant&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Current thinking is that XHTML 1.0 Transitional should be used for Joomla! templates.&lt;br /&gt;
&lt;br /&gt;
{{:Recommended DocTypes|}}&lt;br /&gt;
&lt;br /&gt;
{{:References about DocTypes|}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:Topics]]&lt;br /&gt;
[[Category:HTML|DocType]]&lt;br /&gt;
[[Category:Template FAQ]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21861</id>
		<title>More advanced Joomla! templates</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=More_advanced_Joomla!_templates&amp;diff=21861"/>
		<updated>2010-02-24T17:49:37Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Added Level 4 heading for Quirks Mode article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====  Quirks mode and how to avoid it ====&lt;br /&gt;
{{:Quirks mode and how to avoid it|Quirks mode and how to avoid it}}&lt;br /&gt;
&lt;br /&gt;
{{:Which DocType header to use|Which DocType header to use}}&lt;br /&gt;
&lt;br /&gt;
{{:Setting up page width|Setting up page width}}&lt;br /&gt;
&lt;br /&gt;
{{:About CSS page layouts|About CSS page layouts}}&lt;br /&gt;
&lt;br /&gt;
{{:Source ordering|Source ordering}}&lt;br /&gt;
&lt;br /&gt;
{{:Horizontal centering|Horizontal centering}}&lt;br /&gt;
&lt;br /&gt;
{{:PHP essentials|PHP essentials}} (eg. echo, if-then-else)&lt;br /&gt;
&lt;br /&gt;
{{:Adding images|Adding images}}&lt;br /&gt;
&lt;br /&gt;
{{:Declaring module positions|Declaring module positions}}&lt;br /&gt;
&lt;br /&gt;
{{:Finding module positions on any given page|Finding module positions on any given page}}&lt;br /&gt;
&lt;br /&gt;
{{:Changing the site favicon|Changing the site favicon}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Finding_module_positions_on_any_given_page&amp;diff=21858</id>
		<title>Finding module positions on any given page</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Finding_module_positions_on_any_given_page&amp;diff=21858"/>
		<updated>2010-02-24T17:33:59Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Finding module positions on any given page ==&lt;br /&gt;
&lt;br /&gt;
To get a visual indication of all module positions used on a page you can follow this procedure:-&lt;br /&gt;
&lt;br /&gt;
* navigate to the page in your web browser.&lt;br /&gt;
* click into the URL field in your browser.&lt;br /&gt;
* look for any &amp;quot;parameters&amp;quot; at the end of the URL. These are separated from the main part of the URL by a question mark.  For example, in the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://mydomain.com/index.php?id=17&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, the &amp;quot;id=17&amp;quot; is a parameter.&lt;br /&gt;
* if there are no parameters, append &amp;quot;?tp=1&amp;quot; to the URL and press RETURN.  For example, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://mydomain.com/index.php?tp=1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* if there are already parameters in the URL, append &amp;quot;&amp;amp;tp=1&amp;quot; to the URL and press RETURN.  For example, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://mydomain.com/index.php?id=17&amp;amp;tp=1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* the module positions will be outlined in red.&lt;br /&gt;
&lt;br /&gt;
Note that in some circumstances there may be module positions available that are not outlined in red. This can happen when a template defines those module positions as conditional on there being modules enabled in that position. If there are no modules enabled in that position then the template may adapt and the position will not be visible.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Modules]][[Category:Procedures]][[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_images&amp;diff=21857</id>
		<title>Adding images</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_images&amp;diff=21857"/>
		<updated>2010-02-24T17:32:51Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Added subtitle&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Adding Images====&lt;br /&gt;
* Upload Using Media Manager&lt;br /&gt;
The simplest way to add images is to upload them from your computer using the Media Manager.  First, of course, you have to download the image onto your computer and be able to find it.  Then, from the Control Panel (back-end administrative interface) navigate to Site -&amp;gt; Media Manager.&lt;br /&gt;
&lt;br /&gt;
On the left is a directory tree, with the root directory &amp;quot;Media&amp;quot;.  This corresponds to the default &amp;quot;images&amp;quot; directory, yoursite/joomla/images. Pick a subdirectory where you want the image located, or else do nothing to upload the image to the default images directory.&lt;br /&gt;
&lt;br /&gt;
At the bottom of the page is a typical Upload box.  Click &amp;quot;Browse&amp;quot; to locate the image on your computer, then &amp;quot;Upload&amp;quot; to upload the file to the server. &lt;br /&gt;
&lt;br /&gt;
* FTP&lt;br /&gt;
&lt;br /&gt;
Of course, you can upload images to a server using any standard FTP client.  You might find this handier for adding images to template directories; however, if you have FTP set up, you probably don&#039;t need an explanation of how to add an image.  Also, many server administration panels such as Cpanel and Plesk have upload capabilities.&lt;br /&gt;
&lt;br /&gt;
* Extensions&lt;br /&gt;
&lt;br /&gt;
There are several extensions, available from the Joomla extensions section, that handle image uploads.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Administration FAQ]]&lt;br /&gt;
[[Category:Getting Started FAQ]]&lt;br /&gt;
[[Category:Version 1.5 FAQ]]&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Changing_the_site_favicon&amp;diff=21855</id>
		<title>Changing the site favicon</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Changing_the_site_favicon&amp;diff=21855"/>
		<updated>2010-02-24T17:29:48Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Added subtitle to page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Changing the Site Favicon====&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Create a 16x16 pixel image.&#039;&#039;&#039;  You may use graphic software such as [[wikipedia:Photoshop|Photoshop]], [[wikipedia:Gimp|Gimp]] or [[wikipedia:Windows_Paint|Windows Paint]] or an online tool such as http://antifavicon.com/&lt;br /&gt;
# &#039;&#039;&#039;Convert to ico format&#039;&#039;&#039; using free online sites such as:&lt;br /&gt;
#* http://converticon.com/&lt;br /&gt;
#* http://www.favicongenerator.com/&lt;br /&gt;
#* http://www.htmlkit.com/services/favicon/&lt;br /&gt;
#* http://tools.dynamicdrive.com/favicon/&lt;br /&gt;
#* http://www.favicon.cc/&lt;br /&gt;
# The file you created in this way will have the extension .ico. &#039;&#039;&#039;Copy the file&#039;&#039;&#039; to the /joomla/templates/&amp;lt;your template&amp;gt; directory and &#039;&#039;&#039;name it&#039;&#039;&#039; favicon.ico.&lt;br /&gt;
# Open a browser. Do you see your new icon? If so, congratulations. If not, that doesn&#039;t necessarily mean you did anything wrong. Browsers are designed to minimize data traffic, so they don&#039;t refresh the favicon every time they show a page. Even refreshing the page (F5) wont help. So you need to refresh more thoroughly:&lt;br /&gt;
#* &#039;&#039;Mozilla / Firefox / Safari&#039;&#039;: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac);&lt;br /&gt;
#* &#039;&#039;IE&#039;&#039;: hold Ctrl while clicking Refresh, or press Ctrl-F5;&lt;br /&gt;
#* &#039;&#039;Konqueror&#039;&#039;: simply click the Reload button, or press F5;&lt;br /&gt;
#* &#039;&#039;Opera&#039;&#039; users may need to completely clear their cache in Tools→Preferences.&lt;br /&gt;
If this doesn&#039;t work you will need to delete the temporary internet files and the history and then open your page again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some templates contain code that redirects the browser to another directory or another icon file. To determine where your new favicon should be, examine http://yoursite.com/templates/your_template/index.php and look for code that contains the text &amp;lt;link rel=&amp;quot;shortcut icon&amp;quot;. There you will find the directory and the name of the icon file. Copy your icon to that place and give it the the name that link is pointing to (you might want to backup the old file). Make sure you set the security correctly such that you webserver has access to that file. Look at the example below. &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;http://yoursite.com/templates/your_template/icon/favicon.ico&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to just change the &#039;&#039;&#039;favicon.ico&#039;&#039;&#039; file in its respective template directory you can find the reference to the &#039;&#039;&#039;favicon.ico&#039;&#039;&#039; file in the &#039;&#039;&#039;html.php&#039;&#039;&#039; document. The path is &#039;&#039;&#039;&amp;quot;........\libraries\joomla\document\html\html.php&amp;quot;&#039;&#039;&#039;. This should prevent the icon from toggling if you use &lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;http://yoursite.com/templates/your_template/icon/youricon.ico&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
in the template html and you don&#039;t remove the favicon.ico file. (why call the icon twice?)&lt;br /&gt;
&lt;br /&gt;
From the html.php &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Try to find a favicon by checking the template and root folder&lt;br /&gt;
		$path = $directory . DS;&lt;br /&gt;
		$dirs = array( $path, JPATH_BASE . DS );&lt;br /&gt;
		foreach ($dirs as $dir )&lt;br /&gt;
		{&lt;br /&gt;
			$icon =   $dir . &#039;favicon.ico&#039;;&lt;br /&gt;
			if (file_exists( $icon ))&lt;br /&gt;
			{&lt;br /&gt;
				$path = str_replace( JPATH_BASE . DS, &#039;&#039;, $dir );&lt;br /&gt;
				$path = str_replace( &#039;\\&#039;, &#039;/&#039;, $path );&lt;br /&gt;
				$this-&amp;gt;addFavicon( JURI::base(true).&#039;/&#039;.$path . &#039;favicon.ico&#039; );&lt;br /&gt;
				break;&#039;&#039;&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Changing_the_site_favicon&amp;diff=21854</id>
		<title>Changing the site favicon</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Changing_the_site_favicon&amp;diff=21854"/>
		<updated>2010-02-24T17:25:37Z</updated>

		<summary type="html">&lt;p&gt;Arcturusweb: Added &amp;lt;noinclude&amp;gt; tags to bottom of page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;# &#039;&#039;&#039;Create a 16x16 pixel image.&#039;&#039;&#039;  You may use graphic software such as [[wikipedia:Photoshop|Photoshop]], [[wikipedia:Gimp|Gimp]] or [[wikipedia:Windows_Paint|Windows Paint]] or an online tool such as http://antifavicon.com/&lt;br /&gt;
# &#039;&#039;&#039;Convert to ico format&#039;&#039;&#039; using free online sites such as:&lt;br /&gt;
#* http://converticon.com/&lt;br /&gt;
#* http://www.favicongenerator.com/&lt;br /&gt;
#* http://www.htmlkit.com/services/favicon/&lt;br /&gt;
#* http://tools.dynamicdrive.com/favicon/&lt;br /&gt;
#* http://www.favicon.cc/&lt;br /&gt;
# The file you created in this way will have the extension .ico. &#039;&#039;&#039;Copy the file&#039;&#039;&#039; to the /joomla/templates/&amp;lt;your template&amp;gt; directory and &#039;&#039;&#039;name it&#039;&#039;&#039; favicon.ico.&lt;br /&gt;
# Open a browser. Do you see your new icon? If so, congratulations. If not, that doesn&#039;t necessarily mean you did anything wrong. Browsers are designed to minimize data traffic, so they don&#039;t refresh the favicon every time they show a page. Even refreshing the page (F5) wont help. So you need to refresh more thoroughly:&lt;br /&gt;
#* &#039;&#039;Mozilla / Firefox / Safari&#039;&#039;: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac);&lt;br /&gt;
#* &#039;&#039;IE&#039;&#039;: hold Ctrl while clicking Refresh, or press Ctrl-F5;&lt;br /&gt;
#* &#039;&#039;Konqueror&#039;&#039;: simply click the Reload button, or press F5;&lt;br /&gt;
#* &#039;&#039;Opera&#039;&#039; users may need to completely clear their cache in Tools→Preferences.&lt;br /&gt;
If this doesn&#039;t work you will need to delete the temporary internet files and the history and then open your page again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some templates contain code that redirects the browser to another directory or another icon file. To determine where your new favicon should be, examine http://yoursite.com/templates/your_template/index.php and look for code that contains the text &amp;lt;link rel=&amp;quot;shortcut icon&amp;quot;. There you will find the directory and the name of the icon file. Copy your icon to that place and give it the the name that link is pointing to (you might want to backup the old file). Make sure you set the security correctly such that you webserver has access to that file. Look at the example below. &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;http://yoursite.com/templates/your_template/icon/favicon.ico&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to just change the &#039;&#039;&#039;favicon.ico&#039;&#039;&#039; file in its respective template directory you can find the reference to the &#039;&#039;&#039;favicon.ico&#039;&#039;&#039; file in the &#039;&#039;&#039;html.php&#039;&#039;&#039; document. The path is &#039;&#039;&#039;&amp;quot;........\libraries\joomla\document\html\html.php&amp;quot;&#039;&#039;&#039;. This should prevent the icon from toggling if you use &lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;http://yoursite.com/templates/your_template/icon/youricon.ico&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
in the template html and you don&#039;t remove the favicon.ico file. (why call the icon twice?)&lt;br /&gt;
&lt;br /&gt;
From the html.php &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Try to find a favicon by checking the template and root folder&lt;br /&gt;
		$path = $directory . DS;&lt;br /&gt;
		$dirs = array( $path, JPATH_BASE . DS );&lt;br /&gt;
		foreach ($dirs as $dir )&lt;br /&gt;
		{&lt;br /&gt;
			$icon =   $dir . &#039;favicon.ico&#039;;&lt;br /&gt;
			if (file_exists( $icon ))&lt;br /&gt;
			{&lt;br /&gt;
				$path = str_replace( JPATH_BASE . DS, &#039;&#039;, $dir );&lt;br /&gt;
				$path = str_replace( &#039;\\&#039;, &#039;/&#039;, $path );&lt;br /&gt;
				$this-&amp;gt;addFavicon( JURI::base(true).&#039;/&#039;.$path . &#039;favicon.ico&#039; );&lt;br /&gt;
				break;&#039;&#039;&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arcturusweb</name></author>
	</entry>
</feed>