Created CMS > Block and display it on product page as tabs following this tutorial


<block type="catalog/product_view_attributes" name="product.sizes" as="sizes" template="catalog/product/view/sizes.phtml">
    <action method="addToParentGroup"><group>detailed_info</group></action>
    <action method="setTitle" translate="value"><value>Size Guide</value></action>

From the above code, block title is set from admin and it will be shown as product tab even if its disabled from admin end.

  1. How can we show block only if its enabled from admin and check using some IF condition in xml ?

Also is it possible to show the title given from admin end rather than setting it from XML file ?

1 Answer 1


I am not sure if you can do it via XML. But modifying .phtml file you surely can show/hide the Tabs.
File to edit:


And update the following block of code:

<div class="product-collateral toggle-content tabs">
    <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
        <dl id="collateral-tabs" class="collateral-tabs">
            <?php foreach ($detailedInfoGroup as $alias => $html):?>
                <!-- Edit Starts -->
                if ($alias == 'sizes') {
                    $shouldHideSizeTab = false; # @todo add some condition on which it will hide
                    if ($shouldHideSizeTab) {
                        continue; # escapes size tab
                <!-- Edit Ends -->
                <dt class="tab"><span><?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?></span></dt>
                <dd class="tab-container">
                    <div class="tab-content"><?php echo $html ?></div>
            <?php endforeach;?>
    <?php endif; ?>
  • The tab should hide if status is diabled from admin. How can I implement in aobve code ? Commented Feb 17, 2015 at 7:35
  • What's the path (xml) to your settings?
    – MagePsycho
    Commented Feb 17, 2015 at 17:25

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.