<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Programatically create Magento blocks and inject them into layout</title>
	<atom:link href="http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/feed/" rel="self" type="application/rss+xml" />
	<link>http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/</link>
	<description>Magento Design and Magento Development Professionals - Inchoo</description>
	<lastBuildDate>Fri, 12 Mar 2010 23:58:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Margots</title>
		<link>http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/comment-page-1/#comment-6354</link>
		<dc:creator>Margots</dc:creator>
		<pubDate>Wed, 03 Mar 2010 19:05:58 +0000</pubDate>
		<guid isPermaLink="false">http://inchoo.net/?p=2292#comment-6354</guid>
		<description>Can you create block in the xml layout file. For example, I want to use X block

X block name



X - new block that needs to be created, but how to do it in layout xml file?
Simply putting following will not work</description>
		<content:encoded><![CDATA[<p>Can you create block in the xml layout file. For example, I want to use X block</p>
<p>X block name</p>
<p>X &#8211; new block that needs to be created, but how to do it in layout xml file?<br />
Simply putting following will not work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mzouhel</title>
		<link>http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/comment-page-1/#comment-6188</link>
		<dc:creator>mzouhel</dc:creator>
		<pubDate>Fri, 12 Feb 2010 15:12:07 +0000</pubDate>
		<guid isPermaLink="false">http://inchoo.net/?p=2292#comment-6188</guid>
		<description>Can i add a custom template to my backend ?
i want print my orders in html format and i need to create a block under adminhtml :(</description>
		<content:encoded><![CDATA[<p>Can i add a custom template to my backend ?<br />
i want print my orders in html format and i need to create a block under adminhtml <img src='http://inchoo.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pneumatyka</title>
		<link>http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/comment-page-1/#comment-5854</link>
		<dc:creator>pneumatyka</dc:creator>
		<pubDate>Wed, 13 Jan 2010 08:02:46 +0000</pubDate>
		<guid isPermaLink="false">http://inchoo.net/?p=2292#comment-5854</guid>
		<description>Wonderfull, just what I was looking for simplest module possible. Thx!</description>
		<content:encoded><![CDATA[<p>Wonderfull, just what I was looking for simplest module possible. Thx!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cnboy</title>
		<link>http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/comment-page-1/#comment-2870</link>
		<dc:creator>cnboy</dc:creator>
		<pubDate>Wed, 22 Jul 2009 06:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://inchoo.net/?p=2292#comment-2870</guid>
		<description>thanks !it is helpful for me</description>
		<content:encoded><![CDATA[<p>thanks !it is helpful for me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Hansen</title>
		<link>http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/comment-page-1/#comment-2794</link>
		<dc:creator>Erik Hansen</dc:creator>
		<pubDate>Sun, 12 Jul 2009 05:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://inchoo.net/?p=2292#comment-2794</guid>
		<description>This comment box doesn&#039;t like XML tags - it replaced some XML tags from my previous post with ....

Here&#039;s the XML I posted:
&lt;block type=&quot;**/****&quot;&gt;...&lt;/block&gt;</description>
		<content:encoded><![CDATA[<p>This comment box doesn&#8217;t like XML tags &#8211; it replaced some XML tags from my previous post with &#8230;.</p>
<p>Here&#8217;s the XML I posted:<br />
&lt;block type=&quot;**/****&quot;&gt;&#8230;&lt;/block&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Hansen</title>
		<link>http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/comment-page-1/#comment-2793</link>
		<dc:creator>Erik Hansen</dc:creator>
		<pubDate>Sun, 12 Jul 2009 05:43:14 +0000</pubDate>
		<guid isPermaLink="false">http://inchoo.net/?p=2292#comment-2793</guid>
		<description>The &quot;createBlock&quot; method is used in quite a few controllers throughout the Magento codebase.  It&#039;s especially used in the Adminhtml module.  There are many places where a controller loads a block using the createBlock method, where that could have also been specified in a layout XML file.  The createBlock method is essentially a more direct way of loading a block as opposed to typing up the XML for that block in a layout file.

When you see a ... in a layout file, you should know that it ultimately gets loaded by the Mage_Core_Model_Layout class, the same object type that gets returned by $this-&gt;getLayout()</description>
		<content:encoded><![CDATA[<p>The &#8220;createBlock&#8221; method is used in quite a few controllers throughout the Magento codebase.  It&#8217;s especially used in the Adminhtml module.  There are many places where a controller loads a block using the createBlock method, where that could have also been specified in a layout XML file.  The createBlock method is essentially a more direct way of loading a block as opposed to typing up the XML for that block in a layout file.</p>
<p>When you see a &#8230; in a layout file, you should know that it ultimately gets loaded by the Mage_Core_Model_Layout class, the same object type that gets returned by $this-&gt;getLayout()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Hansen</title>
		<link>http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/comment-page-1/#comment-2792</link>
		<dc:creator>Erik Hansen</dc:creator>
		<pubDate>Sun, 12 Jul 2009 05:32:41 +0000</pubDate>
		<guid isPermaLink="false">http://inchoo.net/?p=2292#comment-2792</guid>
		<description>Thanks for another helpful post.

The code above can also be written as follows:
$block = $this-&gt;getLayout()-&gt;createBlock(
    &#039;core/template&#039;,
     &#039;my_block_name_here&#039;)
)-&gt;setTemplate(&#039;activecodeline/developer.phtml&#039;);

Is it not better to load the Block using it&#039;s &quot;alias name&quot;, so that in case it gets overridden by another module, the overridden class will be loaded?</description>
		<content:encoded><![CDATA[<p>Thanks for another helpful post.</p>
<p>The code above can also be written as follows:<br />
$block = $this-&gt;getLayout()-&gt;createBlock(<br />
    &#8216;core/template&#8217;,<br />
     &#8216;my_block_name_here&#8217;)<br />
)-&gt;setTemplate(&#8216;activecodeline/developer.phtml&#8217;);</p>
<p>Is it not better to load the Block using it&#8217;s &#8220;alias name&#8221;, so that in case it gets overridden by another module, the overridden class will be loaded?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Branko Ajzele</title>
		<link>http://inchoo.net/ecommerce/magento/programatically-create-magento-blocks-and-inject-them-into-layout/comment-page-1/#comment-2520</link>
		<dc:creator>Branko Ajzele</dc:creator>
		<pubDate>Fri, 12 Jun 2009 14:06:35 +0000</pubDate>
		<guid isPermaLink="false">http://inchoo.net/?p=2292#comment-2520</guid>
		<description>Another example on how to space the block to any area of screen

$this-&gt;getLayout()-&gt;getBlock(&#039;right&#039;)-&gt;insert($block, &#039;catalog.compare.sidebar&#039;, true);

This will position it on right sidebar under the &#039;catalog.compare.sidebar&#039; block.</description>
		<content:encoded><![CDATA[<p>Another example on how to space the block to any area of screen</p>
<p>$this->getLayout()->getBlock(&#8216;right&#8217;)->insert($block, &#8216;catalog.compare.sidebar&#8217;, true);</p>
<p>This will position it on right sidebar under the &#8216;catalog.compare.sidebar&#8217; block.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
