1

i need to add the orange block on 2 column customer account,

what is the best way to adding that block, if i do from the 2 column left phtml, just scared it will shown at all 2column type, from local xml, but i am not sure about the code

any suggestion will be appreciate, Thanks

enter image description here

David Manners
27.3k9 gold badges78 silver badges220 bronze badges
asked Apr 10, 2014 at 7:59
2
  • Not sure if this is the best solution, but maybe it fits your needs. The example is for 3columns but you can addapt it to 2 columns with left sidebar. magentocommerce.com/boards/viewthread/180617 Commented Apr 10, 2014 at 8:13
  • This universalcoder.wordpress.com/2014/03/29/… can be helpful to you. you can create a new reference position and call it in customer page. Commented Apr 10, 2014 at 8:31

4 Answers 4

3

What you could do would be for the customer account page, I assume the default, handle customer_account_index. Use a different template, so you know that this will only appear on this one page, and then add the block inside the root reference also.

<customer_account_index>
 <reference name="root">
 <action method="setTemplate"><template>your/new/template.phtml</template></action>
 <!-- Add your new block here -->
 </reference>
</customer_account_index>
answered May 26, 2014 at 15:48
1

This is possible with CMS configuration only and no code:

  1. Create a static block for the content (the orange block)

  2. Create a new widget instance (CMS> Widgets) and select your theme screenshot (2)

  3. Add Layout Update for page "Customer My Account (All Pages)" and reference "Page Header" screenshot (3)

  4. Select static block from (1) in "Widget Options": screenshot (4)

  5. Save.

  6. Clean cache.

answered Mar 11, 2015 at 22:51
0

let me explain magento blocks in details hope it will help you to understand complete block mechanism

Everything in magento is a module , so all the modules have their controllers which are used for url routing system . lets take an example of url e.g http://example.com/index.php/customer/account/index/

module routes in this way module_controller_action

as you can see here module is customer , controller is accountcontroller and action is indexaction (all magento controller action works in this manner e,g editAction = edit on URL deleteAction = delete). You can verify by visiting this path /app/code/core/Mage/Customer/controllers

also related xml can be found under /app/design/frontend/base/default/layout customer.xml

Magento Reference Block

Now its time to explain reference block as its name suggests reference block is help ful to give a reference to your block . Suppose you want to integrate your block in left postion of the store then you can easily call

<reference name="left">
<block type="core/template" after="-"
name="sleek" template ="Sleekaccordian/new.phtml" /></reference>

Reference Action Method

Under reference tag we can call functions as well using action method as per the given example for newsletter.xml

<reference name="customer_account_navigation">
<action method="addLink" translate="label" module="newsletter">
<name>newsletter</name><path>newsletter/manage/</path>
<label>Newsletter Subscriptions</label></action>
</reference>

this reference (customer_account_navigation) is defined under customer.xml

<block type="customer/account_navigation" name="customer_account_navigation"
before="-" template="customer/account/navigation.phtml">
<action method="addLink" translate="label" module="customer">
<name>account</name><path>customer/account/</path><label>Account Dashboard</label></action>
<action method="addLink" translate="label" module="customer">
<name>account_edit</name><path>customer/account/edit/</path>
<label>Account Information</label></action>
<action method="addLink" translate="label" module="customer">
<name>address_book</name><path>customer/address/</path><label>Address Book</label></action>
</block>

now as per the block class if you’ll visit

/app/code/core/Mage/Customer/Block/Account then you’ll find addLink function under Navigation.php

answered Jul 26, 2014 at 21:33
0
<customer_account_index translate="label">
 <reference name="my.account.wrapper">
 <block type="customer/account_dashboard_users" name="customer_account_dashboard_users" template="customer/account/dashboard/users.phtml" as="dashboardusers"/>
 </reference>
</customer_account_index>

Above is just an example. This will call users.phtml file on dashboard

7ochem
7,61516 gold badges54 silver badges82 bronze badges
answered Dec 9, 2015 at 12:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.