<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>CMS Lamp</title>
	<atom:link href="http://cmslamp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cmslamp.com</link>
	<description>Highlighted CMS features and tips</description>
	<pubDate>Mon, 26 Jan 2009 12:31:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Overwriting Joomla module or component views in the template</title>
		<link>http://cmslamp.com/2009/01/overwriting-joomla-module-or-component-views-in-the-template/</link>
		<comments>http://cmslamp.com/2009/01/overwriting-joomla-module-or-component-views-in-the-template/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 12:31:46 +0000</pubDate>
		<dc:creator>Eng</dc:creator>
		
		<category><![CDATA[Joomla]]></category>

		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://cmslamp.com/?p=33</guid>
		<description><![CDATA[Most of the Joomla modules and components have one or more templates that define how the content will be displayed by Joomla. These files are stored in the modules/mod_[module]/tmpl and components/com_[component]/views/[view]/tmpl folders and can be overwritten by the template.
Typical Joomla module has one view and this view is stored in file named default.php in the [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the Joomla modules and components have one or more templates that define how the content will be displayed by Joomla. These files are stored in the <strong>modules/mod_[module]/tmpl</strong> and <strong>components/com_[component]/views/[view]/tmpl</strong> folders and can be overwritten by the template.</p>
<p>Typical Joomla module has one view and this view is stored in file named <strong>default.php</strong> in the <strong>tmpl</strong> folder of the mode. Differently from modules, the standard components have several views, each for different component mode.</p>
<p>For example, the <strong>mod_poll</strong> module has one view that displays a list of poll options and buttons. The <strong>com_content</strong> component has several views: <strong>archive</strong>, <strong>article</strong>, <strong>category</strong>, <strong>frontpage</strong>, <strong>section</strong>.</p>
<p>Default views of the modules and components may be overwritten in the template by creating a file in specific location: the <strong>templates/[template]/html/com_[component]/[view]/</strong> folder for the component and the <strong>templates</strong><strong>/[template]/html/mod_[module]/</strong> folder for the module. While rendering, Joomla looks into these folders for files that overwrite views and if a file with the same name exists, it uses it instead of the default view file.</p>
<p>The <strong>Beez</strong> template, shipped with Joomla, overwrites the templates of several components and modules so you can look through its <strong>html</strong> folder to get examples on how to customize component and module views for different modes.</p>
]]></content:encoded>
			<wfw:commentRss>http://cmslamp.com/2009/01/overwriting-joomla-module-or-component-views-in-the-template/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wordpress widgets internals – Part 1</title>
		<link>http://cmslamp.com/2008/11/wordpress-widgets-internals-%e2%80%93-part-1/</link>
		<comments>http://cmslamp.com/2008/11/wordpress-widgets-internals-%e2%80%93-part-1/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 23:06:31 +0000</pubDate>
		<dc:creator>Eng</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://cmslamp.com/?p=30</guid>
		<description><![CDATA[Wordpress widgets are the reusable information blocks that admin can place in one of the theme sidebars. The widget can display any information: RSS feed records, Twitter account events, Facebook board events, stock quotes, geography of visitors, polls, etc.
Technically, Wordpress widget is a PHP function that may perform a variety of steps to produce the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Wordpress widgets</strong> are the reusable information blocks that admin can place in one of the theme sidebars. The widget can display any information: RSS feed records, Twitter account events, Facebook board events, stock quotes, geography of visitors, polls, etc.</p>
<p>Technically, Wordpress widget is a PHP function that may perform a variety of steps to produce the HTML fragment that will be inserted to sidebar. Sidebar calls these widget functions in the order and with parameters defined in administration part of the Wordpress site.</p>
<p>For example, let&#8217;s open the <strong>sidebar.php</strong> of the default Wordpress theme and analyze its content:</p>
<p><code>&lt;div id="sidebar"&gt;<br />
    &lt;ul&gt;<br />
    &lt;?php /* Widgetized sidebar, if you have the plugin installed. */<br />
        if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?&gt;<br />
        &lt;li&gt;<br />
        &lt;?php include (TEMPLATEPATH . '/searchform.php'); ?&gt;<br />
        &lt;/li&gt;<br />
        ...<br />
        &lt;?php endif; ?&gt;<br />
    &lt;/ul&gt;<br />
&lt;/div&gt;</code></p>
<p>The first <strong>if </strong>checks for existence of the <strong>dynamic_sidebar</strong> function and calls it. This function prints the widgets and returns <strong>true</strong> when the sidebar contains widgets and <strong>false</strong> otherwise. If the sidebar does not contain the widgets the default sidebar content, the <strong>if</strong> statement body, is displayed.</p>
<p>The <strong>dynamic_sidebar</strong> function calls the <strong>wp_get_sidebars_widgets</strong> function and iterate over its result, the list of sidebar widgets, calling callback function of the widgets.</p>
<p>The following table shows the list of default Wordpress widgets and their callback functions:</p>
<table border="0">
<tbody>
<tr>
<th>Widget</th>
<th>Callback function</th>
<th>Description</th>
</tr>
<tr>
<td>Pages</td>
<td>wp_widget_pages</td>
<td>Your blog&#8217;s WordPress Pages</td>
</tr>
<tr>
<td>Calendar</td>
<td>wp_widget_calendar</td>
<td>A calendar of your blog&#8217;s posts</td>
</tr>
<tr>
<td>Archives</td>
<td>wp_widget_archives</td>
<td>A monthly archive of your blog&#8217;s posts</td>
</tr>
<tr>
<td>Links</td>
<td>wp_widget_links</td>
<td>Your blogroll</td>
</tr>
<tr>
<td>Meta</td>
<td>wp_widget_meta</td>
<td>Log in/out, admin, feed and WordPress links</td>
</tr>
<tr>
<td>Search</td>
<td>wp_widget_search</td>
<td>A search form for your blog</td>
</tr>
<tr>
<td>Recent Posts</td>
<td>wp_widget_recent_entries</td>
<td>The most recent posts on your blog</td>
</tr>
<tr>
<td>Tag Cloud</td>
<td>wp_widget_tag_cloud</td>
<td>Your most used tags in cloud format</td>
</tr>
<tr>
<td>Categories</td>
<td>wp_widget_categories</td>
<td>A list or dropdown of categories</td>
</tr>
<tr>
<td>Text</td>
<td>wp_widget_text</td>
<td>Arbitrary text or HTML</td>
</tr>
<tr>
<td>RSS</td>
<td>wp_widget_rss</td>
<td>Entries from any RSS or Atom feed</td>
</tr>
<tr>
<td>Recent Comments</td>
<td>wp_widget_recent_comments</td>
<td>The most recent comments</td>
</tr>
</tbody>
</table>
<p>Information about available (or registered) widgets is stored in the <strong>$wp_registered_widgets </strong>global array variable and other functions query this variable to fetch the list of available widgets and get information about the widgets.</p>
<p>The widget can be registered with the<strong> wp_register_sidebar_widget </strong>function. This function calls the <strong>widgets_init</strong> action and modifies the <strong>$wp_registered_widgets</strong> array.</p>
<p>Here is the sample code fragments extracted from Wordpress that registers several widgets using the <strong>wp_register_sidebar_widget </strong>function:</p>
<p>The default Wordpress widgets are registered in the <strong>wp_widgets_init</strong> function. The following code fragment is extracted from this function:</p>
<p><code>$widget_ops = array('classname' =&gt; 'widget_pages', 'description' =&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;__( "Your blog's WordPress Pages") );<br />
wp_register_sidebar_widget('pages', __('Pages'), 'wp_widget_pages', $widget_ops);<br />
wp_register_widget_control('pages', __('Pages'), 'wp_widget_pages_control' );</code></p>
<p><code> </code></p>
<p><code>$widget_ops = array('classname' =&gt; 'widget_calendar', 'description' =&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;__( "A calendar of your blog's posts") );<br />
wp_register_sidebar_widget('calendar', __('Calendar'), 'wp_widget_calendar', $widget_ops);<br />
wp_register_widget_control('calendar', __('Calendar'),<br />
    'wp_widget_calendar_control' ); </code></p>
]]></content:encoded>
			<wfw:commentRss>http://cmslamp.com/2008/11/wordpress-widgets-internals-%e2%80%93-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Joomla front page</title>
		<link>http://cmslamp.com/2008/10/joomla-front-page/</link>
		<comments>http://cmslamp.com/2008/10/joomla-front-page/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 23:33:44 +0000</pubDate>
		<dc:creator>Eng</dc:creator>
		
		<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://cmslamp.com/?p=26</guid>
		<description><![CDATA[The front page of Joomla site contains of three major parts. The first depends on template and includes colors, styles, and position of elements. The second is the content, the menu items, and list of articles, login form, and other elements produced by Joomla modules. And the third is the content of a current displayed [...]]]></description>
			<content:encoded><![CDATA[<p>The front page of <strong>Joomla</strong> site contains of three major parts. The first depends on template and includes colors, styles, and position of elements. The second is the content, the menu items, and list of articles, login form, and other elements produced by Joomla modules. And the third is the content of a current displayed component.</p>
<p> </p>
<div id="attachment_28" class="wp-caption alignnone" style="width: 410px"><a href="http://cmslamp.com/wp-content/uploads/2008/10/joomla-components-content.png"><img class="size-full wp-image-28" title="joomla-components-content" src="http://cmslamp.com/wp-content/uploads/2008/10/joomla-components-content.png" alt="Joomla front page: green - modules, red - content, other - template" width="400" height="455" /></a><p class="wp-caption-text">Joomla front page: green - modules, red - content, other - template</p></div>
<p> </p>
<p> </p>
<p><strong>Joomla</strong> modules are located in the <strong>modules</strong> folder of the <strong>Joomla</strong> installation and after installation this folder contains 20 modules for menu, search, login form, banners, etc. They can be configured in <strong>Administration section &gt; Extensions &gt; Module manager</strong> and each module can be added several times on the page.</p>
<p>An instance of the module has common options, such as position, order, access level, title, list of pages on which the module should be displayed, and custom module-specific options. Horizontal or vertical menu type option of the mod_mainmenu is an example of such option.</p>
<p>Each module may have one or more templates, these templates are saved in the <strong>tmpl</strong> folder in the module folder. For example, the <strong>mod_poll</strong> module template is loaded from the <strong>modules\mod_poll\tmpl\default.php</strong> file. Each module can implement own method for loading template, but most of them use the common way for this, which allows template developer to overwrite the template of the module.</p>
<p>Typical rendering:</p>
<pre>$layout = JModuleHelper::getLayoutPath('mod_poll');
require ($layout);</pre>
<p>Some of the components have several templates, like <strong>mod_newsflash</strong> which has horizontal and vertical layout variations.</p>
<p>Content of the component is included by the following line in the template:</p>
<pre> &lt;jdoc:include type="component" /&gt;</pre>
<p>When the page template is processed by the HTML document class, this line is replaced with the</p>
<p><strong> JDocumentHTML::getBuffer(&#8217;component&#8217;) </strong> function call. <strong>getBuffer</strong> fetches the content saved by the following code fragment in <strong>application.php</strong>, line 125:</p>
<pre>function dispatch($component) {
      ...
      $contents = JComponentHelper::renderComponent($component);
      $document-&gt;setBuffer( $contents, 'component');
}</pre>
<p>The <strong>dispatch</strong> method is called by the following code fragment in <strong>index.php</strong>, line 68:</p>
<pre>$option = JRequest::getCmd('option');
$mainframe-&gt;dispatch($option);</pre>
<p>The <strong>$option</strong> variable contains string &#8216;com_content&#8217; for the front page request.</p>
<p>So, when the &#8216;com_content&#8217; string is passed to the <strong>JComponentHelper::renderComponent</strong> method, it loads the component options, includes main component file by constructing its name using the following pattern:</p>
<pre> components\com_{component_name}\{component_name}.php</pre>
<p>The content of the main component file specifies how the component processes the request and which operations the component supports. The <strong>com_content</strong> component creates instance of the <strong>ContentController</strong> class, registers several actions and then executes the action.</p>
<p>The <strong>ContentController</strong> class is based on the <strong>JController</strong> classes, which is defined in the <strong>libraries\joomla\application\component\controller.php</strong> file. The <strong>ContentController</strong> only defines the methods unique to the content article, such as <strong>display</strong>, <strong>edit</strong>, <strong>save</strong>, <strong>vote</strong>, etc.</p>
<p>The <strong>display</strong> method of the <strong>com_content</strong> component sets the current view selector, <strong>frontpage</strong> or <strong>article</strong>, and calls <strong>display</strong> method of its parent class, <strong>JController</strong>. The<strong> JController::display</strong> method creates instance of the view, using the parameter specified by the <strong>ContentController::display</strong> method and executes its <strong>display</strong> method. The view is created by including corresponding file from the <strong>components\com_content\views</strong> folder. When the front page is displayed, the <strong>frontpage\view.html.php</strong> is included. This view includes templates from the <strong>frontpage\tmpl</strong> folder.</p>
<p>The <strong>frontpage</strong> <strong>com_component</strong> view can be configured in <strong>Administration section &gt; Content &gt; Front Page Manager</strong>. The layout of the front page can be configured in <strong>Administration section &gt; Menus &gt; Main Menu &gt; Home item &gt; Parameters</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cmslamp.com/2008/10/joomla-front-page/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to work with Wordpress blog settings</title>
		<link>http://cmslamp.com/2008/10/work-withwordpress-blog-settings/</link>
		<comments>http://cmslamp.com/2008/10/work-withwordpress-blog-settings/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 23:37:04 +0000</pubDate>
		<dc:creator>Eng</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://cmslamp.com/?p=23</guid>
		<description><![CDATA[Wordpress blog settings are stored in the wp_options database table and can be read with the get_option($setting) function. This function applies pre_option_{setting} filters, checks whether the option is already loaded, and returns its value by fetching it from the database or from the cache. 
Wordpress has more then 90 options but most frequently used of [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span lang="EN-US">Wordpress blog settings are stored in the <strong>wp_options</strong> database table and can be read with the <strong>get_option($setting)</strong> function. This function applies <strong>pre_option_{setting}</strong> filters, checks whether the option is already loaded, and returns its value by fetching it from the database or from the cache. </span></p>
<p class="MsoNormal"><span lang="EN-US">Wordpress has more then 90 options but most frequently used of them are the following (in alphabet order):</span></p>
<p class="MsoNormal"> </p>
<ul>
<li><strong>blog_charset</strong></li>
<li><strong>blogname</strong></li>
<li><strong>date_format</strong></li>
<li><strong>default_category</strong></li>
<li><strong>default_ping_status</strong></li>
<li><strong>gmt_offset</strong></li>
<li><strong>home</strong></li>
<li><strong>permalink_structure</strong></li>
<li><strong>siteurl</strong></li>
<li><strong>time_format</strong></li>
</ul>
<p class="MsoNormal"><span lang="EN-US">There are several functions for managing options: <strong>update_option($name, $value)</strong>, <strong>add_option($name, $value, $depricated, autoload)</strong>, <strong>delete_option($name)</strong>.</span></p>
<p class="MsoNormal"><span lang="EN-US">Most of the options can be modified in <strong>wp-admin</strong>. For example, the &#8220;Front page displays&#8221; option that specifies whether front page should display list of latest posts or specific page can be configured on the &#8220;Reading Settings&#8221; page in the <strong>wp-admin/options-reading.php</strong> file. After modifying, this setting is saved by the <strong>wp-admin/options.php</strong> file in the <strong>show_on_front</strong>, <strong>page_on_front</strong>, and <strong>page_for_posts</strong> options.</span></p>
<p class="MsoNormal"><span lang="EN-US">With this information we can create a simple function that checks whether the current page is the front page of a Wordpress site:</span></p>
<p class="MsoNormal"><span lang="EN-US">function is_front_page2() {<br />
<span>  </span>if (&#8217;page&#8217; == get_option(&#8217;show_on_front&#8217;)<br />
<span>    </span>&amp;&amp; 0 != ($id = get_option(&#8217;page_on_front&#8217;))<br />
<span>    </span>&amp;&amp; null != ($page = get_page($id)))<br />
<span>    </span>return is_page($page-&gt;ID);<br />
<span>  </span>return is_home();<br />
}</span></p>
<p class="MsoNormal"><strong>is_front_page2</strong> was chosen because the is_front_page function exists, but it returns wrong result when <strong>show_on_front = &#8216;page&#8217; and page_on_front == 0 and page_for_posts</strong> != 0.</p>
]]></content:encoded>
			<wfw:commentRss>http://cmslamp.com/2008/10/work-withwordpress-blog-settings/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Creating new Joomla template</title>
		<link>http://cmslamp.com/2008/10/creating-new-joomla-template/</link>
		<comments>http://cmslamp.com/2008/10/creating-new-joomla-template/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 22:49:50 +0000</pubDate>
		<dc:creator>Eng</dc:creator>
		
		<category><![CDATA[Joomla]]></category>

		<category><![CDATA[Greenfield]]></category>

		<category><![CDATA[template]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://cmslamp.wordpress.com/?p=36</guid>
		<description><![CDATA[You can download the GreenField template on this page: GreenField template for Joomla.
The simplest way to create a new template is to base it on one of the existent template. Joomla is shipped with three templates, beez, JA_Purity, and rhuk_milkyway. rhuk_milkyway is the default template so let&#8217;s copy it to the greenfield folder and modify [...]]]></description>
			<content:encoded><![CDATA[<p><em>You can download the GreenField template on this page: <a href="http://cmslamp.com/themes-templates/joomla/greenfield-template/">GreenField template for Joomla</a>.</em></p>
<p>The simplest way to create a new template is to base it on one of the existent template. Joomla is shipped with three templates, beez, JA_Purity, and rhuk_milkyway. rhuk_milkyway is the default template so let&#8217;s copy it to the <strong>greenfield</strong> folder and modify its design.</p>
<div id="attachment_48" class="wp-caption alignnone" style="width: 430px"><a href="http://cmslamp.com/wp-content/uploads/2008/10/milkyway-template-for-joomla3.png"><img src="http://cmslamp.com/wp-content/uploads/2008/10/milkyway-template-for-joomla3.png" alt="Milkyway template" title="Milkyway template" width="420" height="290" class="size-full wp-image-48" /></a><p class="wp-caption-text">Milkyway template</p></div>
<div id="attachment_47" class="wp-caption alignnone" style="width: 430px"><a href="http://cmslamp.com/wp-content/uploads/2008/10/greenfield-template-for-joomla1.png"><img src="http://cmslamp.com/wp-content/uploads/2008/10/greenfield-template-for-joomla1.png" alt="The goal, Greenfield template." title="greenfield-template-for-joomla" width="420" height="290" class="size-full wp-image-47" /></a><p class="wp-caption-text">The goal, Greenfield template.</p></div>
<p>First, the template information in <strong>templateDetails.xml</strong> should be changed because Joomla reads the template name from this file and now we have two rhuk_milkyway templates. To change it, open the <strong>greenfield\templateDetails.xml</strong> file and change template information tags as follows:</p>
<p><code>&lt;name&gt;Green Field&lt;/name&gt;<br />
&lt;creationDate&gt;10/08/08&lt;/creationDate&gt;<br />
&lt;author&gt;CMS Lamp&lt;/author&gt;<br />
&lt;authorEmail&gt;cms.lamp@gmail.com&lt;/authorEmail&gt;<br />
&lt;authorUrl&gt;http://cmslamp.com/&lt;/authorUrl&gt;<br />
&lt;copyright&gt;&lt;/copyright&gt;<br />
&lt;license&gt;GNU/GPL&lt;/license&gt;<br />
&lt;version&gt;1.0.0&lt;/version&gt;<br />
&lt;description&gt;Nice green theme&lt;/description&gt;</code></p>
<p><span>The <strong>params</strong> section in templateDetails.xml may be removed and the content of the <strong>params.ini</strong> file can be removed too. Then we can continue by editing <strong>index.php</strong>.</span></p>
<p><span><strong>index.php</strong> has milkyway-related includes and HTML tags so let&#8217;s remove them: several links to styles, code related to text order (ltr/rtl), the id and class attrbites of the body tag, html tags in body tag. GreenField will not support complex layouting and some of the placeholders so all these content may be removed too (from <strong>index.php</strong> and <strong>templateDetails.xml</strong>).</span></p>
<p><span> We end up with a very simple <strong>index.php</strong>:</span></p>
<p><code>&lt;?php<br />
// no direct access<br />
defined( '_JEXEC' ) or exit( 'Restricted access' );<br />
?&gt;<br />
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br />
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;<br />
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="&lt;?php echo $this-&gt;language;<br />
?&gt;" lang="&lt;?php echo $this-&gt;language; ?&gt;" &gt;<br />
&lt;head&gt;<br />
&lt;jdoc:include type="head" /&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;!-- breadcrumb --&gt;<br />
&lt;jdoc:include type="modules" name="breadcrumb" /&gt;<br />
&lt;!-- message --&gt;<br />
&lt;jdoc:include type="message" /&gt;<br />
&lt;!-- left column --&gt;<br />
&lt;jdoc:include type="modules" name="left" style="rounded" /&gt;<br />
&lt;!-- main column --&gt;<br />
&lt;jdoc:include type="component" /&gt;<br />
&lt;!-- right column --&gt;<br />
&lt;jdoc:include type="modules" name="right" style="xhtml"/&gt;<br />
&lt;!-- page footer --&gt;<br />
&lt;jdoc:include type="modules" name="syndicate" /&gt;<br />
&lt;!-- powered by --&gt;<br />
&lt;?php echo JText::_('Powered by') ?&gt; &lt;a href="http://www.joomla.org"&gt;Joomla!&lt;/a&gt;,<br />
&lt;a href="http://cmslamp.com/joomla-template/greenfield"&gt;Joomla template&lt;/a&gt; by<br />
&lt;a href="http://cmslamp.com/"&gt;CMS Lamp&lt;/a&gt;.<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<p>and <strong>templateDetails.xml</strong>:</p>
<p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN"<br />
"http://dev.joomla.org/xml/1.5/template-install.dtd"&gt;<br />
&lt;install version="1.5" type="template"&gt;<br />
  &lt;name&gt;Green Field&lt;/name&gt;<br />
  &lt;creationDate&gt;10/08/08&lt;/creationDate&gt;<br />
  &lt;author&gt;CMS Lamp&lt;/author&gt;<br />
  &lt;authorEmail&gt;cms.lamp@gmail.com&lt;/authorEmail&gt;<br />
  &lt;authorUrl&gt;http://cmslamp.com/&lt;/authorUrl&gt;<br />
  &lt;copyright&gt;&lt;/copyright&gt;<br />
  &lt;license&gt;GNU/GPL&lt;/license&gt;<br />
  &lt;version&gt;1.0.0&lt;/version&gt;<br />
  &lt;description&gt;Nice green theme&lt;/description&gt;<br />
  &lt;files&gt;<br />
    &lt;filename&gt;index.php&lt;/filename&gt;<br />
    &lt;filename&gt;templateDetails.xml&lt;/filename&gt;<br />
    &lt;filename&gt;template_thumbnail.png&lt;/filename&gt;<br />
    &lt;filename&gt;params.ini&lt;/filename&gt;<br />
  &lt;/files&gt;<br />
  &lt;positions&gt;<br />
    &lt;position&gt;menu&lt;/position&gt;<br />
    &lt;position&gt;breadcrumb&lt;/position&gt;<br />
    &lt;position&gt;left&lt;/position&gt;<br />
    &lt;position&gt;right&lt;/position&gt;<br />
    &lt;position&gt;syndicate&lt;/position&gt;<br />
  &lt;/positions&gt;<br />
&lt;/install&gt;</code></p>
<p>Creating HTML template is a complex task, so I suppose that HTML template is available. In this case the next step is very simple: accuratelly copy the content from the HTML template to the GreenField Joomla template, placing <strong>&lt;jdoc:include &#8230; /&gt;</strong> in correct places.</p>
<p><span><strong>jdoc modules</strong> <strong>include </strong>allows to select block decorator. It may be one of the standard decorators defined in <strong>templates\system\html\modules.php</strong>: <strong>none</strong>, <strong>table</strong>, <strong>horz</strong>, <strong>xhtml</strong>, <strong>rounded</strong>, and <strong>outline</strong>, or template-specific decorators from <strong>html\modules.php</strong> file of the particular template.</span></p>
<p><span>The <strong>GreenField template</strong> has one decorator for blocks, called <strong>gfblock</strong>, which applied to the <strong>top, menu</strong>, <strong>left</strong>, and <strong>right </strong>placeholders. This decorator adds nice border and caption for the module blocks. The top placeholder processed differently: menu module output is changed to match the HTML template menu.</span></p>
<p>To make <strong>GreenField </strong>looks similar to the HTML template, site headline and slogan patrameters should be added. After registering parameters in <strong>templateDetails.xml</strong> and set their default values in <strong>params.ini</strong> they will appear in template parameters in Joomla adminstrating section.</p>
<p>And the final step is adding theme files to <strong>templateDetails.xml</strong>.</p>
<p><em>You can download the GreenField template on this page: <a href="http://cmslamp.com/themes-templates/joomla/greenfield-template/">GreenField template for Joomla</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://cmslamp.com/2008/10/creating-new-joomla-template/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How Joomla template index.php works</title>
		<link>http://cmslamp.com/2008/10/how-joomla-template-indexphp-works/</link>
		<comments>http://cmslamp.com/2008/10/how-joomla-template-indexphp-works/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 10:09:22 +0000</pubDate>
		<dc:creator>Eng</dc:creator>
		
		<category><![CDATA[Joomla]]></category>

		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://cmslamp.wordpress.com/?p=5</guid>
		<description><![CDATA[index.php is the main file of any Joomla template. This file is loaded by the CMS during displaying each page of the site. It inclides all necessary content, other PHP files, CSS styles, images and so on.
index.php may contain jdoc includes and PHP code blocks with custom PHP code. Since PHP is a very flexible [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span>index.php</span></strong><span> is the main file of any <strong>Joomla </strong>template. This file is loaded by the CMS during displaying each page of the site. It inclides all necessary content, other PHP files, CSS styles, images and so on.</span></p>
<p><span><strong><span>index.php</span></strong><span> may contain <strong>jdoc includes </strong>and PHP code blocks with custom PHP code. Since PHP is a very flexible language the code in PHP code blocks can do anything to build the output. Joomla CMS provides the developers with the API that simplifies the template development by providing shortcuts for frequently reused code fragments.</span></span></p>
<p><span> A few API examples:</span></p>
<p><span> &lt;link rel=&#34;stylesheet&#34; href=&#34;&lt;?php echo $this-&gt;baseurl;<br />
?&gt;/templates/system/css/system.css&#34; type=&#34;text/css&#34; /&gt;</span></p>
<p><span>&lt;?php if($this-&gt;countModules(&#8217;left&#8217;)) : ?&gt;<br />
&lt;div id=&#34;maincolumn&#34;&gt;<br />
&lt;?php else: ?&gt;<br />
&lt;div id=&#34;maincolumn_full&#34;&gt;<br />
&lt;?php endif; ?&gt;</span></p>
<p>As you may see on these examples, the <strong>index.php </strong>file is executed in the context of some object and this object has a few usefull methods and properties for template developers:</p>
<ul>
<li><strong>title</strong> - page title</li>
<li><strong>description</strong> - page description</li>
<li><strong>language</strong> - page language</li>
<li><strong>params</strong> - collection of template parameters, defined in <strong>templateDescription.xml</strong></li>
<li><strong>template</strong> - name of the template</li>
<li><strong>direction</strong> - document direction, ltr (left-to-right) or rtl (right-to-left)</li>
<li><strong>countModules(condition)</strong> - counts modules based on the given condition</li>
</ul>
<p>This object is an instance of the <strong>JDocumentHTML </strong>class, defined in the libraries\joomla\document\html\html.php file. By reviewing the code of that file you can find more information about properties and methods of this class.</p>
<p><strong><span>jdoc:include</span></strong><span> is a shortcut to the <strong>$this-&gt;getBuffer(type, name, args) </strong>function call. <strong>jdoc:include </strong>and <strong>getBuffer </strong>function create corresponded renderer class and executes its <strong>render(&#8230;) </strong>method. The following renderers are available:</span></p>
<ul>
<li><strong>component</strong> - outputs the component</li>
<li><strong>head</strong> - renders head HTML elements such as script, link, meta, style.</li>
<li><strong>message</strong> - displays message queue</li>
<li><strong>module</strong> - renders module blocks which are in the given placeholder.</li>
<li><strong>modules</strong> - renders all modules in the given placeholder.</li>
</ul>
<p>Among these renderers only <strong>module</strong> and <strong>modules</strong> can accept name and parameters. For the <strong>modules</strong> renderer the name argument contains placeholder name, for the <strong>module</strong> renderer the name contains module name that will be renderer.</p>
<p>The <strong>modules</strong> renderer calls the <strong>module</strong> renderer for each module placed in the placeholder and the <strong>module</strong> renderer calls <strong>JModuleHelper::renderModule(module, params)</strong> to render the module blocks.</p>
<p><strong><span>JModuleHelper</span></strong><span> is defined in libraries\joomla\application\module\helper.php and contains methods for loading module settings from the database and rendering the module.</span></p>
<p><span>Module performs the following steps to render its content:</span></p>
<ol>
<li>Initialize parameters, which are based on attributes of the <strong>jdoc:include </strong>tag.</li>
<li>Executing module PHP file from modules folder.</li>
<li>Framing module output with decorating function from the <strong>templates\system\html\modules.php</strong> or <strong>templates\{current_template}\html\modules.php</strong> file.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://cmslamp.com/2008/10/how-joomla-template-indexphp-works/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Joomla Template Files</title>
		<link>http://cmslamp.com/2008/10/joomla-template-files/</link>
		<comments>http://cmslamp.com/2008/10/joomla-template-files/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 23:27:59 +0000</pubDate>
		<dc:creator>Eng</dc:creator>
		
		<category><![CDATA[Joomla]]></category>

		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://cmslamp.wordpress.com/?p=3</guid>
		<description><![CDATA[Joomla template is set of files created with purpose to wrap up the content of the CMS into HTML tags with CSS rules and interractive JavaScript. The minimal template contains two files: templateDetails.xml and index.php.
Joomla reads templateDetails.xml to determine features template supports and files it contains. It also may contian definition of block placeholdes in [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://joomla.org" onclick="pageTracker._trackPageview('/outgoing/joomla.org?referer=');">Joomla template</a></strong> is set of files created with purpose to wrap up the content of the CMS into HTML tags with CSS rules and interractive JavaScript. The minimal template contains two files: <strong>templateDetails.xml</strong> and <strong>index.php</strong>.</p>
<p>Joomla reads <strong>templateDetails.xml</strong> to determine features template supports and files it contains. It also may contian definition of block placeholdes in the <strong>index.php</strong> file, template parameters, and author information.</p>
<p><strong>index.php</strong> is the main template file. It contains page layout, may include CSS files, script files, and images.</p>
<p>Theme may be parametrized, in this case <strong>templateDetails.xml</strong> should contain definition of parameters, which usually dropdown lists and sets of radio buttons. Selected parameter values are saved in <strong>params.ini</strong> and this file should be writable by <strong>Joomla</strong> and listed in the <strong>templateDetails.xml</strong> file.</p>
<p>The <strong>index.html</strong> file, which you may see in a lot of Joomla themes, are usually blank and used to prevent Web server with directory indexing turned on from displaying theme files. This file, as other theme files, should be listed in <strong>templateDetails.xml</strong> in the <strong>files</strong> section.</p>
<p>The <strong>template_thumbnail.png</strong> file contains small preview of the Joomla CMS with the template applied. This PNG file should have the following dimensions: width 206px and height 150px. This file does not directly impact on how theme works, but it very usefull for users when they selecting the theme for their sites.</p>
<p>Read more:</p>
<ul>
<li><a href="http://docs.joomla.org/Joomla!_1.5_Template_Tutorials_Project" onclick="pageTracker._trackPageview('/outgoing/docs.joomla.org/Joomla_1.5_Template_Tutorials_Project?referer=');">Joomla! 1.5 Template Tutorials Project</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://cmslamp.com/2008/10/joomla-template-files/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
