<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Magento Coder &#187; HTML</title>
	<atom:link href="http://magentocoder.jigneshpatel.co.in/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://magentocoder.jigneshpatel.co.in</link>
	<description>hacks &#38; solutions for Magento Ecommerce development</description>
	<lastBuildDate>Sun, 19 Jun 2011 16:13:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>How to add a new body class to Magento layout</title>
		<link>http://magentocoder.jigneshpatel.co.in/how-to-add-a-new-body-class-to-magento-layout/</link>
		<comments>http://magentocoder.jigneshpatel.co.in/how-to-add-a-new-body-class-to-magento-layout/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 13:28:02 +0000</pubDate>
		<dc:creator>Jignesh</dc:creator>
				<category><![CDATA[Frontend]]></category>

		<guid isPermaLink="false">http://magentocoder.jigneshpatel.co.in/?p=89</guid>
		<description><![CDATA[Adding a CSS body class to Magento layouts seems very easy. In case you want different CSS body class for different module pages on frontend, what you need to do is to find the syntax: $this->loadLayout(); in module controller files and add some new lines just below it. Example: I want to set the &#8216;my-profile&#8217; class to all the customer pages on frontend. So I opened the AccountController.php &#038; edited the function indexAction(). Just below [...]]]></description>
			<content:encoded><![CDATA[<p>Adding a CSS body class to Magento layouts seems very easy.</p>
<p>In case you want different CSS body class for different module pages on frontend, what you need to do is to find the syntax: $this->loadLayout(); in module controller files and add some new lines just below it. </p>
<p>Example:<br />
I want to set the &#8216;my-profile&#8217; class to all the customer pages on frontend. So I opened the AccountController.php &#038; edited the function indexAction(). Just below the &#8216;$this->loadLayout();&#8217; I added few lines. So it will look as below.</p>
<pre class="brush: php; title: ;">
        $this-&gt;loadLayout();

	    if ($root = $this-&gt;getLayout()-&gt;getBlock('root')) {
	            $root-&gt;addBodyClass('my-profile');
	    }
</pre>
<p>However above code needed to be altered in the core code. So better to follow the below.</p>
<p>To update it via layout XML, </p>
<pre class="brush:php">
<reference name="root">
 <action method="addBodyClass"><className>my-profile</className></action>
</reference>
</pre>
<p>This will affect in the &lt;body&gt; tag.</p>
<pre class="brush:php">
&lt;body &lt;?php echo $this->getBodyClass()?'class="'.$this->getBodyClass().'"':'' ?&gt;&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://magentocoder.jigneshpatel.co.in/how-to-add-a-new-body-class-to-magento-layout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding a new Page Layout to Magento</title>
		<link>http://magentocoder.jigneshpatel.co.in/adding-a-new-page-layout-to-magento/</link>
		<comments>http://magentocoder.jigneshpatel.co.in/adding-a-new-page-layout-to-magento/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 06:19:52 +0000</pubDate>
		<dc:creator>Jignesh</dc:creator>
				<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://magentocoder.jigneshpatel.co.in/?p=82</guid>
		<description><![CDATA[Adding a new page layout in Magento is very simple. But why someone need to add a new page layout. Page layouts are already there. Well, that can be needed specially for a Home page. One of my friend faced many issues in managing the Home page with existing layout. As a result, he needed to write other codes as well to maintain the concurrency between other pages. If we do change in current layout, [...]]]></description>
			<content:encoded><![CDATA[<p>Adding a new page layout in Magento is very simple. But why someone need to add a new page layout. Page layouts are already there.</p>
<p>Well, that can be needed specially for a Home page. One of my friend faced many issues in managing the Home page with existing layout. As a result, he needed to write other codes as well to maintain the concurrency between other pages. If we do change in current layout, it would affect the other pages as well using the same layout.</p>
<p>So better way it to create a new layout.<br />
[The steps below are updated to make it work with Magento 1.4 as well]</p>
<p>Steps:</p>
<p>1. Open the file: app/etc/modules/Mage_All.xml<br />
Edit the  &lt;codePool &gt; tag to &#8216;local&#8217; such that it looks like: </p>
<pre class="brush:php">
<Mage_Page>
          <active>true</active>
          <codePool>local</codePool>
          <depends>
                  <Mage_Core />
           </depends>
</Mage_Page>
</pre>
<p>2. Copy config.xml<br />
from app/code/core/Mage/Page/etc/config.xml<br />
to app/code/local/Mage/Page/etc/config.xml</p>
<p>3. The file can be edited: app/code/local/Mage/Page/etc/config.xml<br />
Add new lines between &lt;layout&gt; .. &lt;/layout&gt; along with other layouts.</p>
<pre class="brush:php">
<page>
		<layouts>
.
.
		<home module="page" translate="label">
			<label>Home</label>
			<template>page/home.phtml</template>
			<layout_handle>page_home</layout_handle>
		</home>
.
.
		</layouts>
</page>
</pre>
<p>2. Create new file :  template/page/home.phtml along with 1column.phtml, 2columns-left.phtml etc.. You can just copy the existing code of one of the column layout phtml inside the home.phtml. Modify the code inside home.phtml as per your need.</p>
<p>3. On the Admin, Go To CMS -> Manage Pages. Edit the home page. Change the Layout to  &#8216;Home&#8217; under the &#8216;Design&#8217; Tab.</p>
<p><a href="http://magentocoder.jigneshpatel.co.in/wp-content/uploads/2009/11/new_pagelayout.png"><img src="http://magentocoder.jigneshpatel.co.in/wp-content/uploads/2009/11/new_pagelayout.png" alt="" title="new_pagelayout" width="580" height="150" class="alignnone size-full wp-image-124" /></a></p>
<p>This will apply the home.phtml to Home page.</p>
]]></content:encoded>
			<wfw:commentRss>http://magentocoder.jigneshpatel.co.in/adding-a-new-page-layout-to-magento/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

