3
votes

I'm trying to extend the magento class Mage_Cms_Block_Block. I've got my module active. I think the reason why its failing is to do with the config.xml.

<?xml version="1.0" encoding="UTF-8"?>
<config> 
    <modules>
        <VisibleBlocks_ShowBlocks>

            <!-- The version of our module, starting at 0.0.1 -->
            <version>0.0.1</version>

        </VisibleBlocks_ShowBlocks>

    </modules>
    <global>
        <blocks>
            <mage_cms>
                <rewrite>
                    <cms_blocks>VisibleBlocks_ShowBlocks_Block_Border</cms_blocks>
                </rewrite>
            </mage_cms>
        </blocks>
    </global>
</config>

Can someone explain to me what the tags inside the global tags mean? Can the tags inside rewrite be called anything?

3

3 Answers

4
votes

OK seems that asking the questions made it clearer to me. Hope this hasn't a waste of time for anyone. 'mage_cms' should be 'cms' as that is the module i'm extending and 'cms_blocks' should be 'block'.

0
votes

i have explain the details,please check

 <global>
            <blocks>
                <cms><!--module name of rewrite class mage_cms -->
                    <rewrite>
<!-- file path of Block of app/code/core/mage/cms/block.php -->
                         <blocks>VisibleBlocks_ShowBlocks_Block_Border</blocks>
                    </rewrite>
                </cms>
            </blocks>
        </global>
0
votes

<config> <global> <blocks> <cms> <rewrite> <block>VisibleBlocks_ShowBlocks_Block_Cms_Block</block> </rewrite> </cms> </blocks> </global> </config>

With these tags, we say we will configure a block of Magento’s core called cms and we will rewrite () the « block » block of this module

Also make sure your module is active & being displayed in system/config/Advanced