<?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: Using PHP code on a CMS page (custom Block/module)</title>
	<atom:link href="http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php</link>
	<description>Magento Design and Development Information</description>
	<lastBuildDate>Wed, 30 Jun 2010 05:20:10 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Björn</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-872</link>
		<dc:creator>Björn</dc:creator>
		<pubDate>Sat, 27 Feb 2010 20:43:10 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-872</guid>
		<description>Thanks a lot for this great tutorial. I had quite some trouble getting the custom params. After a while I came up with the following solution:

public function getAttribute()
{
    return $this-&gt;_getData(&#039;my_param1&#039;);
}

protected function _toHtml()
{
    ...
    $var = $this-&gt;getAttribute();
    ...
}

One very important thing is to add the block into the cms content area and not to the layout updates!</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this great tutorial. I had quite some trouble getting the custom params. After a while I came up with the following solution:</p>
<p>public function getAttribute()<br />
{<br />
    return $this-&gt;_getData(&#8217;my_param1&#8242;);<br />
}</p>
<p>protected function _toHtml()<br />
{<br />
    &#8230;<br />
    $var = $this-&gt;getAttribute();<br />
    &#8230;<br />
}</p>
<p>One very important thing is to add the block into the cms content area and not to the layout updates!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Name</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-826</link>
		<dc:creator>Name</dc:creator>
		<pubDate>Fri, 11 Dec 2009 20:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-826</guid>
		<description>Forget that, I found it. Was having a few problems due to some cut&#039;n paste with wrong quotation marks.

If someone else like me, it&#039;s simply in : 
/app/design/frontend/your_interface/default/template/your_folder/your_file.phtml</description>
		<content:encoded><![CDATA[<p>Forget that, I found it. Was having a few problems due to some cut&#8217;n paste with wrong quotation marks.</p>
<p>If someone else like me, it&#8217;s simply in :<br />
/app/design/frontend/your_interface/default/template/your_folder/your_file.phtml</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Éric</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-825</link>
		<dc:creator>Éric</dc:creator>
		<pubDate>Fri, 11 Dec 2009 19:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-825</guid>
		<description>Where do we put the phtml file in Tom&#039;s solution ? It&#039;s interesting!</description>
		<content:encoded><![CDATA[<p>Where do we put the phtml file in Tom&#8217;s solution ? It&#8217;s interesting!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleksii</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-824</link>
		<dc:creator>Oleksii</dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-824</guid>
		<description>{{block type=&quot;mycompany_custom/test&quot; ...}} my_param1=&quot;value 1&quot; another_param=&quot;value 2&quot;}}
How i understand,  type=&quot;mycompany_custom/test&quot;  initiate call to class MyCompany_Custom_Block_Test, but i don&#039;t understand HOW called exactly _toHtml() function?? 
Sorry about my bad english)</description>
		<content:encoded><![CDATA[<p>{{block type=&#8221;mycompany_custom/test&#8221; &#8230;}} my_param1=&#8221;value 1&#8243; another_param=&#8221;value 2&#8243;}}<br />
How i understand,  type=&#8221;mycompany_custom/test&#8221;  initiate call to class MyCompany_Custom_Block_Test, but i don&#8217;t understand HOW called exactly _toHtml() function??<br />
Sorry about my bad english)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleksii</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-823</link>
		<dc:creator>Oleksii</dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-823</guid>
		<description>{{block type=&quot;mycompany_custom/test&quot; ...}} my_param1=&quot;value 1&quot; another_param=&quot;value 2&quot;}}
How i understand,  type=&quot;mycompany_custom/test&quot;  initiate call to class MyCompany_Custom_Block_Test, but i don&#039;t understand HOW called exactly _toHtml() function??</description>
		<content:encoded><![CDATA[<p>{{block type=&#8221;mycompany_custom/test&#8221; &#8230;}} my_param1=&#8221;value 1&#8243; another_param=&#8221;value 2&#8243;}}<br />
How i understand,  type=&#8221;mycompany_custom/test&#8221;  initiate call to class MyCompany_Custom_Block_Test, but i don&#8217;t understand HOW called exactly _toHtml() function??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-811</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Tue, 24 Nov 2009 09:30:39 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-811</guid>
		<description>Tom,

Thank you. Thank you Thank you. I love the simple solutions. Worked perfectly.  Been beating my head on this for a couple of hours now.</description>
		<content:encoded><![CDATA[<p>Tom,</p>
<p>Thank you. Thank you Thank you. I love the simple solutions. Worked perfectly.  Been beating my head on this for a couple of hours now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rizwan</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-729</link>
		<dc:creator>rizwan</dc:creator>
		<pubDate>Fri, 11 Sep 2009 06:46:59 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-729</guid>
		<description>thanks but there is another problem that how can i show my products images in a customize way in category page ......</description>
		<content:encoded><![CDATA[<p>thanks but there is another problem that how can i show my products images in a customize way in category page &#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahsan</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-724</link>
		<dc:creator>Ahsan</dc:creator>
		<pubDate>Fri, 04 Sep 2009 05:20:41 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-724</guid>
		<description>nice article!
@Tom Wao! will b great if it works ...
trying to implement Tom&#039;s way ...</description>
		<content:encoded><![CDATA[<p>nice article!<br />
@Tom Wao! will b great if it works &#8230;<br />
trying to implement Tom&#8217;s way &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-703</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Mon, 10 Aug 2009 08:45:59 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-703</guid>
		<description>If you don&#039;t want to create a module, the most simplest way is create an phtml file, and in your CMS page, call block {{block type=&quot;core/template&quot; param1=&quot;value1&quot; param2=&quot;value2&quot; template=&quot;your_folder/your_file.phtml&quot;}}
In your_file.phtml, you can do whatever you want ;)</description>
		<content:encoded><![CDATA[<p>If you don&#8217;t want to create a module, the most simplest way is create an phtml file, and in your CMS page, call block {{block type=&#8221;core/template&#8221; param1=&#8221;value1&#8243; param2=&#8221;value2&#8243; template=&#8221;your_folder/your_file.phtml&#8221;}}<br />
In your_file.phtml, you can do whatever you want <img src='http://www.exploremagento.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.exploremagento.com/magento/using-php-code-on-a-cms-page-custom-blockmodule.php/comment-page-1#comment-654</link>
		<dc:creator>David</dc:creator>
		<pubDate>Fri, 17 Jul 2009 14:49:26 +0000</pubDate>
		<guid isPermaLink="false">http://getfido.net/blog/?p=16#comment-654</guid>
		<description>Hello.
I have a small PHP and JS code that checks and sets some coockies as soon as a new visitor comes to our website. These coockies determine which website to direct the visitor to
http://www.domain.com
or
http://www.domain.com/international
and than it will remember to always direct him to the same ‘domain’

So based on this tutorial I thought I need to do this as a module and place the block code on the app/design/........./layout/page.xml

but, ofcourse since I’m not sure of what I’m doing I get the following error:
Fatal error: Call to a member function toHtml() on a non-object in C:\AppServ\www\app\code\core\Mage\Core\Block\Abstract.php on line 503 

Got ideas?
Here is the code: http://www.magentocommerce.com/boards/viewreply/155785/</description>
		<content:encoded><![CDATA[<p>Hello.<br />
I have a small PHP and JS code that checks and sets some coockies as soon as a new visitor comes to our website. These coockies determine which website to direct the visitor to<br />
<a href="http://www.domain.com" rel="nofollow">http://www.domain.com</a><br />
or<br />
<a href="http://www.domain.com/international" rel="nofollow">http://www.domain.com/international</a><br />
and than it will remember to always direct him to the same ‘domain’</p>
<p>So based on this tutorial I thought I need to do this as a module and place the block code on the app/design/&#8230;&#8230;&#8230;/layout/page.xml</p>
<p>but, ofcourse since I’m not sure of what I’m doing I get the following error:<br />
Fatal error: Call to a member function toHtml() on a non-object in C:\AppServ\www\app\code\core\Mage\Core\Block\Abstract.php on line 503 </p>
<p>Got ideas?<br />
Here is the code: <a href="http://www.magentocommerce.com/boards/viewreply/155785/" rel="nofollow">http://www.magentocommerce.com/boards/viewreply/155785/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
