I am using Magento 1.7. The namespace is called MasteringMagento with a module called example.

My index controller is like so:

class MasteringMagento_Example_IndexController extends Mage_Core_Controller_Front_Action {

    function indexAction() 

        return $this->renderLayout();


If inside the indexAction I put an echo statement for example, it works, but it won't display a .phtml file.

config.xml (inside app/code/local/MasteringMagento/example/etc

<?xml version ="1.0"?>
<!DOCTYPE config>






example.xml (inside app/design/frontend/base/default/layout

<?xml version ="1.0"?>
<!DOCTYPE config>

<layout version="0.1.0">
        <update handle="page_two_columns_right" />

        <reference name="content">
            <block type="core/template" template="example/welcome.phtml">

And I have a folder called example with a welcome.phtml file inside located in app/design/frontend/base/default/template

What am I missing?


If I remove

<reference name="content">
            <block type="core/template" template="example/welcome.phtml">

from example.xml

I get a blank content area, but if it's there I get the dog, the tags and newsletter update column, not sure if that makes a difference.

2 Answers 2


You might need to close your block tag

<block type="core/template" template="example/welcome.phtml"/>

I'm not a 100% sure right now but i think your block needs a unique name for it to be instantiated

<block type="core/template" name="example.index.welcome" template="example/welcome.phtml">


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.