Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6996685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:11:21+00:00 2026-05-27T20:11:21+00:00

I created a new module and I try to load a template in an

  • 0

I created a new module and I try to load a template in an action under indexcontroller. That template loaded properly but the basic/root templates are not loaded. Magento loaded only the template file what I specified in the XML. I explained the steps below what I followed.

  • Create a module named ‘Sample’.
  • Create a IndexController with a index action.
  • Create local.xml file under the dir app/design/frontend/default/default/layout/
  • Create sample_page.phtml under the dir app/design/frontend/default/default/template/sample/sample_page.phtml.

IndexController:

public function indexAction() {
    $this->loadLayout();
    $this->renderLayout();
}

local.xml:

<layout version="0.1.0">
<default>
</default>
<sample_index_index>
    <reference name="root">
        <block type="page/html" name="root" output="toHtml" template="sample/sample_page.phtml">
        </block>
    </reference>
</sample_index_index>

Could anybody find the issue what I done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:11:21+00:00Added an answer on May 27, 2026 at 8:11 pm

    The issue here is that you referenced the wrong layout block (“root” in your example). Doing that replace the entire set of blocks for page by the one you specify.
    To get all the blocks displayed (included yours), simply reference another layout block than “root“, for example “content“.

    You could also want to modify the root layout block for pages of your module, if that is the case, in the default handle, reference the root block and set a different template.

    Here is an example :

    <layout version="0.1.0">
        <default>
            <reference name="root"> 
                <action method="setTemplate">
                    <template>page/1column.phtml</template>
                </action>
            </reference>
        </default>
        <sample_index_index>
            <reference name="content">
                <block type="page/html" name="the_name_you_like" output="toHtml" template="sample/sample_page.phtml">
                </block>
            </reference>
        </sample_index_index>
    </layout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have play-framework application that uses one module which I've created by play new-module
I created a new View (LogView) in Infrastructure.Module project. This view will be used
I've created a custom module (which currently only defines a new Exception class), and
I created a new email box for general support questions. When I try to
I want to try this module https://github.com/creationix/nstore fore simple storage . But when i
I have created a Job Queue module that processes jobs and constructs social-network type
I have created a Python module that creates and populates several SQLite tables. Now,
I'm trying to create a new module for Sitefinity. I'm basing my module off
I've created new db via phpMyAdmin and while editing db privilages clicked delete localhost
I created a new SharePoint portal for testing purposes using a manually added HOSTS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.