Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Customizing layout updates without changing layout
 
kohril
Member
 
Total Posts:  44
Joined:  2007-12-23
Lille, northernFrance
 

Hi, I wonder if it is possible to customize an existing block without changing its initial definition file.

For example, I’d like to add a block in customer/account. Though, I developped a new module which layout update contains following code :

<layout version="0.1.0">

     <default>
     </default>
     
     <
customer_account_index>
         <
reference name="content">
                    <
block type="customerstore/customer_account_dashboard" name="customerstore_customer_account_dashboard" template="customerstore/customer/account/dashboard.phtml">
                    <
block type="customerstore/customer_account_dashboard_hello" name="customerstore_customer_account_dashboard_hello" as="hello" template="customerstore/customer/account/dashboard/hello.phtml"/>
                    <
block type="core/template" name="customerstore_customer_account_dashboard_top" as="top" />
                    <
block type="customerstore/customer_account_dashboard_info" name="customerstore_customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml"/>
                    <
block type="customerstore/customer_account_dashboard_newsletter" name="customerstore_customer_account_dashboard_newsletter" as="newsletter" template="customerstore/customer/account/dashboard/newsletter.phtml"/>
                    <
block type="customerstore/customer_account_dashboard_address" name="customerstore_customer_account_dashboard_address" as="aaddress" template="customerstore/customer/account/dashboard/address.phtml"/>
                 </
block>
         </
reference>
     </
customer_account_index>
     
</
layout>

My blocks are correctly added at the beginning of the content. But I didn’t manage to add my blocks at the bottom of the page. So, I’d like to know if there’s a way of changing the layout without editing customer.xml.

Moreover, if I want to append blocks to the block named “customer_account_dashboard” in customer.xml, I can’t add a reference to this block as it is usually done with “content” block. Indeed, the following code does not work :

<customer_account_index>
         <
reference name="content">
            <
reference name="customer_account_dashboard">
                    <
block type="customerstore/customer_account_dashboard" name="customerstore_customer_account_dashboard" template="customerstore/customer/account/dashboard.phtml">
                    <
block type="customerstore/customer_account_dashboard_hello" name="customerstore_customer_account_dashboard_hello" as="hello" template="customerstore/customer/account/dashboard/hello.phtml"/>
                    <
block type="core/template" name="customerstore_customer_account_dashboard_top" as="top" />
                    <
block type="customerstore/customer_account_dashboard_info" name="customerstore_customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml"/>
                    <
block type="customerstore/customer_account_dashboard_newsletter" name="customerstore_customer_account_dashboard_newsletter" as="newsletter" template="customerstore/customer/account/dashboard/newsletter.phtml"/>
                    <
block type="customerstore/customer_account_dashboard_address" name="customerstore_customer_account_dashboard_address" as="aaddress" template="customerstore/customer/account/dashboard/address.phtml"/>
                 </
block>
             </
reference
         
</reference>
     </
customer_account_index>

Could someone help ?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top