1

I have problem with overriding Magento extension Front-end layout. I have installed extension Youama Ajax Login and Register. Now I need to override layout of login and register.

My app/code/local/Tech/Theme/etc/config.xml file :

<frontend>
<layout>
        <updates>
            <tech_theme>
                <file>tech_ajaxlogin.xml</file>
            </tech_theme>
        </updates>
    </layout>
</frontend>

My tech_ajaxlogin.xml file contain same default extension xml (copied file) and changed

            <action ifconfig="youamaajaxlogin/settings/power"
                    method="setTemplate">
                <template>ajaxlogin/ajaxlogin.phtml</template>
            </action>

And ajaxlogin.phtml file in app/design/frontend/rwd/tech/template/ajaxlogin path.

Now I'm confused where exactly tech_ajaxlogin.xml file should be located to override base xml file. I have tried in many places. But no luck.

Any help appreciated

Edited:

Config.xml :

 <?xml version="1.0"?>

<config>
    <modules>
        <Tech_Theme>
            <version>0.1.0</version>
        </Tech_Theme>
    </modules>
    <global>
        <blocks>
            <tech_theme>
                <class>Tech_Theme_Block</class>
            </tech_theme>
        </blocks>
    <helpers>
            <tech_theme>
                <class>Tech_Theme_Helper</class>
            </tech_theme>  
        </helpers>
    <models>
            <tech_theme>
                <class>Tech_Theme_Model</class>

            </tech_theme>
            <youama_ajaxlogin>
                <rewrite>
                    <!-- Model -->
                    <ajaxregister>Tech_Theme_Model_Ajaxregister</ajaxregister>
                </rewrite>
            </youama_ajaxlogin>

        </models>

    </global>
    <frontend>
    <layout>
            <updates>
                <tech_theme>
                    <file>tech_ajaxlogin.xml</file>
                </tech_theme>
            </updates>
        </layout>
    </frontend>
</config>
1

It should be under your app/design/frontend/base/default/layout folder.

I suggest you change your layout file to this:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <default>
       <reference name="youamaajaxlogin">
          <action ifconfig="youamaajaxlogin/settings/power"
                    method="setTemplate">
                <template>ajaxlogin/ajaxlogin.phtml</template>
            </action>
       </reference>
    <default>
</layout>

Try making your module dependent:

app/etc/modules/Tech_Theme.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Tech_Theme>
            <active>true</active>
            <codePool>local</codePool>
            <depends><Youama_Ajaxlogin/></depends>
        </Tech_Theme>
    </modules>
</config>
  • I have placed there but it is not reflecting – stefun Jan 14 '16 at 13:28
  • See my edited post. I reckon you try to avoid copy/pasting the exact same layout from the original module as it would conflict. – Raphael at Digital Pianism Jan 14 '16 at 13:31
  • I have changed xml file. But It doesn't look like it is overridding xml file. Block is still rendering if any error is there in this xml file – stefun Jan 14 '16 at 13:44
  • Could you post full content of your config.xml file please ? Also could try making your module depends on the original module in your app/etc/modules xml file ? – Raphael at Digital Pianism Jan 14 '16 at 13:46
  • I have edited. How to make module depends on the original module which is extension in app/etc/modules xml file? – stefun Jan 14 '16 at 13:52

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.