1

I want to have a page where different divs will have the content of different modules.

Currently modules are navigated to by a left menu, which will be removed.

These are the menu items:

  1. /customer/account/
  2. /customer/account/edit/
  3. /sales/order/history/
  4. /discounts/
  5. /customerdashboard/index/paymentdetails/
  6. /customerdashboard/index/changepassword/
  7. /customerdashboard/deliverydetails/edit/

Now I want just a single page with this kind of presentation:

The intended layout:

+------------------+
| ------ | ------- |
| module | module  |
|    1   |    2    |
| -----  | ------- |
| module | module  |
|    3   |    4    |
| ------ | ------- |
+------------------+

This is my local.xml file, located at /app/design/frontend/pkgName/myClientName/layout (it's quite extensive):

<?xml version="1.0"?>
<layout version="0.1.0">
<!-- Default layout, loads most of the pages -->
<default>

    <remove name="left.permanent.callout"/>
    <remove name="right.permanent.callout"/>
    <remove name="paypal.partner.right.logo"/>
    <remove name="right.reports.product.viewed"/>
    <remove name="left.newsletter"/>
    <remove name="wishlist_sidebar"/>

    <reference name="head">
        <!-- CSS and JS files.. Removed for brevity -->

    </reference>

    <reference name="top.links">
        <action method="removeLinkByUrl">
            <url helper="customer/getAccountUrl"/>
        </action>
        <remove name="checkout_cart_link"/>
    </reference>
    <reference name="footer">
        <block type="cms/block" name="footer.customer.service" as="customerService">
            <action method="setBlockId">
                <block_id>footer_customer_service</block_id>
            </action>
        </block>
        <block type="newsletter/subscribe" name="newsletter" template="newsletter/subscribe.phtml"/>
        <block type="cms/block" name="footer.payment.logos" as="paymentLogos">
            <action method="setBlockId">
                <block_id>footer_payment_logos</block_id>
            </action>
        </block>
        <block type="cms/block" name="footer.bottom.links" as="bottomLinks">
            <action method="setBlockId">
                <block_id>footer_bottom_links</block_id>
            </action>
        </block>
    </reference>
    <reference name="right">
        <remove name="catalog.compare.sidebar"/>
        <remove name="cart_sidebar"/>
        <remove name="right.poll"/>
        <remove name="sale.reorder.sidebar"/>
    </reference>
    <reference name="left">
        <block type="cms/block" name="cms.category.sidebar.container">
            <action method="setBlockId">
                <block_id>cms_category_sidebar_container</block_id>
            </action>
        </block>
    </reference>
    <reference name="header">
        <block type="core/template" template="page/html/header/phone-menu.phtml" name="phone.menu" as="phoneMenu"/>
    </reference>
    <reference name="after_body_start">
        <block type="core/template" template="page/html/header/google-tag-manager.phtml" name="google-tag-manager" />
    </reference>
</default>

<!--
Load this update on every page when customer is logged in
-->

<customer_logged_in>
    <reference name="top.links">
        <action method="addLink" translate="label title">
            <label>My account</label>
            <url>customer/account</url>
            <!-- can use full url also -->
            <title>My account</title>
            <prepare>true</prepare>
            <!-- set true if adding base url param -->
            <urlParams/>
            <position>90</position>
        </action>
    </reference>
    <reference name="customer_account_navigation">
        <action method="addLink" translate="label title" module="customer">
            <label>Logout</label>
            <url>customer/account/logout</url>
            <title>Logout</title>
            <prepare/>
            <urlParams/>
            <position>10</position>
        </action>
    </reference>
</customer_logged_in>

<customer_account>
    <remove name="cms.category.sidebar.container"/>
    <reference name="left">
        <action method="unsetChild">
            <name>reorder</name>
        </action>
    </reference>
    <reference name="my.account.wrapper">
        <action method="setElementClass">
            <value>my-account</value>
        </action>
    </reference>
    <reference name="content">
        <action method="insert">
            <blockName>customer_account_navigation</blockName>
        </action>
    </reference>
    <reference name="customer_account_navigation">
        <action method="addLink" translate="label"><name>discounts</name><path>discounts</path><label>Krediteringer og rabatter</label></action>
        <action method="addLink" translate="label"><name>paymentdetails</name><path>customerdashboard/index/paymentdetails</path><label>Betalingsdetaljer</label></action>
        <action method="addLink" translate="label"><name>changepassword</name><path>customerdashboard/index/changepassword</path><label>Change password</label></action>
        <action method="addLink" translate="label"><name>deliverydetails</name><path>customerdashboard/deliverydetails/edit</path><label>Leveringsdetaljer</label></action>
        <action method="addLink" translate="label"><name>referral</name><path>myClientName/referral</path><label>Refer a friend</label></action>
    </reference>
</customer_account>

<customer_account_index>
    <reference name="customer_account_dashboard">
        <action method="unsetChild"><name>top</name></action>
    </reference>
    <reference name="my.account.wrapper">
        <reference name="customer_account_dashboard">
            <block type="core/template" name="customer.calendar" as="customer.calendar" template="customer/account/dashboard/customer.calendar.phtml"/>
            <block type="core/template" name="customer.calendar.inactive" as="customer.calendar.inactive" template="customer/account/dashboard/customer.calendar.inactive.phtml"/>
            <block type="core/template" name="customer.calendar.switch.link" as="customer.calendar.switch.link" template="customer/account/dashboard/customer.calendar.switch.link.phtml"/>
            <block type="core/template" name="customer.calendar.inactive.link" as="customer.calendar.inactive.link" template="customer/account/dashboard/customer.calendar.inactive.link.phtml"/>
        </reference>
    </reference>
     <reference name="my.account.wrapper">
        <block type="sales/order_history" name="sales.order.history">
            <block type="core/text_list" name="sales.order.history.info" as="info" translate="label">
                <label>Order History Info</label>
            </block>
        </block>
        <block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
    </reference>
</customer_account_index>

 <customer_account_login>
    <reference name="root">
        <action method="setTemplate"><template>page/customer.phtml</template></action>
    </reference>
    <reference name="customer_form_login">
        <block type="customer/account_forgotpassword" name="forgot.password.customers" template="customer/form/forgotpassword.phtml" />
    </reference>
</customer_account_login>

<customerdashboard_index_changepassword translate="label">
    <reference name="head">
        <action method="setTitle"><title>Endre Passord</title></action>
    </reference>
    <label>Change Password</label>
    <update handle="customer_account"/>
    <reference name="my.account.wrapper">
        <block type="core/template" name="customer.change.password" template="customer/form/change-password.phtml"/>
    </reference>
</customerdashboard_index_changepassword>

<customerdashboard_index_paymentdetails translate="label">
    <reference name="head">
        <action method="setTitle"><title>Betalingsdetaljer</title></action>
    </reference>
    <label>Betalingsdetaljer</label>
    <update handle="customer_account"/>
    <reference name="my.account.wrapper">
        <block type="core/template" name="payment.details" template="customer/form/payment-details.phtml"/>
    </reference>
</customerdashboard_index_paymentdetails>

<customerdashboard_deliverydetails translate="label">
    <label>Delivery Details</label>
    <update handle="customer_account"/>
    <reference name="my.account.wrapper">
        <block type="customerdashboard/deliverydetails" name="customer.delivery.details" template="customer/form/delivery.phtml"/>
    </reference>
</customerdashboard_deliverydetails>

<customerdashboard_deliverydetails_edit translate="label">
    <reference name="head">
        <action method="setTitle"><title>Leveringsdetaljer</title></action>
    </reference>
    <label>Leveringsdetaljer</label>
    <update handle="customer_account"/>
    <reference name="my.account.wrapper">
        <block type="customerdashboard/deliverydetails" name="customer.delivery.details" template="customer/form/delivery.phtml"/>
    </reference>
</customerdashboard_deliverydetails_edit>

<customer_account_nobillingagreement>
   <reference name="root">
        <action method="setTemplate">
            <template>page/customer.phtml</template>
        </action>
    </reference>
    <reference name="content">
        <block type="core/template" name="account.no.billing.agreement" template="customer/account/no-billing-agreement.phtml"/>
    </reference>
</customer_account_nobillingagreement>

<customer_account_logoutsuccess>
    <reference name="head">
        <action method="setTitle"><title>Logg Ut</title></action>
    </reference>
</customer_account_logoutsuccess>

</layout>

On "customer_account_index" I've already managed to get one of said modules to work (the ) but nothing else seems to work. The "sales_order_view" I've added aswell but doesn't seem to be doing anything.

Also on a matter of precedence, I think I might have a lot more code that should probably being overriden on my local.xml.

How can I achieve this?

Should I create a new module alltogether? I already defined a .phtml page which will hold the intended contents, but can't seem to make it work using local.xml

Can anyone help a little and point in the right direction please?

EDIT I've been thinking about this issue and I believe the right question to ask is:

Should I just define a single page (my-page.phtml) with all the relevant code from all the other .phtml files and define that one only as my "default" page?

Also, I should have mentioned that I'm a complete noob in terms of magento and I've been reading the documentation available in order to better understand these configurations, but any help moving a little faster in the intended direction is welcome and very much appreciated.

6
  • please add your local.xml code here
    – liyakat
    May 26, 2015 at 12:16
  • Oh sorry, forgot about that..
    – Zed_Blade
    May 26, 2015 at 13:29
  • Please add the part of the layout XML that is relevant to your question May 26, 2015 at 14:55
  • @SanderMangel updated with the parts I believe are relevant.
    – Zed_Blade
    May 26, 2015 at 18:11
  • did you try with <sales_order_view> <reference name="my.account.wrapper">add your xml update here </reference></sales_order_view>
    – liyakat
    May 27, 2015 at 5:18

1 Answer 1

1

Have a content text_list block which just holds all your stuff, then define a bunch of blocks which renders your information.

I think this question is quite broad to give a proper answer and to be honest I don't understand what exactly is the problem.

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