<?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>Snippets Lab</title>
	<atom:link href="http://snippetslab.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://snippetslab.com</link>
	<description>Code snippets to help development in Magento, Expression Engine and more</description>
	<lastBuildDate>Fri, 05 Nov 2010 17:30:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Adding correct link paths in Magento</title>
		<link>http://snippetslab.com/magento/adding-correct-link-paths-in-magento/</link>
		<comments>http://snippetslab.com/magento/adding-correct-link-paths-in-magento/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 10:14:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://snippetslab.com/?p=11</guid>
		<description><![CDATA[When developing a Magento theme it is better practice to use the specific Magento code for creating site wide links instead of using specific paths. The code to create the correct link path withing the CMS section of the admin panel: &#60;a href=&#34;{{store direct_url=&#34;your-page&#34;}}&#34;&#62;Link text&#60;/a&#62; To create links in the .phtml template files use this [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>When developing a Magento theme it is better practice to use the specific Magento code for creating site wide links instead of using specific paths.<br />
<span id="more-11"></span></p>
<p>The code to create the correct link path withing the CMS section of the admin panel:</p>
<pre class="brush: xml;">&lt;a href=&quot;{{store direct_url=&quot;your-page&quot;}}&quot;&gt;Link text&lt;/a&gt;</pre>
<p>To create links in the .phtml template files use this code:</p>
<pre class="brush: xml;">&lt;a href=&quot;&lt;?php echo $this-&gt;getUrl('your-page') ?&gt;&quot;&gt;Link text&lt;/a&gt;</pre>
<p>Using this code Magento will create the correct path in the link for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://snippetslab.com/magento/adding-correct-link-paths-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding correct image paths in Magento</title>
		<link>http://snippetslab.com/magento/adding-correct-image-paths-in-magento/</link>
		<comments>http://snippetslab.com/magento/adding-correct-image-paths-in-magento/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 13:02:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://snippetslab.com/?p=9</guid>
		<description><![CDATA[Adding in image links when creating a theme in Magento requires a special snippet of code to ensure the path is correct. When you need to add in an image in Magento you first need to make sure the image is in the correct theme folder. To do this you need to place the image [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Adding in image links when creating a theme in Magento requires a special snippet of code to ensure the path is correct.<br />
<span id="more-9"></span><br />
When you need to add in an image in Magento you first need to make sure the image is in the correct theme folder. To do this you need to place the image file in /skin/frontend/default/<strong>your_theme_name</strong>/images</p>
<p>Now if you need to add a link to this image in the admin panel when using the CMS section for pages or static blocks you simply use the below code.</p>
<pre>&lt;img src="{{skin_url="images/your_file_name.jpg"}}" alt="alt text" /&gt;</pre>
<p>This code will automatically put in the path to the theme you are currently using. </p>
<p>If you need to put an image link in an actual .phtml template file the same code can be used but it needs to be slightly modified to below.</p>
<pre>&lt;img src="&lt;?php echo($this-&gt;getSkinUrl('images/your_file_name.jpg')) ?&gt;" alt="at text" /&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://snippetslab.com/magento/adding-correct-image-paths-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Showing something on the homepage only in Magento</title>
		<link>http://snippetslab.com/magento/showing-something-on-the-homepage-only-in-magento/</link>
		<comments>http://snippetslab.com/magento/showing-something-on-the-homepage-only-in-magento/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 12:38:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://snippetslab.com/?p=7</guid>
		<description><![CDATA[Sometimes when building a Magento theme you may need to show something on the homepage only. This may be the welcome message in the header, or anything else for that matter which is in a PHTML file. PHTML files which are used site wide like the header or footer will by default appear throughout your [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Sometimes when building a Magento theme you may need to show something on the homepage only. This may be the welcome message in the header, or anything else for that matter which is in a PHTML file. PHTML files which are used site wide like the header or footer will by default appear throughout your Magento site.</p>
<p><span id="more-7"></span></p>
<p>In this example we will add some code to only show the welcome message on the homepage. We will do this using PHP. This example can be applied to any element in a PHTML file.</p>
<p>The default welcome message appears on the website using PHP in the header.phtml file. The actual text for the message itself is located in the Magento admin panel. (System &gt; Configuration &gt; Design).</p>
<p>In your theme folder you will need to make sure you have the header.phtml file. This will be located in <strong>theme name &gt; template &gt; page &gt; html</strong></p>
<p>Open up the file and look for:</p>
<pre> &lt;p class="welcome-msg"&gt;&lt;?php echo $this-&gt;getWelcome()?&gt;&lt;/p&gt;</pre>
<p>This is the code which pulls the text from the Magento admin panel and displays it on the website.</p>
<p>Now to add the PHP to show this on the homepage only:</p>
<pre>&lt;?php if ($this-&gt;getIsHomePage()):?&gt;
&lt;p class="welcome-msg"&gt;&lt;?php echo $this-&gt;getWelcome()?&gt;&lt;/p&gt;
&lt;?php endif?&gt;</pre>
<p>Wrapping any code within a PHTML file in these PHP if tags will show up on the homepage only.</p>
]]></content:encoded>
			<wfw:commentRss>http://snippetslab.com/magento/showing-something-on-the-homepage-only-in-magento/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Removing a Magento store view</title>
		<link>http://snippetslab.com/magento/test-post/</link>
		<comments>http://snippetslab.com/magento/test-post/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 07:56:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://snippetslab.com/?p=5</guid>
		<description><![CDATA[Before installing a clean copy of Magento 1.4.1.1 I had installed the sample data available from Magento. When it came to adding my own real data I noticed there were 3 stores set up: English, French and German. I only required the English store so needed to remove the other two. Removing these extra stores [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Before installing a clean copy of Magento 1.4.1.1 I had installed the sample data available from <a title="Visit Magento download page" href="http://www.magentocommerce.com/download" target="_self">Magento</a>. When it came to adding my own real data I noticed there were 3 stores set up: English, French and German. I only required the English store so needed to remove the other two.</p>
<p><span id="more-5"></span></p>
<p>Removing these extra stores is very simple, although it helps if you know where to look.</p>
<ol>
<li>Log in to the Magento admin panel.</li>
<li>Go to System &gt; Manage Stores.</li>
<li>In here you will see all the stores that are currently set up.  You will see 3 orange buttons on the top right which allow you to create stores but no mention of removing/deleting.</li>
<li>To remove the store click on the &#8216;Store View Name&#8217; in the 3rd column. &#8216;Main Website&#8217; and &#8216;Main Store&#8217; do not have a delete option.</li>
<li>Now you are on the selected Store View screen you will see a delete button has appeared top right. When you hit this it will ask if you want to take a Database backup. As I was only removing stores from the sample data I had no need. I would recommend this if you are removing stores you might later need to recover data from. Once you select this option hit the large delete button underneath. This store view is now removed from Magento.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://snippetslab.com/magento/test-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

