<?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>velite Magento Blog &#187; Coding</title>
	<atom:link href="http://blog.velite.de/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.velite.de</link>
	<description>We make things happen...</description>
	<lastBuildDate>Sat, 30 Jan 2010 18:41:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>(Mass) Redirect Module for Magento</title>
		<link>http://blog.velite.de/mass-redirect-module-for-magento/</link>
		<comments>http://blog.velite.de/mass-redirect-module-for-magento/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 14:07:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Community Extensions]]></category>

		<guid isPermaLink="false">http://blog.velite.de/?p=375</guid>
		<description><![CDATA[
One of the things you have to deal with when switching from another e-commerce software to Magento are URL redirects.  Over the past years you (hopefully) received many incoming deep links. You surely know that incoming links are one of the main ranking factors for most search engines. So when you switch to another [...]]]></description>
			<content:encoded><![CDATA[<p><a class="entryimage" href="http://blog.velite.de/mass-redirect-module-for-magento/"><img class="entryimage" src="http://blog.velite.de/wp-content/themes/velite/images/mass-redirect-module-for-magento.jpg" alt="(Mass) Redirect Module for Magento" /></a></p>
<p>One of the things you have to deal with when switching from another e-commerce software to <a href="http://magentocommerce.com">Magento</a> are URL redirects.  Over the past years you (hopefully) received many incoming deep links. You surely know that incoming links are one of the main ranking factors for most search engines. So when you switch to another e-commerce software, these deep links get useless because they point to subpages that don&#8217;t exist (unless you don&#8217;t have the exact same URL structure in your new shop). The common way to solve this issue is just to do a 301 redirect (permantly redirect) from the old URLs to the new ones. You have the possibility to define the redirects in your .htaccess file or with the Magentos build-in &#8220;URL Rewrite Management&#8221; (in the Backend <em>&#8220;Catalog&#8221; -> &#8220;URL Rewrite Management&#8221;</em>).<span id="more-375"></span><br />
<br />
However, both of these methods have some disadvantages. The .htaccess file could be overwritten when you update Magento. Also if you change the URL structure inside Magento you&#8217;ll have to update the .htaccess file each time. The Magento build-in Tool is nice if you only have to do a couple of rewrites. But let&#8217;s say you have 2000 or more redirects you want to define&#8230; you can take a week off, because you have to define each redirect manually.<br />
<br />
I decided to write a small extension to give you an alternative way of defining redirects. Just named it <strong>&#8220;Massredirect&#8221;</strong>. You can download it <a href="http://data.velite.de/massredirect.tar" onClick="javascript: pageTracker._trackPageview('/download/massredirect'); ">here</a>. For installation just copy it into your Magento main folder and run the command <strong>&#8220;tar -xvf massredirect.tar&#8221;</strong>. This will extract the extension files to the desired places. Before you start defining the redirects, make sure you got rid of the cache and the extension shows up in the advanced tab of the configuration site. To define the redirects open the <strong>CSV file &#8220;redirects.csv&#8221;</strong> located in the folder <strong>&#8220;/app/code/local/Velite/Massredirect/etc/&#8221;</strong> in a text editor. Each row in the CSV defines a redirect. Basically there are two possibilties of defining a redirect:</p>
<h4><em>Possbility 1:</em></h4>
<p><em>old-URL;type;entity_id;website_id;store_id</em><br />
<br />
for example:<br />
<br />
<em>www.myshop.com/product.php?productid=123;product;5;1;1</em><br />
<br />
This will redirect a user typing the URL &#8220;www.myshop.com/product.php?productid=123&#8243; to the product page of the product with the ID 5 on the default website and store. Notice that the URL must be specified without <em>&#8220;http://&#8221;</em>. &#8220;type&#8221; can either be &#8220;product&#8221; or &#8220;category&#8221;.</p>
<h4><em>Possbility 2:</em></h4>
<p><em>old-URL;new-URL</em><br />
<br />
for example:<br />
<br />
<em>www.myshop.com/product.php?productid=123;www.myshop.com/my-nice-product.html</em><br />
<br />
Keep in mind that the second possbility has the same disadvantage like defining the redirects in the .htaccess file. This means, if you change the URL structure inside of Magento you will also have to update the CSV. However, you can mix both possibilities in the CSV file.</p>
<h4><em>So how does this extension work?</em></h4>
<p>Basically the <strong>preDispatch</strong> method of the <strong>Mage_Core_Controller_Varien_Action</strong> gets observed (the event is named <strong>&#8220;controller_action_predispatch&#8221;</strong>). If the requested action is <strong>&#8220;noRoute&#8221;</strong>, the CSV gets parsed and looked up if there is a mapping available for the typed-in URL. In that case the user (or the bot) gets redirected to the new URL (with a Status 301-Redirect).<br />
<br />
Feel free to make any further suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.velite.de/mass-redirect-module-for-magento/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Review of Mxperts jQuery extension &amp; conflicting overrides</title>
		<link>http://blog.velite.de/mxperts-jquery-extension-and-conflicting-overrides/</link>
		<comments>http://blog.velite.de/mxperts-jquery-extension-and-conflicting-overrides/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 22:30:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Community Extensions]]></category>

		<guid isPermaLink="false">http://blog.velite.de/?p=182</guid>
		<description><![CDATA[
Magento Experts (Mxperts) is the number one Magento related Blog in Germany. Today they released a Magento extension that allows you to easily load jQuery into your Magento store. You just have to install the extension and jQuery gets automatically loaded. In the configuration menu of your Magento backend there is a new section, where [...]]]></description>
			<content:encoded><![CDATA[<p><a class="entryimage" href="http://www.mxperts.de/extensionerweiterung-mxperts-jquery-base/"><img class="entryimage" src="http://blog.velite.de/wp-content/themes/velite/images/mxperts-jquery-extension.jpg" alt="Mxperts jQuery extension and conflicting overrides" /></a></p>
<p>Magento Experts (Mxperts) is the number one Magento related Blog in Germany. Today <a href="http://www.mxperts.de/extensionerweiterung-mxperts-jquery-base/">they</a> released a <a href="http://www.magentocommerce.com/extension/1619/mxperts--jquery-base">Magento extension</a> that allows you to easily load jQuery into your Magento store. You just have to install the extension and jQuery gets automatically loaded. In the configuration menu of your Magento backend there is a new section, where you can enable different settings like loading jQuery in the minified/compressed way or turning on/off the conflict mode. The extension keeps your jQuery version up-to-date but also allows you to specify a certain jQuery version to be loaded.<span id="more-182"></span><br />
<br />
I was actually interested in how the extension places the jQuery script-tag into the html header. So I had a look into the source code. What they basically do is overriding the block <em>Mage_Page_Block_Html_Head</em> with their own <em>Mxperts_Jquery_Block_Page_Html_Head</em>. Within their custom block they override the <em>getCssJsHtml()</em> method and append their script-tags inside of it. At the the end they call the <em>getCssJsHtml()</em> method of the parent class <em>Mage_Page_Block_Html_Head</em>, merge their script tags with the rest of the head content and finally return it. The extension does perfectly what it was made for. Mxperts did a great job indeed!<br />
<br />
I know it&#8217;s very common to override core classes within Magento extensions. I just asked myself what happens if two or more extensions override the same core class. To test what happens, I created a little extenstion with a block class which overrides the <em>Mage_Page_Block_Html_Head</em> class (just like the jQuery extension does). As I already supposed, only one override has effect in this case.<br />
<br />
This means, the more extensions (which modify a core class) you install in your Magento Admin Panel, the bigger is the risk that two extensions override the same core class. In order to solve such a conflict I guess you either have to merge both conflicting classes into one single class or you chain the classes (ExtensionClassA extends Core Class and ExtensionClassB extends ExtensionA). Somehow this is a big lack in Magento extension development in my opinion. Please correct me if I&#8217;m missing something.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.velite.de/mxperts-jquery-extension-and-conflicting-overrides/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend Framework redirect from www</title>
		<link>http://blog.velite.de/zend-framework-redirect-www-to-non-www/</link>
		<comments>http://blog.velite.de/zend-framework-redirect-www-to-non-www/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 14:09:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://blog.velite.de/?p=48</guid>
		<description><![CDATA[You may already know that velite.de is based on Zend Framework, just like Magento. For obvious reasons like SEO and style we wanted to redirect www.velite.de/foo to velite.de/foo. Even more because of the style fact than because of SEO. However, first I thought about implementing this by the standard mod_rewrite function in a .htaccess file. [...]]]></description>
			<content:encoded><![CDATA[<p>You may already know that velite.de is based on Zend Framework, just like Magento. For obvious reasons like SEO and style we wanted to redirect <em>www.velite.de/foo</em> to <em>velite.de/foo</em>. Even more because of the style fact than because of SEO. However, first I thought about implementing this by the standard mod_rewrite function in a .htaccess file. But I got the idea, it would be nicer realizing it within the Zend Framework itself. So I created a little Frontend Plugin I want to share with you, take a look:<br />
<code><br />
class My_Controller_Plugin_Wwwredir extends Zend_Controller_Plugin_Abstract<br />
{<br />
public function preDispatch(Zend_Controller_Request_Abstract $request)<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$piece = strtolower(substr($_SERVER['SERVER_NAME'],0,4));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (strcmp($piece, 'www.')==0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$url = 'http://' . substr($_SERVER['SERVER_NAME'],<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4).$_SERVER['REQUEST_URI'];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$response = $this-&gt;getResponse();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$response-&gt;setRedirect( $url, 301 );<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$response-&gt;sendResponse();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.velite.de/zend-framework-redirect-www-to-non-www/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Code Snippets</title>
		<link>http://blog.velite.de/magento-code-snippets/</link>
		<comments>http://blog.velite.de/magento-code-snippets/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 13:42:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://blog.velite.de/?p=37</guid>
		<description><![CDATA[
You want to start coding your own Magento extension and you are frustrated because Varien doesn&#8217;t provide a documentation? I also don&#8217;t have any documentation for you :-). But what helped me getting started are these Code-Snippets on snippi.net. The Website is run by Branko Ajzele. His blog is also a good ressource to get [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://snippi.net/" class="entryimage"><img src="http://blog.velite.de/wp-content/themes/velite/images/magento-code-snippets.jpg" alt="Magento Code Snippets" class="entryimage" /></a></p>
<p>You want to start coding your own Magento extension and you are frustrated because Varien doesn&#8217;t provide a documentation? I also don&#8217;t have any documentation for you :-). But what helped me getting started are these Code-Snippets on <a href="http://snippi.net/">snippi.net</a>. The Website is run by Branko Ajzele. His <a href="http://activecodeline.com/">blog</a> is also a good ressource to get information about extension programming for Magento.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.velite.de/magento-code-snippets/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
