I followed this tutorial to create the custom block in magento
http://www.gravitywell.co.uk/blog/post/how-to-creating-your-own-custom-block-in-magento
But nothing is showed when I open up home page or any other page. I have searched alot on web but unable to solve the issue.
The above tutorial did not mention where to create layout.xml file but I have created it at:
app\design\frontend\gravitywell\example\layout\layout.xml
It has just following code:
<block type="gravitywellexample/menu" name="menu" as="menu" template="gravitywell/menu.phtml" />
Any help will be highly appreciated.
Thanks in advance.
Here is local.xml
at app\design\frontend\gravitywell\example\layout
:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="right">
<block type="gravitywellexample/menu" name="menu" as="menu" template="gravitywell/menu.phtml" />
</reference>
</default>
</layout>
This is config.xml
at app\code\local\Gravitywell\Example\etc
:
<?xml version="1.0"?>
<config>
<modules>
<Gravitywell_Example>
<version>0.1.0</version>
</Gravitywell_Example>
</modules>
<global>
<blocks>
<gravitywellexample>
<class>Gravitywell_Example_Block</class>
</gravitywellexample>
</blocks>
</global>
</config>
Here is menu.phtml
at app\design\frontend\gravitywell\example\template\gravitywell
:
Hello Sir
config.xml
,layout.xml
and the.phtml
that your child is being called in.