Magento - plugin overwrite local.xml block -


i have local.xml file has following:

<default>    <cms_index_index translate="label">       <reference name="masthead">           <block type="page/html" template="cms/masthead/homepage.phtml" as="banners" />       </reference>    </cms_index_index translate="label"> </default> 

i have plugin has it's own config.xml - wish override above block template located in: /app/code/local/mageworx/geoip/cms/homepage.phtml.

the config.xml file different , looks like:

<config> <modules>     <mageworx_geoip>         <version>1.0.7</version>     </mageworx_geoip> </modules>  <frontend>     <translate>         <modules>             <mageworx_geoip>                 <files>                     <default>mageworx_geoip.csv</default>                 </files>             </mageworx_geoip>         </modules>     </translate>     <routers>         <geoip>             <use>standard</use>             <args>                 <module>mageworx_geoip</module>                 <frontname>geoip</frontname>             </args>         </geoip>     </routers>     <layout>         <updates>             <geoip>                 <file>geoip.xml</file>             </geoip>         </updates>     </layout>     <events>         <controller_action_predispatch>             <observers>                 <geoip>                     <type>singleton</type>                     <class>mageworx_geoip_model_observer</class>                     <method>geoipautoswitcher</method>                 </geoip>             </observers>         </controller_action_predispatch>         <controller_action_predispatch_directory_currency_switch>             <observers>                 <geoip>                     <type>singleton</type>                     <class>mageworx_geoip_model_observer</class>                     <method>setcurrency</method>                 </geoip>             </observers>         </controller_action_predispatch_directory_currency_switch>      </events> </frontend>  <global>     <models>         <geoip>             <class>mageworx_geoip_model</class>             <resourcemodel>geoip_mysql4</resourcemodel>         </geoip>         <geoip_mysql4>             <class>mageworx_geoip_model_mysql4</class>         </geoip_mysql4>         <core>             <rewrite>                 <store>mageworx_geoip_model_core_store</store>             </rewrite>         </core>     </models>     <resources>         <geoip_setup>             <setup>                 <module>mageworx_geoip</module>                 <class>mageworx_geoip_model_mysql4_setup</class>             </setup>             <connection>                 <use>core_setup</use>             </connection>         </geoip_setup>         <geoip_write>             <connection>                 <use>core_write</use>             </connection>         </geoip_write>         <geoip_read>             <connection>                 <use>core_read</use>             </connection>         </geoip_read>     </resources>     <blocks>         <geoip>             <class>mageworx_geoip_block</class>         </geoip>         <adminhtml>             <rewrite>                 <sales_order_view_info>mageworx_adminhtml_block_geoip_adminhtml_sales_order_view_info</sales_order_view_info>                 <customer_online_grid>mageworx_adminhtml_block_geoip_adminhtml_customer_online_grid</customer_online_grid>                 <system_store_edit_form>mageworx_adminhtml_block_geoip_adminhtml_system_store_edit_form</system_store_edit_form>             </rewrite>          </adminhtml>         <checkout>             <rewrite>                 <onepage_billing>mageworx_geoip_block_checkout_onepage_billing</onepage_billing>                 <onepage_shipping>mageworx_geoip_block_checkout_onepage_shipping</onepage_shipping>             </rewrite>         </checkout>         <customer>             <rewrite>                 <address_edit>mageworx_geoip_block_customer_address_edit</address_edit>             </rewrite>         </customer>     </blocks>     <helpers>         <geoip>             <class>mageworx_geoip_helper</class>         </geoip>     </helpers> </global>  <adminhtml>     <acl>         <resources>             <all><title>allow everything</title></all>             <admin>                 <children>                     <system>                         <children>                             <config>                                 <children>                                     <mageworx_customers translate="title" module="mageworx">                                     <title>mageworx &gt; customers</title>                                     <sort_order>1</sort_order>                                          <children>                                             <geoip translate="title" module="geoip">                                                 <title>geoip location</title>                                             </geoip>                                         </children>                                     </mageworx_customers>                                 </children>                             </config>                         </children>                     </system>                 </children>             </admin>         </resources>     </acl>     <layout>         <updates>             <geoip>                 <file>geoip.xml</file>             </geoip>         </updates>     </layout> </adminhtml>  <default>     <mageworx_customers>         <geoip>             <enable_store_switcher>1</enable_store_switcher>             <enable_currency_switcher>1</enable_currency_switcher>             <force_store_view>1</force_store_view>             <store_switcher_scope>1</store_switcher_scope>             <disable_store_switcher_key>off</disable_store_switcher_key>             <store_switcher_exception_urls>/paypal/*</store_switcher_exception_urls>             <db_type>1</db_type>             <db_path>lib/geoip/geoip.dat</db_path>             <enable_billing_country>1</enable_billing_country>             <enable_shipping_country>1</enable_shipping_country>             <enable_address_country>1</enable_address_country>         </geoip>     </mageworx_customers> </default> 

does know , should add in config.xml override local.xml block?

you can not override of block or action local.xml config.xml

here magento truth

config.xml , local.xml loaded together, along other xml file place in app/local. loaded in mage_core_model_config::loadbase()

public function loadbase()     {         $etcdir = $this->getoptions()->getetcdir();         $files = glob($etcdir.ds.'*.xml');         $this->loadfile(current($files));         while ($file = next($files)) {             $merge = clone $this->_prototype;             $merge->loadfile($file);             $this->extend($merge);         }         if (in_array($etcdir.ds.'local.xml', $files)) {             $this->_islocalconfigloaded = true;         }         return $this;     }  

and if want understand more local.xml, see this.

hope can understand more now.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -