<?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=Intertron</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=Intertron"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Intertron"/>
	<updated>2026-06-13T02:06:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Help25:Components_Redirect_Manager&amp;diff=99839</id>
		<title>Help25:Components Redirect Manager</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Help25:Components_Redirect_Manager&amp;diff=99839"/>
		<updated>2013-06-03T14:17:55Z</updated>

		<summary type="html">&lt;p&gt;Intertron: /* Column Headers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Help screens 2.5 navbox|2.5|Components Help Screens}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
The Redirect Manager is a component that is accessed from the back-end of a Joomla! website. Its main function is to provide a mechanism to give an Administrator the ability to redirect the URL of a web page which no longer exists to a working web page. You must have the &#039;&#039;Use Apache mod_rewrite&#039;&#039; option enabled in your Joomla! installation &#039;&#039;Global Configuration&#039;&#039; options in order for the redirects you create to function.&lt;br /&gt;
&lt;br /&gt;
==How to access==&lt;br /&gt;
* Select &#039;&#039;&#039;Components &amp;amp;rarr; Redirect&#039;&#039;&#039; from the drop-down menu of the &#039;&#039;&#039;&#039;&#039;Joomla! Administrator Panel&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This component is primarily used for redirecting URLs for web pages that no longer exist on your website to web pages that are working. The URL you want to redirect from must not be a working one on your website which actually loads a web page. It can be the URL to a web page which you have disabled in the Joomla! back-end administrator interface. The &#039;&#039;Source URL&#039;&#039; you specify when you create the redirect should be the full URL as you would type it in your web browser. The component will only display the last portion of the source URL in the redirect listing. The &#039;&#039;Destination URL&#039;&#039; you specify when you create a redirect must be the full URL as well. To work the component requires the redirect plugin to be active.&lt;br /&gt;
&lt;br /&gt;
==Screenshot==&lt;br /&gt;
[[Image:Help25-components-redirect_manager-screen.png]]&lt;br /&gt;
&lt;br /&gt;
==Column Headers==&lt;br /&gt;
Click on the column heading to sort the list by that column&#039;s value.&lt;br /&gt;
{{Chunk25:colheader|Checkbox}}&lt;br /&gt;
*&#039;&#039;&#039;Expired URL.&#039;&#039;&#039; The URL which is being redirected on your website. Only the web page portion of the URL is displayed in this listing.&lt;br /&gt;
*&#039;&#039;&#039;New URL.&#039;&#039;&#039; The destination URL for the redirect.&lt;br /&gt;
*&#039;&#039;&#039;Referring Page.&#039;&#039;&#039; The referring web page for the redirect.&lt;br /&gt;
{{Chunk25:colheader|CreatedDate}}&lt;br /&gt;
{{Chunk25:colheader|Enabled}}&lt;br /&gt;
*&#039;&#039;&#039;404 Hits.&#039;&#039;&#039; The number of times this page was requested and not being forwarded. Sorting on this column helps to find old links from external websites (or even internal old links).&lt;br /&gt;
{{Chunk25:colheader|Id}}&lt;br /&gt;
&lt;br /&gt;
==List Filters==&lt;br /&gt;
====Filter by Partial Title====&lt;br /&gt;
You can filter the list of items by typing part of the redirect&#039;s name or the ID number of the redirect.&lt;br /&gt;
[[Image:help25-banners-manage-filter-name.png]]&lt;br /&gt;
&lt;br /&gt;
====Filter by State====&lt;br /&gt;
In the upper right area, above the column headings, there is one drop-down list box as shown below:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help25-components-redirect_manager-filter-attributes.png]]&lt;br /&gt;
&lt;br /&gt;
Only items matching the selection will be displayed in the list.&lt;br /&gt;
{{Chunk25:colheader|State}}&lt;br /&gt;
&lt;br /&gt;
====Number of Items to Display====&lt;br /&gt;
Below the list you&#039;ll find:&lt;br /&gt;
{{Chunk25:colheader|Manager Pagination}}&lt;br /&gt;
&lt;br /&gt;
==Batch Processing==&lt;br /&gt;
Below the listing of redirects, is a section named &#039;Update selected links to the following new URL&#039;. This function allows you to change the &#039;Destination URL&#039; for the selected redirects.&lt;br /&gt;
&lt;br /&gt;
[[Image:Help25-components-redirect_manager-batch_update.png|center]]&lt;br /&gt;
*&#039;&#039;&#039;Destination URL.&#039;&#039;&#039; The destination URL to set for the selected redirects.&lt;br /&gt;
*&#039;&#039;&#039;Comment.&#039;&#039;&#039; The comment to set for the selected redirects.&lt;br /&gt;
*&#039;&#039;&#039;Update Links.&#039;&#039;&#039; Updates all selected redirects with the specified &#039;&#039;Destination URL&#039;&#039; and &#039;&#039;Comment&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Toolbar==&lt;br /&gt;
At the top right you will see the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help25-Toolbar-New-Edit-Enable-Disable-Archive-Trash-Options-Help.png]]&lt;br /&gt;
&lt;br /&gt;
The functions are:&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_New|redirect}}&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_Edit|redirect}}&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_Enable|redirects}}&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_Disable|redirects}}&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_Archive|redirects}}&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_Trash|redirects}}&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_Options}}&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_Help}}&lt;br /&gt;
&lt;br /&gt;
==Options==&lt;br /&gt;
Click the Options button to open the &#039;&#039;&#039;Redirect Manager Options&#039;&#039;&#039; window which lets you configure this component.&lt;br /&gt;
&lt;br /&gt;
===Buttons Common to All Tabs===&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_Save|redirect manager options}}&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_SaveAndClose|redirect manager options}}&lt;br /&gt;
{{Chunk25:Help_screen_toolbar_icon_Cancel}}&lt;br /&gt;
&lt;br /&gt;
===Permissions Tab===&lt;br /&gt;
{{Chunk25:Help_screen_component_options_permissions_intro}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Help25-components-redirect_manager-options-permissions.png|center]]&lt;br /&gt;
&lt;br /&gt;
{{Chunk25:Help_screen_component_options_permissions_columns_intro}}&lt;br /&gt;
&lt;br /&gt;
{{Chunk25:Help_screen_component_options_permissions_columns_options|redirect manager component}}&lt;br /&gt;
{{Chunk25:Help_screen_component_options_permissions_columns_admin|redirect manager component}}&lt;br /&gt;
{{Chunk25:Help_screen_component_options_permissions_columns_create|redirects|component}}&lt;br /&gt;
{{Chunk25:Help_screen_component_options_permissions_columns_delete|redirects|component}}&lt;br /&gt;
{{Chunk25:Help_screen_component_options_permissions_columns_edit|redirects|component}}&lt;br /&gt;
{{Chunk25:Help_screen_component_options_permissions_columns_edit_state|redirects|component}}&lt;br /&gt;
&lt;br /&gt;
{{Chunk25:Help_screen_component_options_permissions_conclusion}}&lt;br /&gt;
&lt;br /&gt;
==Quick Tips==&lt;br /&gt;
* In order for your redirects to work, you must enable the option &#039;&#039;&#039;Use Apache mod_rewrite&#039;&#039;&#039; in the &#039;&#039;&#039;Global Configuration&#039;&#039;&#039; options of your Joomla! installation. Note also that just enabling the &#039;Use Apache mod_rewrite&#039; option is not enough. You must take the additional step of renaming the &#039;&#039;htaccess.txt&#039;&#039; file in the web site directory where you installed Joomla! to &#039;&#039;.htaccess&#039;&#039; or to whatever file name your Apache web server requires for additional configuration directives. In the Apache configuration file this setting is named &#039;AccessFileName&#039; and by default this is set to &#039;.htaccess&#039;&lt;br /&gt;
&lt;br /&gt;
==Related information==&lt;br /&gt;
*To create/edit a redirect: [[Help25:Components_Redirect_Manager_Edit|Redirect Manager: Link - Create/Edit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{cathelp|2.5|Components Help Screens}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Intertron&amp;diff=99838</id>
		<title>User:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Intertron&amp;diff=99838"/>
		<updated>2013-06-03T14:15:29Z</updated>

		<summary type="html">&lt;p&gt;Intertron: /* Intertron */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intertron ==&lt;br /&gt;
[http://www.intertron.nl Intertron] is my old company name under which I am known on the Joomla! wiki and forum.&amp;lt;br&amp;gt;&lt;br /&gt;
I have merged with another company and we are now called [http://www.onpole.nl OnPole]&lt;br /&gt;
&lt;br /&gt;
My real name is Ronald Pijpers, I am a developer and you can contact me at: rpijpers@onpole.nl&amp;lt;br&amp;gt;&lt;br /&gt;
You can contact me in Dutch or English.&lt;br /&gt;
&lt;br /&gt;
I made some small contributions to the Joomla Core:&lt;br /&gt;
* Helped with rewriting the backend components to the proper MVC structure for Joomla 1.6&lt;br /&gt;
* Added the &#039;404 hits&#039; column to the redirect manager&lt;br /&gt;
I am a (not so active) member of the Joomla Bug Squad.&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Fatal_error:_Call_to_undefined_method_JInstaller::parseXMLInstallFile()&amp;diff=67741</id>
		<title>Fatal error: Call to undefined method JInstaller::parseXMLInstallFile()</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Fatal_error:_Call_to_undefined_method_JInstaller::parseXMLInstallFile()&amp;diff=67741"/>
		<updated>2012-06-19T11:17:29Z</updated>

		<summary type="html">&lt;p&gt;Intertron: Created page with &amp;quot;See [http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=28698| this tracker item].  Category:Version 2.5 FAQ Category:Version 2.5.5 FAQ&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See [http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=28698| this tracker item].&lt;br /&gt;
&lt;br /&gt;
[[Category:Version 2.5 FAQ]]&lt;br /&gt;
[[Category:Version 2.5.5 FAQ]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=67740</id>
		<title>User talk:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=67740"/>
		<updated>2012-06-19T11:16:22Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can contact me in Dutch or English&lt;br /&gt;
&lt;br /&gt;
[[Disappearing articles after 2.5 upgrade]]&lt;br /&gt;
&lt;br /&gt;
[[Please first make a selection from the list]]&lt;br /&gt;
&lt;br /&gt;
[[Fatal error: Using $this when not in object context in /libraries/joomla/application/base.php on line 87]]&lt;br /&gt;
&lt;br /&gt;
[[Missing Save buttons on editing an article]]&lt;br /&gt;
&lt;br /&gt;
[[Fatal error: Call to undefined method JInstaller::parseXMLInstallFile()]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=67739</id>
		<title>User talk:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=67739"/>
		<updated>2012-06-19T11:15:44Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can contact me in Dutch or English&lt;br /&gt;
&lt;br /&gt;
[[Disappearing articles after 2.5 upgrade]]&lt;br /&gt;
&lt;br /&gt;
[[Please first make a selection from the list]]&lt;br /&gt;
&lt;br /&gt;
[[Fatal error: Using $this when not in object context in /libraries/joomla/application/base.php on line 87]]&lt;br /&gt;
&lt;br /&gt;
[[Missing Save buttons on editing an article]]&lt;br /&gt;
&lt;br /&gt;
[[Fatal error: Call to undefined method JInstaller::parseXMLInstallFile(]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Missing_Save_buttons_on_editing_an_article&amp;diff=67737</id>
		<title>Missing Save buttons on editing an article</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Missing_Save_buttons_on_editing_an_article&amp;diff=67737"/>
		<updated>2012-06-19T10:16:08Z</updated>

		<summary type="html">&lt;p&gt;Intertron: Created page with &amp;quot;When trying to edit an article there are missing buttons  *Save &amp;amp; New *Save as Copy See [[http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When trying to edit an article there are missing buttons &lt;br /&gt;
*Save &amp;amp; New&lt;br /&gt;
*Save as Copy&lt;br /&gt;
See [[http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=28685| this tracker item]], including the patch.&lt;br /&gt;
&lt;br /&gt;
[[Category:Version 2.5 FAQ]]&lt;br /&gt;
[[Category:Version 2.5.5 FAQ]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=67736</id>
		<title>User talk:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=67736"/>
		<updated>2012-06-19T09:36:53Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can contact me in Dutch or English&lt;br /&gt;
&lt;br /&gt;
[[Disappearing articles after 2.5 upgrade]]&lt;br /&gt;
&lt;br /&gt;
[[Please first make a selection from the list]]&lt;br /&gt;
&lt;br /&gt;
[[Fatal error: Using $this when not in object context in /libraries/joomla/application/base.php on line 87]]&lt;br /&gt;
&lt;br /&gt;
[[Missing Save buttons on editing an article]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Fatal_error:_Using_$this_when_not_in_object_context_in_/libraries/joomla/application/base.php_on_line_87&amp;diff=67718</id>
		<title>Fatal error: Using $this when not in object context in /libraries/joomla/application/base.php on line 87</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Fatal_error:_Using_$this_when_not_in_object_context_in_/libraries/joomla/application/base.php_on_line_87&amp;diff=67718"/>
		<updated>2012-06-18T23:04:25Z</updated>

		<summary type="html">&lt;p&gt;Intertron: Created page with &amp;quot;See [http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=28684| this tracker item]. Apply the patch of the tracker item.  [[Category:Version 2...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See [http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=28684| this tracker item]. Apply the patch of the tracker item.&lt;br /&gt;
&lt;br /&gt;
[[Category:Version 2.5 FAQ]]&lt;br /&gt;
[[Category:Version 2.5.5 FAQ]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=67717</id>
		<title>User talk:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=67717"/>
		<updated>2012-06-18T23:00:40Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can contact me in Dutch or English&lt;br /&gt;
&lt;br /&gt;
[[Disappearing articles after 2.5 upgrade]]&lt;br /&gt;
&lt;br /&gt;
[[Please first make a selection from the list]]&lt;br /&gt;
&lt;br /&gt;
[[Fatal error: Using $this when not in object context in /libraries/joomla/application/base.php on line 87]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Joomla_Update_Missing_in_from_Admin_Menu&amp;diff=67716</id>
		<title>Joomla Update Missing in from Admin Menu</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Joomla_Update_Missing_in_from_Admin_Menu&amp;diff=67716"/>
		<updated>2012-06-18T22:58:43Z</updated>

		<summary type="html">&lt;p&gt;Intertron: Added Discover&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Starting with version 2.5.4, the Joomla core is updated with the new component Joomla Update instead of in Extensions/Install/Update.&lt;br /&gt;
&lt;br /&gt;
If Joomla Update does not shows as an installed component use the Discover function to add it as a component.&lt;br /&gt;
&lt;br /&gt;
If Joomla Update shows as an installed component but is not in the Admin Menu under Components, you are missing the entry in the database table #__menu.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`,&lt;br /&gt;
 `parent_id`, `level`, `component_id`, `ordering`, `checked_out`, `checked_out_time`, `browserNav`,&lt;br /&gt;
 `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`)&lt;br /&gt;
VALUES (22, &#039;menu&#039;, &#039;com_joomlaupdate&#039;, &#039;Joomla! Update&#039;, &#039;&#039;, &#039;Joomla! Update&#039;,&lt;br /&gt;
&#039;index.php?option=com_joomlaupdate&#039;, &#039;component&#039;, 0, 1, 1, 28, 0, 0,&lt;br /&gt;
&#039;0000-00-00 00:00:00&#039;, 0, 0, &#039;class:joomlaupdate&#039;, 0, &#039;&#039;, 41, 42, 0, &#039;*&#039;, 1);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace #__menu with the name of your database table. Under VALUES you need to change the id, component_id, lft and rgt to the appropriate values for your system.&lt;br /&gt;
&lt;br /&gt;
[[Category:Version 2.5 FAQ]]&lt;br /&gt;
[[Category:Version 2.5.4 FAQ]]&lt;br /&gt;
[[Category:Version 2.5.5 FAQ]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Please_first_make_a_selection_from_the_list&amp;diff=64538</id>
		<title>Please first make a selection from the list</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Please_first_make_a_selection_from_the_list&amp;diff=64538"/>
		<updated>2012-01-28T16:36:20Z</updated>

		<summary type="html">&lt;p&gt;Intertron: Created page with &amp;quot;A number of third party extension show this message when trying to select an item from the list to perform an action.  This is caused by a change of the platform between Beta1 an...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A number of third party extension show this message when trying to select an item from the list to perform an action.&lt;br /&gt;
&lt;br /&gt;
This is caused by a change of the platform between Beta1 and Beta2 and was not noticed by extension developers in Beta2 and RC releases. This change breaked the backwards compatibility for selecting the items in the list.&lt;br /&gt;
&lt;br /&gt;
==Workaround==&lt;br /&gt;
* Ask the extension developer to release a new version, or&amp;lt;br&amp;gt;&lt;br /&gt;
* Install the plugin from this forum item [http://forum.joomla.org/viewtopic.php?f=625&amp;amp;t=691865]&lt;br /&gt;
&lt;br /&gt;
==Fix==&lt;br /&gt;
A patch has been created to fix the backwards compatibility in 2.5.1&lt;br /&gt;
&lt;br /&gt;
[[Category:Version 2.5 FAQ]]&lt;br /&gt;
[[Category:Version 2.5.0 FAQ]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=64537</id>
		<title>User talk:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=64537"/>
		<updated>2012-01-28T16:24:57Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can contact me in Dutch or English&lt;br /&gt;
&lt;br /&gt;
[[Disappearing articles after 2.5 upgrade]]&lt;br /&gt;
[[Please first make a selection from the list]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Disappearing_articles_after_2.5_upgrade&amp;diff=64512</id>
		<title>J2.5:Disappearing articles after 2.5 upgrade</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Disappearing_articles_after_2.5_upgrade&amp;diff=64512"/>
		<updated>2012-01-27T09:47:17Z</updated>

		<summary type="html">&lt;p&gt;Intertron: Added 2.5 Category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Problem:&lt;br /&gt;
I have just upgraded to 2.5 from 1.7.3 and the only problem I have is that the articles that a specific user wrote are not being published. They still show up in the backend but not in the frontend. Other articles written by other users do show up.&lt;br /&gt;
&lt;br /&gt;
Cause:&lt;br /&gt;
If you have a user linked to a contact that is unpublished, the articles written by this user don&#039;t show up in the front.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
Please check if you have a unpublished contact linked to user that wrote the articles. Also check the trashed contacts for this.&lt;br /&gt;
The solution would be to publish the contact or to completely remove them, so empty the trash.&lt;br /&gt;
&lt;br /&gt;
[[Category:Version 2.5 FAQ]]&lt;br /&gt;
[[Category:Version 2.5.0 FAQ]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Disappearing_articles_after_2.5_upgrade&amp;diff=64511</id>
		<title>J2.5:Disappearing articles after 2.5 upgrade</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Disappearing_articles_after_2.5_upgrade&amp;diff=64511"/>
		<updated>2012-01-27T09:44:30Z</updated>

		<summary type="html">&lt;p&gt;Intertron: Created page with &amp;quot;Problem: I have just upgraded to 2.5 from 1.7.3 and the only problem I have is that the articles that a specific user wrote are not being published. They still show up in the bac...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Problem:&lt;br /&gt;
I have just upgraded to 2.5 from 1.7.3 and the only problem I have is that the articles that a specific user wrote are not being published. They still show up in the backend but not in the frontend. Other articles written by other users do show up.&lt;br /&gt;
&lt;br /&gt;
Cause:&lt;br /&gt;
If you have a user linked to a contact that is unpublished, the articles written by this user don&#039;t show up in the front.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
Please check if you have a unpublished contact linked to user that wrote the articles. Also check the trashed contacts for this.&lt;br /&gt;
The solution would be to publish the contact or to completely remove them, so empty the trash.&lt;br /&gt;
&lt;br /&gt;
[[Category:Version 2.5.0 FAQ]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=64510</id>
		<title>User talk:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=64510"/>
		<updated>2012-01-27T09:41:30Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can contact me in Dutch or English&lt;br /&gt;
&lt;br /&gt;
[[Disappearing articles after 2.5 upgrade]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Why_are_the_articles_in_my_section_blog_ordered_differently%3F&amp;diff=31732</id>
		<title>Why are the articles in my section blog ordered differently?</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Why_are_the_articles_in_my_section_blog_ordered_differently%3F&amp;diff=31732"/>
		<updated>2010-11-05T14:13:37Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a bug in 1.5.22 causing Section Blogs to be ordered differently.&lt;br /&gt;
&lt;br /&gt;
See [http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=23135 this tracker item]&lt;br /&gt;
&lt;br /&gt;
Quick fix: change the file /components/com_content/models/section.php on line 447 from:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$filter_order = &#039;a.ordering&#039;;&amp;lt;/source&amp;gt; to:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$filter_order = &#039;&#039;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Version  1.5.22 FAQ]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Why_are_the_articles_in_my_section_blog_ordered_differently%3F&amp;diff=31731</id>
		<title>Why are the articles in my section blog ordered differently?</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Why_are_the_articles_in_my_section_blog_ordered_differently%3F&amp;diff=31731"/>
		<updated>2010-11-05T13:50:45Z</updated>

		<summary type="html">&lt;p&gt;Intertron: New page: There is a bug in 1.5.22 causing Section Blogs to be ordered differently.  See [http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=23135 this tracker i...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a bug in 1.5.22 causing Section Blogs to be ordered differently.&lt;br /&gt;
&lt;br /&gt;
See [http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=23135 this tracker item]&lt;br /&gt;
&lt;br /&gt;
More information to follow.&lt;br /&gt;
&lt;br /&gt;
[[Category:Version  1.5.22 FAQ]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Intertron&amp;diff=31730</id>
		<title>User:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Intertron&amp;diff=31730"/>
		<updated>2010-11-05T13:47:51Z</updated>

		<summary type="html">&lt;p&gt;Intertron: /* Intertron */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intertron ==&lt;br /&gt;
Intertron [http://www.intertron.nl] is my company name under which I am known on the Joomla! wiki and forum.&lt;br /&gt;
&lt;br /&gt;
My real name is Ronald Pijpers, I am freelance developer and you can contact me at: rpijpers@intertron.nl&lt;br /&gt;
You can contact me in Dutch or English.&lt;br /&gt;
&lt;br /&gt;
[[Why are the articles in my section blog ordered differently?]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10747</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10747"/>
		<updated>2008-09-15T09:03:10Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]. If you haven&#039;t done already, install this component on your developing website and create a menu link to this component.&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have to change the table definition accordingly. Open the table definition stored in the file administrator/components/com_hello/tables/hello.php and add the new field as a variable below the current ones:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;var $greeting = null;&lt;br /&gt;
var $content = null;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT * FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add similars line to assign the id and content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;id&#039;,		$greeting-&amp;gt;id );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now refresh your frontend site and you should see the added content.&lt;br /&gt;
&lt;br /&gt;
== Edit form ==&lt;br /&gt;
&lt;br /&gt;
To edit the current record we must:&lt;br /&gt;
* Add a link to the edit form&lt;br /&gt;
* Add a new template to edit the data&lt;br /&gt;
* Save the data&lt;br /&gt;
&lt;br /&gt;
Creating a link to the edit form can be done in the template directly. But to keep the template nice and simple we will build the link in the view and pass in onto the template for displaying. Add this line to the view:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assignRef( &#039;editlink&#039;,	JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hello&amp;amp;task=edit&#039;) );&amp;lt;/source&amp;gt;&lt;br /&gt;
And add these lines to the template:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;editlink; ?&amp;gt;&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;task=edit&#039;&#039; in the url triggers the edit function in the controller. So let&#039;s add this method to our controller:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
* Method to call the edit form&lt;br /&gt;
*/&lt;br /&gt;
function edit()&lt;br /&gt;
{&lt;br /&gt;
	JRequest::setVar( &#039;layout&#039;, &#039;form&#039; );&lt;br /&gt;
	parent::display();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
Before adding the model to the view, we change the layout to our edit form.&lt;br /&gt;
&lt;br /&gt;
Of course we have to provide this form. Create the file components/com_hello/views/hello/tmpl/form.php:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col100&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_( &#039;Details&#039; ); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;table class=&amp;quot;admintable&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;greeting&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;input class=&amp;quot;text_area&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;greeting&amp;quot; id=&amp;quot;greeting&amp;quot; size=&amp;quot;25&amp;quot; maxlength=&amp;quot;25&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;greeting;?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Content&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;?php&lt;br /&gt;
					$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
					echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;id&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;id; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;save&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Most of this is just like the form of the backend. The important addition in this form is how we call the editor:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The paramaters of the display method are:&lt;br /&gt;
    * string $name: The control name&lt;br /&gt;
    * string $html: The contents of the text area&lt;br /&gt;
    * string $width: The width of the text area (px or %)&lt;br /&gt;
    * string $height: The height of the text area (px or %)&lt;br /&gt;
    * int $col: The number of columns for the textarea&lt;br /&gt;
    * int $row: The number of rows for the textarea&lt;br /&gt;
    * boolean $buttons: True and the editor buttons will be displayed&lt;br /&gt;
    * array $params: Associative array of editor parameters&lt;br /&gt;
&lt;br /&gt;
Refresh your browser and the edit link will show. Use the link to open the edit form including the editor.&lt;br /&gt;
&lt;br /&gt;
== Save the data ==&lt;br /&gt;
&lt;br /&gt;
Next we need to add the save and cancel buttons and for some extra security we add a token to the form.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo JHTML::_( &#039;form.token&#039; ); ?&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;save&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Save&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;cancel&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Cancel&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The buttons call some javascript which is added on the top of the form file after the first line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
function submitbutton(pressbutton) {&lt;br /&gt;
	var form = document.adminForm;&lt;br /&gt;
	if (pressbutton == &#039;cancel&#039;) {&lt;br /&gt;
		submitform( pressbutton );&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;?php&lt;br /&gt;
		$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
		echo $editor-&amp;gt;save( &#039;content&#039; );&lt;br /&gt;
	?&amp;gt;&lt;br /&gt;
	submitform(pressbutton);&lt;br /&gt;
}&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the form we added the hidden field task with a value of save. This will trigger the save method inside the controller. So lets create this method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function save()&lt;br /&gt;
{&lt;br /&gt;
	// Check for request forgeries&lt;br /&gt;
	JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
    	&lt;br /&gt;
	// get the model&lt;br /&gt;
	$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
        &lt;br /&gt;
	//get data from request&lt;br /&gt;
	$post = JRequest::get(&#039;post&#039;);&lt;br /&gt;
	$post[&#039;content&#039;] = JRequest::getVar(&#039;content&#039;, &#039;&#039;, &#039;post&#039;, &#039;string&#039;, JREQUEST_ALLOWRAW);&lt;br /&gt;
        &lt;br /&gt;
	// let the model save it&lt;br /&gt;
	if ($model-&amp;gt;store($post)) {&lt;br /&gt;
		$message = JText::_(&#039;Success&#039;);&lt;br /&gt;
	} else {&lt;br /&gt;
		$message = JText::_(&#039;Error while saving&#039;);&lt;br /&gt;
		$message .= &#039; [&#039;.$model-&amp;gt;getError().&#039;] &#039;;&lt;br /&gt;
	}&lt;br /&gt;
	$this-&amp;gt;setRedirect(&#039;index.php?option=com_hello&#039;, $message);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
The standard way of getting the form data &#039;&#039;$post = JRequest::get(&#039;post&#039;);&#039;&#039; is not enough in the case of using a editor. This will filter the content, hence losing line breaks and paragraps. So we add an extra line to get the editor contents in a raw unfiltered way. This data will be passed to the model to save into the database.&lt;br /&gt;
&lt;br /&gt;
The store method in the model is now straightforward:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function store($data)&lt;br /&gt;
{&lt;br /&gt;
	// get the table&lt;br /&gt;
	$row =&amp;amp; $this-&amp;gt;getTable();&lt;br /&gt;
                &lt;br /&gt;
	// Bind the form fields to the hello table&lt;br /&gt;
	if (!$row-&amp;gt;bind($data)) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	// Make sure the hello record is valid&lt;br /&gt;
	if (!$row-&amp;gt;check()) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Store the web link table to the database&lt;br /&gt;
	if (!$row-&amp;gt;store()) {&lt;br /&gt;
		$this-&amp;gt;setError( $row-&amp;gt;getErrorMsg() );&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	return true;         &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try this on your website. You should be able to change the greeting and the contents.&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
The component can be downloaded at: [http://www.intertron.eu/downloads/cat_view/1-joomla com_hello5_01]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10727</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10727"/>
		<updated>2008-09-12T11:17:34Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]. If you haven&#039;t done already, install this component on your developing website and create a menu link to this component.&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have to change the table definition accordingly. Open the table definition stored in the file administrator/components/com_hello/tables/hello.php and add the new field as a variable below the current ones:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;var $greeting = null;&lt;br /&gt;
var $content = null;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT * FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add similars line to assign the id and content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;id&#039;,		$greeting-&amp;gt;id );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now refresh your frontend site and you should see the added content.&lt;br /&gt;
&lt;br /&gt;
== Edit form ==&lt;br /&gt;
&lt;br /&gt;
To edit the current record we must:&lt;br /&gt;
* Add a link to the edit form&lt;br /&gt;
* Add a new template to edit the data&lt;br /&gt;
* Save the data&lt;br /&gt;
&lt;br /&gt;
Creating a link to the edit form can be done in the template directly. But to keep the template nice and simple we will build the link in the view and pass in onto the template for displaying. Add this line to the view:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assignRef( &#039;editlink&#039;,	JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hello&amp;amp;task=edit&#039;) );&amp;lt;/source&amp;gt;&lt;br /&gt;
And add these lines to the template:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;editlink; ?&amp;gt;&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;task=edit&#039;&#039; in the url triggers the edit function in the controller. So let&#039;s add this method to our controller:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
* Method to call the edit form&lt;br /&gt;
*/&lt;br /&gt;
function edit()&lt;br /&gt;
{&lt;br /&gt;
	JRequest::setVar( &#039;layout&#039;, &#039;form&#039; );&lt;br /&gt;
	parent::display();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
Before adding the model to the view, we change the layout to our edit form.&lt;br /&gt;
&lt;br /&gt;
Of course we have to provide this form. Create the file components/com_hello/views/hello/tmpl/form.php:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col100&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_( &#039;Details&#039; ); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;table class=&amp;quot;admintable&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;greeting&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;input class=&amp;quot;text_area&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;greeting&amp;quot; id=&amp;quot;greeting&amp;quot; size=&amp;quot;25&amp;quot; maxlength=&amp;quot;25&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;greeting;?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Content&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;?php&lt;br /&gt;
					$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
					echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;id&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;id; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;save&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Most of this is just like the form of the backend. The important addition in this form is how we call the editor:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The paramaters of the display method are:&lt;br /&gt;
    * string $name: The control name&lt;br /&gt;
    * string $html: The contents of the text area&lt;br /&gt;
    * string $width: The width of the text area (px or %)&lt;br /&gt;
    * string $height: The height of the text area (px or %)&lt;br /&gt;
    * int $col: The number of columns for the textarea&lt;br /&gt;
    * int $row: The number of rows for the textarea&lt;br /&gt;
    * boolean $buttons: True and the editor buttons will be displayed&lt;br /&gt;
    * array $params: Associative array of editor parameters&lt;br /&gt;
&lt;br /&gt;
Refresh your browser and the edit link will show. Use the link to open the edit form including the editor.&lt;br /&gt;
&lt;br /&gt;
== Save the data ==&lt;br /&gt;
&lt;br /&gt;
Next we need to add the save and cancel buttons and for some extra security we add a token to the form.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo JHTML::_( &#039;form.token&#039; ); ?&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;save&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Save&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;cancel&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Cancel&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The buttons call some javascript which is added on the top of the form file after the first line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
function submitbutton(pressbutton) {&lt;br /&gt;
	var form = document.adminForm;&lt;br /&gt;
	if (pressbutton == &#039;cancel&#039;) {&lt;br /&gt;
		submitform( pressbutton );&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;?php&lt;br /&gt;
		$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
		echo $editor-&amp;gt;save( &#039;content&#039; );&lt;br /&gt;
	?&amp;gt;&lt;br /&gt;
	submitform(pressbutton);&lt;br /&gt;
}&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the form we added the hidden field task with a value of save. This will trigger the save method inside the controller. So lets create this method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function save()&lt;br /&gt;
{&lt;br /&gt;
	// Check for request forgeries&lt;br /&gt;
	JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
    	&lt;br /&gt;
	// get the model&lt;br /&gt;
	$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
        &lt;br /&gt;
	//get data from request&lt;br /&gt;
	$post = JRequest::get(&#039;post&#039;);&lt;br /&gt;
	$post[&#039;content&#039;] = JRequest::getVar(&#039;content&#039;, &#039;&#039;, &#039;post&#039;, &#039;string&#039;, JREQUEST_ALLOWRAW);&lt;br /&gt;
        &lt;br /&gt;
	// let the model save it&lt;br /&gt;
	if ($model-&amp;gt;store($post)) {&lt;br /&gt;
		$message = JText::_(&#039;Success&#039;);&lt;br /&gt;
	} else {&lt;br /&gt;
		$message = JText::_(&#039;Error while saving&#039;);&lt;br /&gt;
		$message .= &#039; [&#039;.$model-&amp;gt;getError().&#039;] &#039;;&lt;br /&gt;
	}&lt;br /&gt;
	$this-&amp;gt;setRedirect(&#039;index.php?option=com_hello&#039;, $message);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
The standard way of getting the form data &#039;&#039;$post = JRequest::get(&#039;post&#039;);&#039;&#039; is not enough in the case of using a editor. This will filter the content, hence losing line breaks and paragraps. So we add an extra line to get the editor contents in a raw unfiltered way. This data will be passed to the model to save into the database.&lt;br /&gt;
&lt;br /&gt;
The store method in the model is now straightforward:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function store($data)&lt;br /&gt;
{&lt;br /&gt;
	// get the table&lt;br /&gt;
	$row =&amp;amp; $this-&amp;gt;getTable();&lt;br /&gt;
                &lt;br /&gt;
	// Bind the form fields to the hello table&lt;br /&gt;
	if (!$row-&amp;gt;bind($data)) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	// Make sure the hello record is valid&lt;br /&gt;
	if (!$row-&amp;gt;check()) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Store the web link table to the database&lt;br /&gt;
	if (!$row-&amp;gt;store()) {&lt;br /&gt;
		$this-&amp;gt;setError( $row-&amp;gt;getErrorMsg() );&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	return true;         &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try this on your website. You should be able to change the greeting and the contents.&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Portal:Developers&amp;diff=10726</id>
		<title>Portal:Developers</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Portal:Developers&amp;diff=10726"/>
		<updated>2008-09-12T11:09:30Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Developer profile}}&lt;br /&gt;
&lt;br /&gt;
== Participation ==&lt;br /&gt;
&lt;br /&gt;
* [[Participating in the community]]: a brief description of how people can get involved.&lt;br /&gt;
* [[Setting up your workstation for Joomla! development]]: a step-by-step guide for installing the Eclipse IDE on your local workstation for Joomla! development&lt;br /&gt;
* [[Coding style and standards]] (To be reviewed).&lt;br /&gt;
* [[Patch submission guidelines]].&lt;br /&gt;
* [[Filing bugs and issues]].&lt;br /&gt;
* [[How to release a distribution tarball]].&lt;br /&gt;
&lt;br /&gt;
== Reference Pages ==&lt;br /&gt;
&lt;br /&gt;
Peruse all pages in the [[:Category:Development]] category.&lt;br /&gt;
&lt;br /&gt;
When creating a new page, ensure you place the following marker at the top of the page so it is included in the category list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;[[Category:Development]]&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you locate other articles you thing that are relevant to developer, please add this marker to those pages.&lt;br /&gt;
&lt;br /&gt;
== Articles and Tutorials on developer.joomla.org ==&lt;br /&gt;
&lt;br /&gt;
[http://community.joomla.org/magazine/article/508-developer-localization-advancements-in-joomla-15.html Localization Advancements in Joomla! 1.5]&lt;br /&gt;
&lt;br /&gt;
[http://developer.joomla.org/tutorials/165-understanding-output-overrides-in-joomla.html Understanding Output Overrides in Joomla! 1.5]&lt;br /&gt;
&lt;br /&gt;
[http://developer.joomla.org/tutorials/181-preventing-sql-injections.html Preventing SQL Injections]&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;
[[How to use the editor in a component]]&lt;br /&gt;
&lt;br /&gt;
== Cookie Jar ==&lt;br /&gt;
&lt;br /&gt;
Articles that need to be written.&lt;br /&gt;
&lt;br /&gt;
* Developer guidelines.&lt;br /&gt;
* Secure coding guidelines.&lt;br /&gt;
* Error message conventions.&lt;br /&gt;
* Exception handling.&lt;br /&gt;
* Release numbering, compatibility and deprecation.&lt;br /&gt;
* Complete/update/review the wiki API reference (assumes this has been moved from DocuWiki to MediaWiki).&lt;br /&gt;
* Update developer tutorials and how-to&#039;s currently on dev.joomla.org&lt;br /&gt;
** Review all material under the tutorials heading at http://dev.joomla.org/component/option,com_jd-wiki/Itemid,32/&lt;br /&gt;
** Recommend material to be migrated over to docs.joomla.org&lt;br /&gt;
** Update material that is to be migrated over to docs.joomla.org&lt;br /&gt;
* [[Adding AJAX to your component]].&lt;br /&gt;
** Write a document describing how to add AJAX to an MVC component.  If desired, use the MVC Hello World tutorial as a base.  Describe where various elements should go in the MVC design pattern.  Also describe how to implement MVC in a module (these need supporting components to do AJAX).&lt;br /&gt;
* [[Creating a toolbar for your component]].&lt;br /&gt;
* [[Adding configuration objects to modules and plugins]].&lt;br /&gt;
* [[Storing data in the session between page loads]].&lt;br /&gt;
* [[Using the caching system in your component]].&lt;br /&gt;
* [[Creating a file uploader in your component]].&lt;br /&gt;
* [[Suppressing output of extra HTML]].&lt;br /&gt;
* [[Adding view layout configuration parameters]].&lt;br /&gt;
** Explain how to create an XML file that will allow users to configure views.&lt;br /&gt;
* [[How to implement XML-RPC in a component]]&lt;br /&gt;
** There are two ways to do this:&lt;br /&gt;
*** Implement it using an XML-RPC plugin&lt;br /&gt;
*** Implement it in the component itself using raw views&lt;br /&gt;
* [[How to use the filesystem package]]&lt;br /&gt;
* [[How to use the filter package]]&lt;br /&gt;
** Describe how and when to use the Filter package and explain what needs to be filtered for various situations (for queries, for URLs, etc)&lt;br /&gt;
* [[How to use the registry package]]&lt;br /&gt;
* [[How to use JSimpleXML]]&lt;br /&gt;
** How to load and store XML files and how to work with them&lt;br /&gt;
* [[How to add breadcrumbs]]&lt;br /&gt;
* [[How to create component feeds]] (RSS/ATOM)&lt;br /&gt;
* [[How to create PDF views]]&lt;br /&gt;
* [[How to send email from components]]&lt;br /&gt;
* [[What&#039;s available in the JFactory class]]&lt;br /&gt;
* [[How to generate paths for client side and server side]]&lt;br /&gt;
* How to access information from the request/browser&lt;br /&gt;
** This focuses on using the JBrowser class to retrieve information about the features available in the user&#039;s browser.&lt;br /&gt;
* [[How to create an editor plugin]]&lt;br /&gt;
* [[What can be done with a user plugin]]&lt;br /&gt;
* [[How to work with parameters]]&lt;br /&gt;
* [[How to use the JToolBar class in the frontend]]&lt;br /&gt;
* [[How to cloak email addresses]]&lt;br /&gt;
* [[Joomla Routes and SEF]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10725</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10725"/>
		<updated>2008-09-12T10:27:08Z</updated>

		<summary type="html">&lt;p&gt;Intertron: /* Edit form */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]. If you haven&#039;t done already, install this component on your developing website and create a menu link to this component.&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have to change the table definition accordingly. Open the table definition stored in the file administrator/components/com_hello/tables/hello.php and add the new field as a variable below the current ones:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;var $greeting = null;&lt;br /&gt;
var $content = null;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT * FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add similars line to assign the id and content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;id&#039;,		$greeting-&amp;gt;id );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now refresh your frontend site and you should see the added content.&lt;br /&gt;
&lt;br /&gt;
== Edit form ==&lt;br /&gt;
&lt;br /&gt;
To edit the current record we must:&lt;br /&gt;
* Add a link to the edit form&lt;br /&gt;
* Add a new template to edit the data&lt;br /&gt;
* Save the data&lt;br /&gt;
&lt;br /&gt;
Creating a link to the edit form can be done in the template directly. But to keep the template nice and simple we will build the link in the view and pass in onto the template for displaying. Add this line to the view:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assignRef( &#039;editlink&#039;,	JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hello&amp;amp;task=edit&#039;) );&amp;lt;/source&amp;gt;&lt;br /&gt;
And add these lines to the template:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;editlink; ?&amp;gt;&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;task=edit&#039;&#039; in the url triggers the edit function in the controller. So let&#039;s add this method to our controller:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
* Method to call the edit form&lt;br /&gt;
*/&lt;br /&gt;
function edit()&lt;br /&gt;
{&lt;br /&gt;
	JRequest::setVar( &#039;layout&#039;, &#039;form&#039; );&lt;br /&gt;
	parent::display();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
Before adding the model to the view, we change the layout to our edit form.&lt;br /&gt;
&lt;br /&gt;
Of course we have to provide this form. Create the file components/com_hello/views/hello/tmpl/form.php:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col100&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_( &#039;Details&#039; ); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;table class=&amp;quot;admintable&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;greeting&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;input class=&amp;quot;text_area&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;greeting&amp;quot; id=&amp;quot;greeting&amp;quot; size=&amp;quot;25&amp;quot; maxlength=&amp;quot;25&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;greeting;?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Content&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;?php&lt;br /&gt;
					$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
					echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;id&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;id; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;save&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Most of this is just like the form of the backend. The important addition in this form is how we call the editor:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The paramaters of the display method are:&lt;br /&gt;
    * string $name: The control name&lt;br /&gt;
    * string $html: The contents of the text area&lt;br /&gt;
    * string $width: The width of the text area (px or %)&lt;br /&gt;
    * string $height: The height of the text area (px or %)&lt;br /&gt;
    * int $col: The number of columns for the textarea&lt;br /&gt;
    * int $row: The number of rows for the textarea&lt;br /&gt;
    * boolean $buttons: True and the editor buttons will be displayed&lt;br /&gt;
    * array $params: Associative array of editor parameters&lt;br /&gt;
&lt;br /&gt;
Refresh your browser and the edit link will show. Use the link to open the edit form including the editor.&lt;br /&gt;
&lt;br /&gt;
== Save the data ==&lt;br /&gt;
&lt;br /&gt;
Next we need to add the save and cancel buttons and for some extra security we add a token to the form.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo JHTML::_( &#039;form.token&#039; ); ?&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;save&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Save&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;cancel&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Cancel&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The buttons call some javascript which is added on the top of the form file after the first line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
function submitbutton(pressbutton) {&lt;br /&gt;
	var form = document.adminForm;&lt;br /&gt;
	if (pressbutton == &#039;cancel&#039;) {&lt;br /&gt;
		submitform( pressbutton );&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;?php&lt;br /&gt;
		$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
		echo $editor-&amp;gt;save( &#039;content&#039; );&lt;br /&gt;
	?&amp;gt;&lt;br /&gt;
	submitform(pressbutton);&lt;br /&gt;
}&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the form we added the hidden field task with a value of save. This will trigger the save method inside the controller. So lets create this method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function save()&lt;br /&gt;
{&lt;br /&gt;
	// Check for request forgeries&lt;br /&gt;
	JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
    	&lt;br /&gt;
	// get the model&lt;br /&gt;
	$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
        &lt;br /&gt;
	//get data from request&lt;br /&gt;
	$post = JRequest::get(&#039;post&#039;);&lt;br /&gt;
	$post[&#039;content&#039;] = JRequest::getVar(&#039;content&#039;, &#039;&#039;, &#039;post&#039;, &#039;string&#039;, JREQUEST_ALLOWRAW);&lt;br /&gt;
        &lt;br /&gt;
	// let the model save it&lt;br /&gt;
	if ($model-&amp;gt;store($post)) {&lt;br /&gt;
		$message = JText::_(&#039;Success&#039;);&lt;br /&gt;
	} else {&lt;br /&gt;
		$message = JText::_(&#039;Error while saving&#039;);&lt;br /&gt;
		$message .= &#039; [&#039;.$model-&amp;gt;getError().&#039;] &#039;;&lt;br /&gt;
	}&lt;br /&gt;
	$this-&amp;gt;setRedirect(&#039;index.php?option=com_hello&#039;, $message);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
The standard way of getting the form data &#039;&#039;$post = JRequest::get(&#039;post&#039;);&#039;&#039; is not enough in the case of using a editor. This will filter the content, hence losing line breaks and paragraps. So we add an extra line to get the editor contents in a raw unfiltered way. This data will be passed to the model to save into the database.&lt;br /&gt;
&lt;br /&gt;
The store method in the model is now straightforward:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function store($data)&lt;br /&gt;
{&lt;br /&gt;
	// get the table&lt;br /&gt;
	$row =&amp;amp; $this-&amp;gt;getTable();&lt;br /&gt;
                &lt;br /&gt;
	// Bind the form fields to the hello table&lt;br /&gt;
	if (!$row-&amp;gt;bind($data)) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	// Make sure the hello record is valid&lt;br /&gt;
	if (!$row-&amp;gt;check()) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Store the web link table to the database&lt;br /&gt;
	if (!$row-&amp;gt;store()) {&lt;br /&gt;
		$this-&amp;gt;setError( $row-&amp;gt;getErrorMsg() );&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	return true;         &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try this on your website. You should be able to change the greeting and the contents.&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10724</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10724"/>
		<updated>2008-09-12T10:25:28Z</updated>

		<summary type="html">&lt;p&gt;Intertron: /* Edit form */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]. If you haven&#039;t done already, install this component on your developing website and create a menu link to this component.&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have to change the table definition accordingly. Open the table definition stored in the file administrator/components/com_hello/tables/hello.php and add the new field as a variable below the current ones:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;var $greeting = null;&lt;br /&gt;
var $content = null;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT * FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add similars line to assign the id and content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;id&#039;,		$greeting-&amp;gt;id );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now refresh your frontend site and you should see the added content.&lt;br /&gt;
&lt;br /&gt;
== Edit form ==&lt;br /&gt;
&lt;br /&gt;
To edit the current record we must:&lt;br /&gt;
* Add a link to the edit form&lt;br /&gt;
* Add a new template to edit the data&lt;br /&gt;
* Save the data&lt;br /&gt;
&lt;br /&gt;
Creating a link to the edit form can be done in the template directly. But to keep the template nice and simple we will build the link in the view and pass in onto the template for displaying. Add this line to the view:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assignRef( &#039;editlink&#039;,	JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hello&amp;amp;task=edit&#039;) );&amp;lt;/source&amp;gt;&lt;br /&gt;
And add these lines to the template:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;editlink; ?&amp;gt;&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;task=edit&#039;&#039; in the url triggers the edit function in the controller. So let&#039;s add this method to our controller:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
* Method to call the edit form&lt;br /&gt;
*/&lt;br /&gt;
function edit()&lt;br /&gt;
{&lt;br /&gt;
	JRequest::setVar( &#039;layout&#039;, &#039;form&#039; );&lt;br /&gt;
	parent::display();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
Before adding the model to the view, we change the layout to our edit form.&lt;br /&gt;
&lt;br /&gt;
Of course we have to provide this form. Create the file components/com_hello/views/hello/tmpl/form.php:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col100&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_( &#039;Details&#039; ); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;table class=&amp;quot;admintable&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;greeting&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;input class=&amp;quot;text_area&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;greeting&amp;quot; id=&amp;quot;greeting&amp;quot; size=&amp;quot;25&amp;quot; maxlength=&amp;quot;25&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;greeting;?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Content&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;?php&lt;br /&gt;
					$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
					echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;id&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;id; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;save&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Most of this is just like the form of the backend. The important addition in this form is how we call the editor:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The paramaters of the display method are:&lt;br /&gt;
    * string $name: The control name&lt;br /&gt;
    * string $html: The contents of the text area&lt;br /&gt;
    * string $width: The width of the text area (px or %)&lt;br /&gt;
    * string $height: The height of the text area (px or %)&lt;br /&gt;
    * int $col: The number of columns for the textarea&lt;br /&gt;
    * int $row: The number of rows for the textarea&lt;br /&gt;
    * boolean $buttons: True and the editor buttons will be displayed&lt;br /&gt;
    * array $params: Associative array of editor parameters&lt;br /&gt;
&lt;br /&gt;
== Save the data ==&lt;br /&gt;
&lt;br /&gt;
Next we need to add the save and cancel buttons and for some extra security we add a token to the form.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo JHTML::_( &#039;form.token&#039; ); ?&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;save&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Save&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;cancel&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Cancel&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The buttons call some javascript which is added on the top of the form file after the first line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
function submitbutton(pressbutton) {&lt;br /&gt;
	var form = document.adminForm;&lt;br /&gt;
	if (pressbutton == &#039;cancel&#039;) {&lt;br /&gt;
		submitform( pressbutton );&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;?php&lt;br /&gt;
		$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
		echo $editor-&amp;gt;save( &#039;content&#039; );&lt;br /&gt;
	?&amp;gt;&lt;br /&gt;
	submitform(pressbutton);&lt;br /&gt;
}&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the form we added the hidden field task with a value of save. This will trigger the save method inside the controller. So lets create this method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function save()&lt;br /&gt;
{&lt;br /&gt;
	// Check for request forgeries&lt;br /&gt;
	JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
    	&lt;br /&gt;
	// get the model&lt;br /&gt;
	$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
        &lt;br /&gt;
	//get data from request&lt;br /&gt;
	$post = JRequest::get(&#039;post&#039;);&lt;br /&gt;
	$post[&#039;content&#039;] = JRequest::getVar(&#039;content&#039;, &#039;&#039;, &#039;post&#039;, &#039;string&#039;, JREQUEST_ALLOWRAW);&lt;br /&gt;
        &lt;br /&gt;
	// let the model save it&lt;br /&gt;
	if ($model-&amp;gt;store($post)) {&lt;br /&gt;
		$message = JText::_(&#039;Success&#039;);&lt;br /&gt;
	} else {&lt;br /&gt;
		$message = JText::_(&#039;Error while saving&#039;);&lt;br /&gt;
		$message .= &#039; [&#039;.$model-&amp;gt;getError().&#039;] &#039;;&lt;br /&gt;
	}&lt;br /&gt;
	$this-&amp;gt;setRedirect(&#039;index.php?option=com_hello&#039;, $message);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
The standard way of getting the form data &#039;&#039;$post = JRequest::get(&#039;post&#039;);&#039;&#039; is not enough in the case of using a editor. This will filter the content, hence losing line breaks and paragraps. So we add an extra line to get the editor contents in a raw unfiltered way. This data will be passed to the model to save into the database.&lt;br /&gt;
&lt;br /&gt;
The store method in the model is now straightforward:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function store($data)&lt;br /&gt;
{&lt;br /&gt;
	// get the table&lt;br /&gt;
	$row =&amp;amp; $this-&amp;gt;getTable();&lt;br /&gt;
                &lt;br /&gt;
	// Bind the form fields to the hello table&lt;br /&gt;
	if (!$row-&amp;gt;bind($data)) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	// Make sure the hello record is valid&lt;br /&gt;
	if (!$row-&amp;gt;check()) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Store the web link table to the database&lt;br /&gt;
	if (!$row-&amp;gt;store()) {&lt;br /&gt;
		$this-&amp;gt;setError( $row-&amp;gt;getErrorMsg() );&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	return true;         &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try this on your website. You should be able to change the greeting and the contents.&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10723</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10723"/>
		<updated>2008-09-12T10:21:30Z</updated>

		<summary type="html">&lt;p&gt;Intertron: /* Show the new field on the front end */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]. If you haven&#039;t done already, install this component on your developing website and create a menu link to this component.&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have to change the table definition accordingly. Open the table definition stored in the file administrator/components/com_hello/tables/hello.php and add the new field as a variable below the current ones:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;var $greeting = null;&lt;br /&gt;
var $content = null;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT * FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add similars line to assign the id and content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;id&#039;,		$greeting-&amp;gt;id );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now refresh your frontend site and you should see the added content.&lt;br /&gt;
&lt;br /&gt;
== Edit form ==&lt;br /&gt;
&lt;br /&gt;
To edit the current record we must:&lt;br /&gt;
* Add a link to the edit form&lt;br /&gt;
* Add a new template to edit the data&lt;br /&gt;
* Save the data&lt;br /&gt;
&lt;br /&gt;
Creating a link to the edit form can be done in the template directly. But to keep the template nice and simple we will build the link in the view and pass in onto the template for displaying. Add this line to the view:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assignRef( &#039;editlink&#039;,	JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hello&amp;amp;task=edit&#039;) );&amp;lt;/source&amp;gt;&lt;br /&gt;
And add these lines to the template:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;editlink; ?&amp;gt;&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;task=edit&#039;&#039; in the url triggers the edit function in the controller. So let&#039;s add this method to our controller:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
* Method to call the edit form&lt;br /&gt;
*/&lt;br /&gt;
function edit()&lt;br /&gt;
{&lt;br /&gt;
	JRequest::setVar( &#039;layout&#039;, &#039;form&#039; );&lt;br /&gt;
	parent::display();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
Before adding the model to the view, we change the layout to our edit form.&lt;br /&gt;
&lt;br /&gt;
Of course we have to provide this form. Create the file components/com_hello/views/hello/tmpl/form.php:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col100&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_( &#039;Details&#039; ); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;table class=&amp;quot;admintable&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;greeting&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;input class=&amp;quot;text_area&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;greeting&amp;quot; id=&amp;quot;greeting&amp;quot; size=&amp;quot;25&amp;quot; maxlength=&amp;quot;25&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;greeting;?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Content&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;?php&lt;br /&gt;
					$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
					echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;id&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;hello-&amp;gt;id; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;save&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Most of this is just like the form of the backend. The important addition in this form is how we call the editor:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The paramaters of the display method are:&lt;br /&gt;
    * string $name: The control name&lt;br /&gt;
    * string $html: The contents of the text area&lt;br /&gt;
    * string $width: The width of the text area (px or %)&lt;br /&gt;
    * string $height: The height of the text area (px or %)&lt;br /&gt;
    * int $col: The number of columns for the textarea&lt;br /&gt;
    * int $row: The number of rows for the textarea&lt;br /&gt;
    * boolean $buttons: True and the editor buttons will be displayed&lt;br /&gt;
    * array $params: Associative array of editor parameters&lt;br /&gt;
&lt;br /&gt;
== Save the data ==&lt;br /&gt;
&lt;br /&gt;
Next we need to add the save and cancel buttons and for some extra security we add a token to the form.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo JHTML::_( &#039;form.token&#039; ); ?&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;save&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Save&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;cancel&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Cancel&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The buttons call some javascript which is added on the top of the form file after the first line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
function submitbutton(pressbutton) {&lt;br /&gt;
	var form = document.adminForm;&lt;br /&gt;
	if (pressbutton == &#039;cancel&#039;) {&lt;br /&gt;
		submitform( pressbutton );&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;?php&lt;br /&gt;
		$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
		echo $editor-&amp;gt;save( &#039;content&#039; );&lt;br /&gt;
	?&amp;gt;&lt;br /&gt;
	submitform(pressbutton);&lt;br /&gt;
}&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the form we added the hidden field task with a value of save. This will trigger the save method inside the controller. So lets create this method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function save()&lt;br /&gt;
{&lt;br /&gt;
	// Check for request forgeries&lt;br /&gt;
	JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
    	&lt;br /&gt;
	// get the model&lt;br /&gt;
	$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
        &lt;br /&gt;
	//get data from request&lt;br /&gt;
	$post = JRequest::get(&#039;post&#039;);&lt;br /&gt;
	$post[&#039;content&#039;] = JRequest::getVar(&#039;content&#039;, &#039;&#039;, &#039;post&#039;, &#039;string&#039;, JREQUEST_ALLOWRAW);&lt;br /&gt;
        &lt;br /&gt;
	// let the model save it&lt;br /&gt;
	if ($model-&amp;gt;store($post)) {&lt;br /&gt;
		$message = JText::_(&#039;Success&#039;);&lt;br /&gt;
	} else {&lt;br /&gt;
		$message = JText::_(&#039;Error while saving&#039;);&lt;br /&gt;
		$message .= &#039; [&#039;.$model-&amp;gt;getError().&#039;] &#039;;&lt;br /&gt;
	}&lt;br /&gt;
	$this-&amp;gt;setRedirect(&#039;index.php?option=com_hello&#039;, $message);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
The standard way of getting the form data &#039;&#039;$post = JRequest::get(&#039;post&#039;);&#039;&#039; is not enough in the case of using a editor. This will filter the content, hence losing line breaks and paragraps. So we add an extra line to get the editor contents in a raw unfiltered way. This data will be passed to the model to save into the database.&lt;br /&gt;
&lt;br /&gt;
The store method in the model is now straightforward:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function store($data)&lt;br /&gt;
{&lt;br /&gt;
	// get the table&lt;br /&gt;
	$row =&amp;amp; $this-&amp;gt;getTable();&lt;br /&gt;
                &lt;br /&gt;
	// Bind the form fields to the hello table&lt;br /&gt;
	if (!$row-&amp;gt;bind($data)) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	// Make sure the hello record is valid&lt;br /&gt;
	if (!$row-&amp;gt;check()) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Store the web link table to the database&lt;br /&gt;
	if (!$row-&amp;gt;store()) {&lt;br /&gt;
		$this-&amp;gt;setError( $row-&amp;gt;getErrorMsg() );&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	return true;         &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try this on your website. You should be able to change the greeting and the contents.&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10722</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10722"/>
		<updated>2008-09-12T09:59:22Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]. If you haven&#039;t done already, install this component on your developing website and create a menu link to this component.&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have to change the table definition accordingly. Open the table definition stored in the file administrator/components/com_hello/tables/hello.php and add the new field as a variable below the current ones:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;var $greeting = null;&lt;br /&gt;
var $content = null;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT greeting, content FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add similars line to assign the id and content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;id&#039;,		$greeting-&amp;gt;id );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now refresh your frontend site and you should see the added content.&lt;br /&gt;
&lt;br /&gt;
== Edit form ==&lt;br /&gt;
&lt;br /&gt;
To edit the current record we must:&lt;br /&gt;
* Add a link to the edit form&lt;br /&gt;
* Add a new template to edit the data&lt;br /&gt;
* Save the data&lt;br /&gt;
&lt;br /&gt;
Creating a link to the edit form can be done in the template directly. But to keep the template nice and simple we will build the link in the view and pass in onto the template for displaying. Add this line to the view:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assignRef( &#039;editlink&#039;,	JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hello&amp;amp;task=edit&#039;) );&amp;lt;/source&amp;gt;&lt;br /&gt;
And add these lines to the template:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;editlink; ?&amp;gt;&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;task=edit&#039;&#039; in the url triggers the edit function in the controller. So let&#039;s add this method to our controller:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
* Method to call the edit form&lt;br /&gt;
*/&lt;br /&gt;
function edit()&lt;br /&gt;
{&lt;br /&gt;
	JRequest::setVar( &#039;layout&#039;, &#039;form&#039; );&lt;br /&gt;
	parent::display();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
Before adding the model to the view, we change the layout to our edit form.&lt;br /&gt;
&lt;br /&gt;
Of course we have to provide this form. Create the file components/com_hello/views/hello/tmpl/form.php:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col100&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_( &#039;Details&#039; ); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;table class=&amp;quot;admintable&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;greeting&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;input class=&amp;quot;text_area&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;greeting&amp;quot; id=&amp;quot;greeting&amp;quot; size=&amp;quot;25&amp;quot; maxlength=&amp;quot;25&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;greeting;?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Content&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;?php&lt;br /&gt;
					$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
					echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;id&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;hello-&amp;gt;id; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;save&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Most of this is just like the form of the backend. The important addition in this form is how we call the editor:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The paramaters of the display method are:&lt;br /&gt;
    * string $name: The control name&lt;br /&gt;
    * string $html: The contents of the text area&lt;br /&gt;
    * string $width: The width of the text area (px or %)&lt;br /&gt;
    * string $height: The height of the text area (px or %)&lt;br /&gt;
    * int $col: The number of columns for the textarea&lt;br /&gt;
    * int $row: The number of rows for the textarea&lt;br /&gt;
    * boolean $buttons: True and the editor buttons will be displayed&lt;br /&gt;
    * array $params: Associative array of editor parameters&lt;br /&gt;
&lt;br /&gt;
== Save the data ==&lt;br /&gt;
&lt;br /&gt;
Next we need to add the save and cancel buttons and for some extra security we add a token to the form.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo JHTML::_( &#039;form.token&#039; ); ?&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;save&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Save&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;cancel&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Cancel&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The buttons call some javascript which is added on the top of the form file after the first line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
function submitbutton(pressbutton) {&lt;br /&gt;
	var form = document.adminForm;&lt;br /&gt;
	if (pressbutton == &#039;cancel&#039;) {&lt;br /&gt;
		submitform( pressbutton );&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;?php&lt;br /&gt;
		$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
		echo $editor-&amp;gt;save( &#039;content&#039; );&lt;br /&gt;
	?&amp;gt;&lt;br /&gt;
	submitform(pressbutton);&lt;br /&gt;
}&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the form we added the hidden field task with a value of save. This will trigger the save method inside the controller. So lets create this method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function save()&lt;br /&gt;
{&lt;br /&gt;
	// Check for request forgeries&lt;br /&gt;
	JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
    	&lt;br /&gt;
	// get the model&lt;br /&gt;
	$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
        &lt;br /&gt;
	//get data from request&lt;br /&gt;
	$post = JRequest::get(&#039;post&#039;);&lt;br /&gt;
	$post[&#039;content&#039;] = JRequest::getVar(&#039;content&#039;, &#039;&#039;, &#039;post&#039;, &#039;string&#039;, JREQUEST_ALLOWRAW);&lt;br /&gt;
        &lt;br /&gt;
	// let the model save it&lt;br /&gt;
	if ($model-&amp;gt;store($post)) {&lt;br /&gt;
		$message = JText::_(&#039;Success&#039;);&lt;br /&gt;
	} else {&lt;br /&gt;
		$message = JText::_(&#039;Error while saving&#039;);&lt;br /&gt;
		$message .= &#039; [&#039;.$model-&amp;gt;getError().&#039;] &#039;;&lt;br /&gt;
	}&lt;br /&gt;
	$this-&amp;gt;setRedirect(&#039;index.php?option=com_hello&#039;, $message);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
The standard way of getting the form data &#039;&#039;$post = JRequest::get(&#039;post&#039;);&#039;&#039; is not enough in the case of using a editor. This will filter the content, hence losing line breaks and paragraps. So we add an extra line to get the editor contents in a raw unfiltered way. This data will be passed to the model to save into the database.&lt;br /&gt;
&lt;br /&gt;
The store method in the model is now straightforward:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function store($data)&lt;br /&gt;
{&lt;br /&gt;
	// get the table&lt;br /&gt;
	$row =&amp;amp; $this-&amp;gt;getTable();&lt;br /&gt;
                &lt;br /&gt;
	// Bind the form fields to the hello table&lt;br /&gt;
	if (!$row-&amp;gt;bind($data)) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	// Make sure the hello record is valid&lt;br /&gt;
	if (!$row-&amp;gt;check()) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Store the web link table to the database&lt;br /&gt;
	if (!$row-&amp;gt;store()) {&lt;br /&gt;
		$this-&amp;gt;setError( $row-&amp;gt;getErrorMsg() );&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	return true;         &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try this on your website. You should be able to change the greeting and the contents.&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10721</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10721"/>
		<updated>2008-09-12T09:56:26Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]. If you haven&#039;t done already, install this component on your developing website and create a menu link to this component.&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have to change the table definition accordingly. Open the table definition stored in the file administrator/components/com_hello/tables/hello.php and add the new field as a variable below the current ones:&lt;br /&gt;
&amp;lt;source language=&amp;quot;php&amp;quot;&amp;gt;var $greeting = null;&lt;br /&gt;
var $content = null;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT greeting, content FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add similars line to assign the id and content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;id&#039;,		$greeting-&amp;gt;id );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now refresh your frontend site and you should see the added content.&lt;br /&gt;
&lt;br /&gt;
== Edit form ==&lt;br /&gt;
&lt;br /&gt;
To edit the current record we must:&lt;br /&gt;
* Add a link to the edit form&lt;br /&gt;
* Add a new template to edit the data&lt;br /&gt;
* Save the data&lt;br /&gt;
&lt;br /&gt;
Creating a link to the edit form can be done in the template directly. But to keep the template nice and simple we will build the link in the view and pass in onto the template for displaying. Add this line to the view:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assignRef( &#039;editlink&#039;,	JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hello&amp;amp;task=edit&#039;) );&amp;lt;/source&amp;gt;&lt;br /&gt;
And add these lines to the template:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;editlink; ?&amp;gt;&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;task=edit&#039;&#039; in the url triggers the edit function in the controller. So let&#039;s add this method to our controller:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
* Method to call the edit form&lt;br /&gt;
*/&lt;br /&gt;
function edit()&lt;br /&gt;
{&lt;br /&gt;
	JRequest::setVar( &#039;layout&#039;, &#039;form&#039; );&lt;br /&gt;
	parent::display();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
Before adding the model to the view, we change the layout to our edit form.&lt;br /&gt;
&lt;br /&gt;
Of course we have to provide this form. Create the file components/com_hello/views/hello/tmpl/form.php:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col100&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_( &#039;Details&#039; ); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;table class=&amp;quot;admintable&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;greeting&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;input class=&amp;quot;text_area&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;greeting&amp;quot; id=&amp;quot;greeting&amp;quot; size=&amp;quot;25&amp;quot; maxlength=&amp;quot;25&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;greeting;?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Content&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;?php&lt;br /&gt;
					$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
					echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;id&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;hello-&amp;gt;id; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;save&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Most of this is just like the form of the backend. The important addition in this form is how we call the editor:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The paramaters of the display method are:&lt;br /&gt;
    * string $name: The control name&lt;br /&gt;
    * string $html: The contents of the text area&lt;br /&gt;
    * string $width: The width of the text area (px or %)&lt;br /&gt;
    * string $height: The height of the text area (px or %)&lt;br /&gt;
    * int $col: The number of columns for the textarea&lt;br /&gt;
    * int $row: The number of rows for the textarea&lt;br /&gt;
    * boolean $buttons: True and the editor buttons will be displayed&lt;br /&gt;
    * array $params: Associative array of editor parameters&lt;br /&gt;
&lt;br /&gt;
== Save the data ==&lt;br /&gt;
&lt;br /&gt;
Next we need to add the save and cancel buttons and for some extra security we add a token to the form.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo JHTML::_( &#039;form.token&#039; ); ?&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;save&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Save&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;submitbutton(&#039;cancel&#039;)&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Cancel&#039;) ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The buttons call some javascript which is added on the top of the form file after the first line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
function submitbutton(pressbutton) {&lt;br /&gt;
	var form = document.adminForm;&lt;br /&gt;
	if (pressbutton == &#039;cancel&#039;) {&lt;br /&gt;
		submitform( pressbutton );&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;?php&lt;br /&gt;
		$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
		echo $editor-&amp;gt;save( &#039;content&#039; );&lt;br /&gt;
	?&amp;gt;&lt;br /&gt;
	submitform(pressbutton);&lt;br /&gt;
}&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the form we added the hidden field task with a value of save. This will trigger the save method inside the controller. So lets create this method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function save()&lt;br /&gt;
{&lt;br /&gt;
	// Check for request forgeries&lt;br /&gt;
	JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
    	&lt;br /&gt;
	// get the model&lt;br /&gt;
	$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
        &lt;br /&gt;
	//get data from request&lt;br /&gt;
	$post = JRequest::get(&#039;post&#039;);&lt;br /&gt;
	$post[&#039;content&#039;] = JRequest::getVar(&#039;content&#039;, &#039;&#039;, &#039;post&#039;, &#039;string&#039;, JREQUEST_ALLOWRAW);&lt;br /&gt;
        &lt;br /&gt;
	// let the model save it&lt;br /&gt;
	if ($model-&amp;gt;store($post)) {&lt;br /&gt;
		$message = JText::_(&#039;Success&#039;);&lt;br /&gt;
	} else {&lt;br /&gt;
		$message = JText::_(&#039;Error while saving&#039;);&lt;br /&gt;
		$message .= &#039; [&#039;.$model-&amp;gt;getError().&#039;] &#039;;&lt;br /&gt;
	}&lt;br /&gt;
	$this-&amp;gt;setRedirect(&#039;index.php?option=com_hello&#039;, $message);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
The standard way of getting the form data &#039;&#039;$post = JRequest::get(&#039;post&#039;);&#039;&#039; is not enough in the case of using a editor. This will filter the content, hence losing line breaks and paragraps. So we add an extra line to get the editor contents in a raw unfiltered way. This data will be passed to the model to save into the database.&lt;br /&gt;
&lt;br /&gt;
The store method in the model is now straightforward:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function store($data)&lt;br /&gt;
{&lt;br /&gt;
	// get the table&lt;br /&gt;
	$row =&amp;amp; $this-&amp;gt;getTable();&lt;br /&gt;
                &lt;br /&gt;
	// Bind the form fields to the hello table&lt;br /&gt;
	if (!$row-&amp;gt;bind($data)) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	// Make sure the hello record is valid&lt;br /&gt;
	if (!$row-&amp;gt;check()) {&lt;br /&gt;
		$this-&amp;gt;setError($this-&amp;gt;_db-&amp;gt;getErrorMsg());&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Store the web link table to the database&lt;br /&gt;
	if (!$row-&amp;gt;store()) {&lt;br /&gt;
		$this-&amp;gt;setError( $row-&amp;gt;getErrorMsg() );&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	return true;         &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try this on your website. You should be able to change the greeting and the contents.&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10707</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10707"/>
		<updated>2008-09-11T15:38:28Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]. If you haven&#039;t done already, install this component on your developing website and create a menu link to this component.&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT greeting, content FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add a similar line to assign the content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now refresh your frontend site and you should see the added content.&lt;br /&gt;
&lt;br /&gt;
== Edit form ==&lt;br /&gt;
&lt;br /&gt;
To edit the current record we must:&lt;br /&gt;
* Add a link to the edit form&lt;br /&gt;
* Add a new template to edit the data&lt;br /&gt;
* Save the data&lt;br /&gt;
&lt;br /&gt;
Creating a link to the edit form can be done in the template directly. But to keep the template nice and simple we will build the link in the view and pass in onto the template for displaying. Add this line to the view:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assignRef( &#039;editlink&#039;,	JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hello&amp;amp;task=edit&#039;) );&amp;lt;/source&amp;gt;&lt;br /&gt;
And add these lines to the template:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;editlink; ?&amp;gt;&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;task=edit&#039;&#039; in the url triggers the edit function in the controller. So let&#039;s add this method to our controller:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
* Method to call the edit form&lt;br /&gt;
*/&lt;br /&gt;
function edit()&lt;br /&gt;
{&lt;br /&gt;
	JRequest::setVar( &#039;layout&#039;, &#039;form&#039; );&lt;br /&gt;
	parent::display();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
Before adding the model to the view, we change the layout to our edit form.&lt;br /&gt;
&lt;br /&gt;
Of course we have to provide this form. Create the file components/com_hello/views/hello/tmpl/form.php:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col100&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_( &#039;Details&#039; ); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;table class=&amp;quot;admintable&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;greeting&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;input class=&amp;quot;text_area&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;greeting&amp;quot; id=&amp;quot;greeting&amp;quot; size=&amp;quot;25&amp;quot; maxlength=&amp;quot;25&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;greeting;?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Content&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;?php&lt;br /&gt;
					$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
					echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;id&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;hello-&amp;gt;id; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Most of this is just like the form of the backend. The important addition in this form is how we call the editor:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The paramaters of the display method are:&lt;br /&gt;
    * string $name: The control name&lt;br /&gt;
    * string $html: The contents of the text area&lt;br /&gt;
    * string $width: The width of the text area (px or %)&lt;br /&gt;
    * string $height: The height of the text area (px or %)&lt;br /&gt;
    * int $col: The number of columns for the textarea&lt;br /&gt;
    * int $row: The number of rows for the textarea&lt;br /&gt;
    * boolean $buttons: True and the editor buttons will be displayed&lt;br /&gt;
    * array $params: Associative array of editor parameters&lt;br /&gt;
&lt;br /&gt;
== Save the data ==&lt;br /&gt;
&lt;br /&gt;
(Work in progress)&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Intertron&amp;diff=10706</id>
		<title>User:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Intertron&amp;diff=10706"/>
		<updated>2008-09-11T15:34:03Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intertron ==&lt;br /&gt;
Intertron [http://www.intertron.nl] is my company name under which I am known on the Joomla! wiki and forum.&lt;br /&gt;
&lt;br /&gt;
My real name is Ronald Pijpers, I am freelance developer and you can contact me at: rpijpers@intertron.nl&lt;br /&gt;
You can contact me in Dutch or English.&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Intertron&amp;diff=10705</id>
		<title>User:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Intertron&amp;diff=10705"/>
		<updated>2008-09-11T15:32:56Z</updated>

		<summary type="html">&lt;p&gt;Intertron: New page: == Intertron == Intertron [http://www.intertron.nl] is my company name under which I am known on the Joomla! wiki and forum.  My real name is Ronald Pijpers, I am freelance developer and y...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intertron ==&lt;br /&gt;
Intertron [http://www.intertron.nl] is my company name under which I am known on the Joomla! wiki and forum.&lt;br /&gt;
&lt;br /&gt;
My real name is Ronald Pijpers, I am freelance developer and you can contact me at: rpijpers@intertron.nl&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10704</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10704"/>
		<updated>2008-09-11T15:25:35Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]. If you haven&#039;t done already, install this component on your developing website and create a menu link to this component.&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT greeting, content FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add a similar line to assign the content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now refresh your frontend site and you should see the added content.&lt;br /&gt;
&lt;br /&gt;
== Edit form ==&lt;br /&gt;
&lt;br /&gt;
To edit the current record we must:&lt;br /&gt;
* Add a link to the edit form&lt;br /&gt;
* Add a new template to edit the data&lt;br /&gt;
* Save the data&lt;br /&gt;
&lt;br /&gt;
Creating a link to the edit form can be done in the template directly. But to keep the template nice and simple we will build the link in the view and pass in onto the template for displaying. Add this line to the view:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assignRef( &#039;editlink&#039;,	JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hello&amp;amp;task=edit&#039;) );&amp;lt;/source&amp;gt;&lt;br /&gt;
And add these lines to the template:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;editlink; ?&amp;gt;&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;task=edit&#039;&#039; in the url triggers the edit function in the controller. So let&#039;s add this method to our controller:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
* Method to call the edit form&lt;br /&gt;
*/&lt;br /&gt;
function edit()&lt;br /&gt;
{&lt;br /&gt;
	JRequest::setVar( &#039;layout&#039;, &#039;form&#039; );&lt;br /&gt;
	parent::display();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
Before adding the model to the view, we change the layout to our edit form.&lt;br /&gt;
&lt;br /&gt;
Of course we have to provide this form. Create the file components/com_hello/views/hello/tmpl/form.php:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;col100&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_( &#039;Details&#039; ); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;table class=&amp;quot;admintable&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;greeting&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;input class=&amp;quot;text_area&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;greeting&amp;quot; id=&amp;quot;greeting&amp;quot; size=&amp;quot;25&amp;quot; maxlength=&amp;quot;25&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;greeting;?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td width=&amp;quot;100&amp;quot; align=&amp;quot;right&amp;quot; class=&amp;quot;key&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo JText::_( &#039;Content&#039; ); ?&amp;gt;:&lt;br /&gt;
				&amp;lt;/label&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
				&amp;lt;?php&lt;br /&gt;
					$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
					echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;id&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;hello-&amp;gt;id; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Most of this is just like the form of the backend. The important addition in this form is how we call the editor:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$editor =&amp;amp; JFactory::getEditor();&lt;br /&gt;
echo $editor-&amp;gt;display(&#039;content&#039;, $this-&amp;gt;content, &#039;550&#039;, &#039;400&#039;, &#039;60&#039;, &#039;20&#039;, false);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The paramaters of the display method are:&lt;br /&gt;
    * string $name: The control name&lt;br /&gt;
    * string $html: The contents of the text area&lt;br /&gt;
    * string $width: The width of the text area (px or %)&lt;br /&gt;
    * string $height: The height of the text area (px or %)&lt;br /&gt;
    * int $col: The number of columns for the textarea&lt;br /&gt;
    * int $row: The number of rows for the textarea&lt;br /&gt;
    * boolean $buttons: True and the editor buttons will be displayed&lt;br /&gt;
    * array $params: Associative array of editor parameters&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10703</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10703"/>
		<updated>2008-09-11T14:29:20Z</updated>

		<summary type="html">&lt;p&gt;Intertron: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table and add some intial text  into it by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&lt;br /&gt;
UPDATE jos_hello SET content = &#039;&amp;lt;p&amp;gt;The A &amp;quot;hello world&amp;quot; program is a computer program that prints out &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
 on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one&lt;br /&gt;
 of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI)&lt;br /&gt;
 contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter (&amp;quot;shell&amp;quot;) to perform the&lt;br /&gt;
 actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate&lt;br /&gt;
 signal, such as a LED being turned on, may substitute for the message.&amp;lt;p&amp;gt;&#039; WHERE `jos_hello`.`id` = 1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show the new field on the front end ==&lt;br /&gt;
&lt;br /&gt;
To show the new content we must:&lt;br /&gt;
* Change the model to read the field from the database&lt;br /&gt;
* Change the view to pass the value of the field into the template&lt;br /&gt;
* Change the template to actually show the text&lt;br /&gt;
&lt;br /&gt;
The model was stored in the file: components/com_hello/models/hello.php&amp;lt;br /&amp;gt;&lt;br /&gt;
We must change the query to get the new field from the database. The loadResult method only retrieves the first field of the record, so we change this in loadObject to get the data into an object.&lt;br /&gt;
Our new getGreeting() method will therefore look like:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function getGreeting()&lt;br /&gt;
{&lt;br /&gt;
	$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
	$query = &#039;SELECT greeting, content FROM #__hello&#039;;&lt;br /&gt;
	$db-&amp;gt;setQuery( $query );&lt;br /&gt;
	$greeting = $db-&amp;gt;loadObject();&lt;br /&gt;
&lt;br /&gt;
	return $greeting;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view was stored in the file: components/com_hello/views/hello/view.html.php&amp;lt;br /&amp;gt;&lt;br /&gt;
As a reminder: The view pulls the data from the model and fees the data into the template&amp;lt;br /&amp;gt;&lt;br /&gt;
Because the output of the model is now an object instead of just text, we change the line which assigns the greeting to the template to only assign the greeting text of the object. We add a similar line to assign the content to the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	$greeting = $this-&amp;gt;get( &#039;Greeting&#039; );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;greeting&#039;,	$greeting-&amp;gt;greeting );&lt;br /&gt;
	$this-&amp;gt;assignRef( &#039;content&#039;,	$greeting-&amp;gt;content );&lt;br /&gt;
		&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we will change the template in components/com_hello/views/hello/tmpl/default.php to become:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php // no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $this-&amp;gt;content; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10702</id>
		<title>J1.5:Using the editor in a component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_editor_in_a_component&amp;diff=10702"/>
		<updated>2008-09-11T13:46:13Z</updated>

		<summary type="html">&lt;p&gt;Intertron: New page: == Introduction ==  To get some interaction with the visitors of your website your visitors need to be able to add some content.  This article will show you how visitors can add some data ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To get some interaction with the visitors of your website your visitors need to be able to add some content.&lt;br /&gt;
&lt;br /&gt;
This article will show you how visitors can add some data using a rich text editor.&lt;br /&gt;
&lt;br /&gt;
Lets start with the component created in the article [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]] which lets the administrator add new entries to the database.&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01]&lt;br /&gt;
&lt;br /&gt;
== Expand the data model ==&lt;br /&gt;
&lt;br /&gt;
The model used in the tutorial can only hold a text of 25 characters. Lets add a new field which can be used to hold a lot more text, so we can save the editor contents.&lt;br /&gt;
&lt;br /&gt;
Use your favorite tool to access the php database and open the jos_hello tabel in your joomla database. Add a new field to this table by running this SQL statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;ALTER TABLE `jos_hello` ADD `content` TEXT NOT NULL ;&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=10397</id>
		<title>User talk:Intertron</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Intertron&amp;diff=10397"/>
		<updated>2008-08-29T16:23:53Z</updated>

		<summary type="html">&lt;p&gt;Intertron: New page: You can contact me in Dutch or English&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can contact me in Dutch or English&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Developing_a_MVC_Component/Introduction&amp;diff=10396</id>
		<title>J1.5:Developing a MVC Component/Introduction</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Developing_a_MVC_Component/Introduction&amp;diff=10396"/>
		<updated>2008-08-29T09:20:56Z</updated>

		<summary type="html">&lt;p&gt;Intertron: /* Creating the Entry Point */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A software framework is the base of an application that can be used by a developer. The framework in Joomla! 1.5 unleashes a great deal of power for them. The Joomla! code has been completely overhauled and cleaned up. This tutorial will guide you through the process of developing a component using the framework.&lt;br /&gt;
&lt;br /&gt;
The scope of this project will be to develop a simple Hello World! component. In future tutorials, this simple framework will be built upon to show the full power and versatility of the MVC design pattern in Joomla!&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
You need Joomla! 1.5 or greater for this tutorial.&lt;br /&gt;
&lt;br /&gt;
== Introduction to Model-View-Controller ==&lt;br /&gt;
While the idea behind a component may seem extremely simple, code can quickly become very complex as additional features are added or the interface is customized.&lt;br /&gt;
&lt;br /&gt;
Model-View-Controller (herein referred to as MVC) is a software design pattern that can be used to organize code in such a way that the business logic and data presentation are separate. The premise behind this approach is that if the business logic is grouped into one section, then the interface and user interaction that surrounds the data can revised and customized without having to reprogram the business logic.&lt;br /&gt;
&lt;br /&gt;
There are three main parts of an MVC component. They are described here in brief, but for a more thorough explanation, please refer to the links provided at the end of this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== Model ===&lt;br /&gt;
The model is the part of the component that encapsulates the application&#039;s data. It will often provide routines to manage and manipulate this data in a meaningful way in addition to routines that retrieve the data from the model. In our case, the model will contain methods to add, remove and update information about the greetings in the database. It will also contain methods to retrieve the list of greetings from the database. In general, the underlying data access technique should be encapsulated in the model. In this way, if an application is to be moved from a system that utilizes a flat file to store its information to a system that uses a database, the model is the only element that needs to be changed, not the view or the controller.&lt;br /&gt;
&lt;br /&gt;
=== View ===&lt;br /&gt;
The view is the part of the component that is used to render the data from the model in a manner that is suitable for interaction. For a web-based application, the view would generally be an HTML page that is returned to the data. The view pulls data from the model (which is passed to it from the controller) and feeds the data into a template which is populated and presented to the user. The view does not cause the data to be modified in any way, it only displays data retrieved from the model.&lt;br /&gt;
&lt;br /&gt;
=== Controller ===&lt;br /&gt;
The controller is responsible for responding to user actions. In the case of a web application, a user action is (generally) a page request. The controller will determine what request is being made by the user and respond appropriately by triggering the model to manipulate the data appropriately and passing the model into the view. The controller does not display the data in the model, it only triggers methods in the model which modify the data, and then pass the model into the view which displays the data.&lt;br /&gt;
&lt;br /&gt;
== Joomla! MVC Implementation ==&lt;br /&gt;
In Joomla!, the MVC pattern is implemented using three classes: [http://api.joomla.org/Joomla-Framework/Application/JModel.html JModel], [http://api.joomla.org/Joomla-Framework/Application/JView.html JView] and [http://api.joomla.org/Joomla-Framework/Application/JController.html JController]. For more detailed information about these classes, please refer to the API reference documentation (WIP).&lt;br /&gt;
&lt;br /&gt;
== Creating a Component ==&lt;br /&gt;
For our basic component, we only require five files:&lt;br /&gt;
&lt;br /&gt;
* hello.php - this is the entry point to our component&lt;br /&gt;
* controller.php - this file contains our base controller&lt;br /&gt;
* views/hello/view.html.php - this file retrieves the necessary data and pushes it into the template&lt;br /&gt;
* views/hello/tmpl/default.php - this is the template for our output&lt;br /&gt;
* hello.xml - this is an XML file that tells Joomla! how to install our component.&lt;br /&gt;
&lt;br /&gt;
=== Creating the Entry Point ===&lt;br /&gt;
Joomla! is always accessed through a single point of entry: index.php for the Site Application or administrator/index.php for the Administrator Application. The application will then load the required component, based on the value of &#039;option&#039; in the URL or in the POST data. For our component, the URL would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;index.php?option=com_hello&amp;amp;view=hello&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load our main file, which can be seen as the single point of entry for our component: components/com_hello/hello.php.&lt;br /&gt;
&lt;br /&gt;
The code for this file is fairly typical across components.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    Joomla.Tutorials&lt;br /&gt;
 * @subpackage Components&lt;br /&gt;
 * components/com_hello/hello.php&lt;br /&gt;
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1&lt;br /&gt;
 * @license    GNU/GPL&lt;br /&gt;
*/&lt;br /&gt;
&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;
// Require the base controller&lt;br /&gt;
&lt;br /&gt;
require_once( JPATH_COMPONENT.DS.&#039;controller.php&#039; );&lt;br /&gt;
&lt;br /&gt;
// Require specific controller if requested&lt;br /&gt;
if($controller = JRequest::getWord(&#039;controller&#039;)) {&lt;br /&gt;
    $path = JPATH_COMPONENT.DS.&#039;controllers&#039;.DS.$controller.&#039;.php&#039;;&lt;br /&gt;
    if (file_exists($path)) {&lt;br /&gt;
        require_once $path;&lt;br /&gt;
    } else {&lt;br /&gt;
        $controller = &#039;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create the controller&lt;br /&gt;
$classname    = &#039;HelloController&#039;.$controller;&lt;br /&gt;
$controller   = new $classname( );&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$controller-&amp;gt;execute( JRequest::getVar( &#039;task&#039; ) );&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first statement is a security check.&lt;br /&gt;
&lt;br /&gt;
JPATH_COMPONENT is the absolute path to the current component, in our case components/com_hello. If you specifically need either the Site component or the Administrator component, you can use JPATH_COMPONENT_SITE or JPATH_COMPONENT_ADMINISTRATOR.&lt;br /&gt;
&lt;br /&gt;
DS is the directory separator of your system: either &#039;/&#039; or &#039;\&#039;. This is automatically set by the framework so the developer doesn&#039;t have to worry about developing different versions for different server OSs. DS should always be used when referring to files on the local server.&lt;br /&gt;
&lt;br /&gt;
After loading the base controller, we check if a specific controller is needed. In this component, the base controller is the only controller, but we will leave this here for future use.&lt;br /&gt;
&lt;br /&gt;
JRequest:getVar() finds a variable in the URL or the POST data. So if our URL is index.php?option=com_hello&amp;amp;controller=controller_name, then we can retrieve our controller name in our component using: echo JRequest::getVar(&#039;controller&#039;);&lt;br /&gt;
&lt;br /&gt;
Now we have our base controller &#039;HelloController&#039; in com_hello/controller.php, and, if needed, additional controllers like &#039;HelloControllerController1&#039; in com_hello/controllers/controller1.php. Using this standard naming scheme will make things easy later on: &#039;{Componentname}{Controller}{Controllername}&#039;&lt;br /&gt;
&lt;br /&gt;
After the controller is created, we instruct the controller to execute the task, as defined in the URL: index.php?option=com_hello&amp;amp;task=sometask. If no task is set, the default task &#039;display&#039; will be assumed. When display is used, the &#039;view&#039; variable will decide what will be displayed. Other common tasks are save, edit, new...&lt;br /&gt;
&lt;br /&gt;
The controller might decide to redirect the page, usually after a task like &#039;save&#039; has been completed. This last statement takes care of the actual redirection.&lt;br /&gt;
&lt;br /&gt;
The main entry point (hello.php) essentially passes control to the controller, which handles performing the task that was specified in the request.&lt;br /&gt;
&lt;br /&gt;
Note that we don&#039;t use a closing php tag in this file: ?&amp;gt;. The reason for this is that we will not have any unwanted whitespace in the output code. This is default practice since Joomla! 1.5, and will be used for all php-only files.&lt;br /&gt;
&lt;br /&gt;
=== Creating the Controller ===&lt;br /&gt;
Our component only has one task - greet the world. Therefore, the controller will be very simple. No data manipulation is required. All that needs to be done is the appropriate view loaded. We will have only one method in our controller: display(). Most of the required functionality is built into the JController class, so all that we need to do is invoke the JController::display() method.&lt;br /&gt;
&lt;br /&gt;
The code for the base controller is:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    Joomla.Tutorials&lt;br /&gt;
 * @subpackage Components&lt;br /&gt;
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1&lt;br /&gt;
 * @license    GNU/GPL&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access&lt;br /&gt;
&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&lt;br /&gt;
&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;
 * @package    Joomla.Tutorials&lt;br /&gt;
 * @subpackage Components&lt;br /&gt;
 */&lt;br /&gt;
class HelloController extends JController&lt;br /&gt;
{&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to display the view&lt;br /&gt;
     *&lt;br /&gt;
     * @access    public&lt;br /&gt;
     */&lt;br /&gt;
    function display()&lt;br /&gt;
    {&lt;br /&gt;
        parent::display();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The JController constructor will always register a display() task and unless otherwise specified (using the registerDefaultTask() method), it will set it as the default task.&lt;br /&gt;
&lt;br /&gt;
This barebones display() method isn&#039;t really even necessary since all it does is invoke the parent constructor. However, it is a good visual clue to indicate what is happening in the controller.&lt;br /&gt;
&lt;br /&gt;
The JController::display() method will determine the name of the view and layout from the request and load that view and set the layout. When you create a menu item for your component, the menu manager will allow the administrator to select the view that they would like the menu link to display and to specify the layout. A view usually refers to a view of a certain set of data (i.e. a list of cars, a list of events, a single car, a single event). A layout is a way that that view is organized.&lt;br /&gt;
&lt;br /&gt;
In our component, we will have a single view called hello, and a single layout (default).&lt;br /&gt;
&lt;br /&gt;
=== Creating the View ===&lt;br /&gt;
The task of the view is very simple: It retrieves the data to be displayed and pushes it into the template. Data is pushed into the template using the JView::assignRef method.&lt;br /&gt;
&lt;br /&gt;
The code for the view is:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    Joomla.Tutorials&lt;br /&gt;
 * @subpackage Components&lt;br /&gt;
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1&lt;br /&gt;
 * @license    GNU/GPL&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
// no direct access&lt;br /&gt;
&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&lt;br /&gt;
&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;
 * @package    HelloWorld&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
class HelloViewHello extends JView&lt;br /&gt;
{&lt;br /&gt;
    function display($tpl = null)&lt;br /&gt;
    {&lt;br /&gt;
        $greeting = &amp;quot;Hello World!&amp;quot;;&lt;br /&gt;
        $this-&amp;gt;assignRef( &#039;greeting&#039;, $greeting );&lt;br /&gt;
&lt;br /&gt;
        parent::display($tpl);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Creating the Template ====&lt;br /&gt;
&lt;br /&gt;
Joomla! templates/layouts are regular PHP files that are used to layout the data from the view in a particular manner. The variables assigned by the JView::assignRef method can be accessed from the template using $this-&amp;gt;{propertyname} (see the template code below for an example).&lt;br /&gt;
&lt;br /&gt;
Our template is very simple: we only want to display the greeting that was passed in from the view:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// No direct access&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;greeting; ?&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Wrapping It All Up - Creating the hello.xml File ===&lt;br /&gt;
It is possible to install a component manually by copying the files using an FTP client and modifying the database tables. It is more efficient to create a package file that will allow the Joomla! Installer to do this for you. This package file contains a variety of information:&lt;br /&gt;
&lt;br /&gt;
* basic descriptive details about your component (i.e. name), and optionally, a description, copyright and license information.&lt;br /&gt;
* a list of files that need to be copied.&lt;br /&gt;
* optionally, a PHP file that performs additional install and uninstall operations.&lt;br /&gt;
* optionally, an SQL file which contains database queries that should be executed upon install/uninstall&lt;br /&gt;
&lt;br /&gt;
The format of the XML file is as follows:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;install type=&amp;quot;component&amp;quot; version=&amp;quot;1.5.0&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;name&amp;gt;Hello&amp;lt;/name&amp;gt;&lt;br /&gt;
 &amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
 &amp;lt;creationDate&amp;gt;2007-02-22&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;1.01&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 component ...&amp;lt;/description&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;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
  &amp;lt;filename&amp;gt;hello.php&amp;lt;/filename&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;views/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
  &amp;lt;filename&amp;gt;views/hello/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
  &amp;lt;filename&amp;gt;views/hello/view.html.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
  &amp;lt;filename&amp;gt;views/hello/tmpl/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
  &amp;lt;filename&amp;gt;views/hello/tmpl/index.html&amp;lt;/filename&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;
&lt;br /&gt;
  &amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
  &amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;filename&amp;gt;hello.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
   &amp;lt;filename&amp;gt;index.html&amp;lt;/filename&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;/install&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look closely you will notice that there are some files that will be copied that we have not discussed. These are the index.html files. An index.html file is placed in each directory to prevent prying users from getting a directory listing. If there is no index.html file, some web servers will list the directory contents. This is often undesirable. These files have the simple line:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;html&amp;gt;&amp;lt;body bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will simply display a blank page.&lt;br /&gt;
&lt;br /&gt;
The other file is the hello.php file. This is the entry point for the admin section of our component. Since we don&#039;t have an admin section of our component, it will have the same content as the index.html files at this point in time.&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
* mjaz&lt;br /&gt;
* staalanden&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
The component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8108/29433/com_hello1_01.zip com_hello1_01]&lt;/div&gt;</summary>
		<author><name>Intertron</name></author>
	</entry>
</feed>