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

  • SEARCH
  • Home
  • 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 7557049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:01:33+00:00 2026-05-30T12:01:33+00:00

I am creating a custom module in magento.I have created block class and phtml

  • 0

I am creating a custom module in magento.I have created block class and phtml file.But localhost/dev/index.php/testimonials/index/index is not showing the block?Any ideas?

Output should be “block loaded”.Instead i get this http://imageshack.us/photo/my-images/525/screenshotvs.png/

UPDATE

<block type="testimonials/front" name="testimonialindex" template="front.phtml" />

this code works under default handle.But its not working in <testimonials_index_index>

Here is the code

<?xml version="1.0"?>
<config>
    <modules>
        <Training_Testimonials>
            <version>1.0.0</version>
        </Training_Testimonials>
    </modules>

    <frontend>
        <routers>
            <training_testimonials>
                <use>standard</use>
                <args>
                    <module>Training_Testimonials</module>
                    <frontName>testimonials</frontName>
                </args>
            </training_testimonials>
        </routers>

        <layout>
            <testimonials_layout> 

                <file>testimonials.xml</file>
            </testimonials_layout>
        </layout>

    </frontend>

    <global>
        <blocks>
            <testimonials>
                <class>Training_Testimonials_Block</class>
            </testimonials>
        </blocks>
        <helpers>
            <testimonials>
                <class>Training_Testimonials_Helper</class>
            </testimonials>
        </helpers>
      <models>
        <testimonials>  <!-- group name must be uniqu -->
            <class>Training_Testimonials_Model</class>
            <resourceModel>testimonials_mysql4</resourceModel>
        </testimonials>
        <testimonials_mysql4>
            <class>Training_Testimonials_Model_Mysql4</class>
            <entities>
                <manager>  <!--Model name -->
                    <table>testimonials</table>
                </manager>
            </entities>
        </testimonials_mysql4>
      </models>
      <resources>
        <testimonials_read>          <!-- group name_ -->
            <connection>
                <use>core_read></use>
        </connection>
        </testimonials_read> 
        <testimonials_write>          <!-- group name_ -->
            <connection>
                <use>core_write></use>
            </connection>
        </testimonials_write> 
      </resources>
    </global>

</config>

Block Class

 // app/code/local/Training/Testimonials/Block/Front.php
    class Training_Testimonials_Block_Front extends Mage_Core_Block_Template
    {
        public function layout()
        {
            echo "Block loaded";
        }
    }

Layout file

<!-- app/design/frontend/default/wireframe/layout/testimonials.xml -->
    <?xml version="1.0"?>
    <layout version="0.1.0">
        <testimonials_index_index>
            <reference name="content">
                <block type="testimonials/front" name="testimonialindex" template="front.phtml" />
            </reference>
        </testimonials_index_index>
    </layout>
  • 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-30T12:01:35+00:00Added an answer on May 30, 2026 at 12:01 pm

    Correct code is

    <layout>
           <updates>
                <testimonials> 
                    <file>testimonials.xml</file>
                </testimonials>
           </updates>
    </layout> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a module that is used by creating a custom class loader. The
I created a custom block (by creating a module and doing a layout update
In Magento I'm creating a custom module and would love to be able to
I am creating custom membership provider for my asp.net application. I have also created
I am creating a custom module for a Magento ecommerce site, and the module
I would like to overwrite a form by creating a custom module. But therefor,
I am creating a custom Magento module, and I cannot get the setup resource
i am creating some custom exceptions as follows lib/exceptions.rb module Exceptions class MemberOverFlow <
I have done a magento custom module and I want to make a translation
I'm creating a custom module for displaying VirtueMart categories, but need to disable VirtueMart

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.