3

I've been fighting a while with a problem, but I can't find a solution.

Here is the thing:

Got a module that I need to show in the sidebar of catalog product view so this is my module.xml in default/default/layout/module.xml (module.xml is fictional name)

garantiaextendida.xml:

<?xml version="1.0"?>
<layout>
<catalog_product_view>
    <reference name="right">
        <block type="garantiaextendida/garantias" name="garantias.banner" template="garantiaextendida/banner.phtml" />
    </reference>
</catalog_product_view>
</layout>

config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Felisiakluciano_Garantiaextendida>
            <version>1.0.1</version>
        </Felisiakluciano_Garantiaextendida>
    </modules>
     <admin>
        <routers>
            <garantiaextendida>
                <use>admin</use>
                <args>
                    <module>Felisiakluciano_Garantiaextendida</module>
                    <frontName>garantiaextendida</frontName>
                </args>
            </garantiaextendida>
        </routers>
    </admin>
    <adminhtml>
        <menu>
            <garantiaextendida module="garantiaextendida">
                <title>Garantia Extendida</title>
                <sort_order>72</sort_order>               
                <children>
                    <item module="garantiaextendida">
                        <title>Garantia Extendida Admin</title>
                        <sort_order>0</sort_order>
                        <action>garantiaextendida/adminhtml_garantias</action>
                    </item>
                </children>
            </garantiaextendida>
        </menu>
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <garantiaextendida>
                            <title>Garantia Extendida Admin</title>
                            <sort_order>200</sort_order>
                        </garantiaextendida>
                    </children>
                </admin>
            </resources>   
        </acl>
        <layout>
            <updates>
                <garantiaextendida>
                    <file>garantiaextendida.xml</file>
                </garantiaextendida>
            </updates>
        </layout>
    </adminhtml>  

    <global>
        <helpers>
        <garantiaextendida>
            <class>Felisiakluciano_Garantiaextendida_Helper</class>
        </garantiaextendida>
    </helpers>
        <blocks>
            <garantiaextendida>
                <!-- Set a block definition and lookup directory -->
                <class>Felisiakluciano_Garantiaextendida_Block</class>
            </garantiaextendida>
        </blocks>

        <models>
            <garantiaextendida>
                <!-- This is where we define our model directory -->
                <class>Felisiakluciano_Garantiaextendida_Model</class>
                <!-- Define a resource to create a custom table -->
                <resourceModel>felisiakluciano_garantiaextendida_mysql4</resourceModel>
            </garantiaextendida>

            <!-- Here's our resource model we'll use to create a database table -->
            <felisiakluciano_garantiaextendida_mysql4>
                <class>Felisiakluciano_Garantiaextendida_Model_Mysql4</class>
                <entities>
                    <!-- Let's define our table, we'll call it with the garantias name, but the real table is felisiakluciano_garantiaextendida_garantias -->
                    <!-- After we define our entity, we can call it with our model by calling felisiakluciano_garantiaextendida/garantias -->
                    <garantias>
                        <table>felisiakluciano_garantiaextendida_garantias</table>
                    </garantias>
                </entities>
            </felisiakluciano_garantiaextendida_mysql4>
        </models>

        <!-- And finally we define our resource setup script -->
<resources>
            <garantiaextendida_setup>
                <setup>
                    <module>Felisiakluciano_Garantiaextendida</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </garantiaextendida_setup>
            <garantiaextendida_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </garantiaextendida_write>
            <garantiaextendida_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </garantiaextendida_read>
        </resources>
    </global>


</config>

What am I doing wrong? Its like the file.xml is not being loaded or ignored. Please help me with this. Thanks a Lot, have a nice weekend.

2

Hi you need to define layout file for this at frontend area at config.xml

<frontend>
 <layout>
    <updates>
    <garantiaextendida>
        <file>garantiaextendida.xml</file> <!--  this layou xml  file(garantiaextendida) which is located at your template layout location  -->
    </garantiaextendida>
    </updates>
</layout>
</frontend>

Note: garantiaextendida.xml is layout file which is located at app/design/frontend/yourpackahe/yourtemplate/layout and code of this file:

<?xml version="1.0"?>
<layout>

<catalog_product_view>

                <reference name="right">
                    <block type="garantiaextendida/garantias" name="garantias.banner" template="garantiaextendida/banner.phtml" />
                </reference>

</catalog_product_view>

</layout>
  • THANKS YOU SO MUCH!@ , Totally Missed the <frontend> </frontend> part, youre great – lfelisiak Jan 17 '15 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.