I want to create a module that changes the title and content of review tab in product page. So far I succeeded to do it using the layout in /app/design/frontend/base/default/layout/me/reviewcontainer.xml:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0.0">
    <!-- Product view -->
        <reference name="product.reviews">
            <action method="setTemplate">
        <reference name="product.info">
            <action method="unsetChild">
            <block type="reviewcontainer/tabs" name="product.reviews" as="reviews"
                   template="my/reviewcontainer/tabs.phtml" after="additional">
                <action method="addToParentGroup">
                <action method="setTitle" translate="value">
                    <value>Reviews (xxx)</value>

My etc/config.xml looks like this:

<?xml version="1.0"?>
    <!-- we are making changes to the frontend -->
        <!-- we are making changes to the layout -->
            <!-- we are adding a new update file -->
                    this child node name must be
                    unique throughout Magento
                    <!-- the name of the layout file we are adding -->

The template is in /app/design/frontend/base/default/template/my/reviewcontainer/tabs.phtml and has basic HTML.

Is it possible to change the Reviews (xxx) to be dynamically generated by a controller/model/block? If so, what files should I create and where should i put them (being newbie in Magento).

Second, is it possible for me to call some functions in this new controller from withing the tab template? (instead of writing HTML there).

  • I have answer for your 1st question. But 'm not clear about your requirement in second question. Jul 17, 2015 at 2:27

1 Answer 1


You need to do two things.

Step 1 :

Define <helpers> in your config.xml.


Then create new file helper in app/code/{local|community}/Namespace/Yourmodule/Helper/Data.php


class Namespace_Your module_Helper_Data extends Mage_Core_Helper_Abstract {
     public function yourfunction(){
       //your logic

Step 2:

Change your layout file as

<action method="setTitle" translate="value">
      <value helper="yourhelper/data/yourfunction"/>

So in this the value will get from your helper. In this way you can use your php login the layout file.

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.