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 -->
<catalog_product_view>
<reference name="product.reviews">
<action method="setTemplate">
<template>my/reviewcontainer/tabs.phtml</template>
</action>
</reference>
<reference name="product.info">
<action method="unsetChild">
<name>product.reviews</name>
</action>
<block type="reviewcontainer/tabs" name="product.reviews" as="reviews"
template="my/reviewcontainer/tabs.phtml" after="additional">
<action method="addToParentGroup">
<group>detailed_info</group>
</action>
<action method="setTitle" translate="value">
<value>Reviews (xxx)</value>
</action>
</block>
</reference>
</catalog_product_view>
</layout>
My etc/config.xml
looks like this:
<?xml version="1.0"?>
<config>
<modules>
<my_ReviewContainer>
<version>1.0.0</version>
</my_ReviewContainer>
</modules>
<!-- we are making changes to the frontend -->
<frontend>
<!-- we are making changes to the layout -->
<layout>
<!-- we are adding a new update file -->
<updates>
<!--
this child node name must be
unique throughout Magento
-->
<my_ReviewContainer>
<!-- the name of the layout file we are adding -->
<file>my/reviewcontainer.xml</file>
</my_ReviewContainer>
</updates>
</layout>
</frontend>
</config>
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).