Magento Forum

   
Show ‘my account’ nav on pages added via my extension
 
ddcas
Jr. Member
 
Total Posts:  7
Joined:  2012-04-23
 

Hi,

I’ve followed the tutorials here and created an extension which adds a new page to the front of the site. The new page is rendered using my stores template, ie it shows main nav, product categories, product search, logo, page footer etc etc, with my content shown in the middle of the page.

I would like my new page to be based on the ‘my account’ page instead of the standard store page, ie showing the ‘my account’ nav. I’m kind of fuzzy about the idea of templates, but I feel that my extension is using the my standard store template, but I would like it to use the ‘my account’ template.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagePsycho
Moderator
 
Avatar
Total Posts:  1702
Joined:  2009-06-23
 

In order to add new link to the My Account navigation you can simply do it via layout update xml as:

<customer_account>
    <
reference name="customer_account_navigation">
        <
action method="addLink" translate="label" module="yourModule">
            <
name>alias</name>
            <
path>module/controller/action</path>
            <
label>Module Label</label>
        </
action>
    </
reference>
</
customer_account>
Also, you need to update handle in controller layouts:
<module_controller_action>
    <
update handle="customer_account"/>
    <!-- ... -->
</
module_controller_action>

 
Magento Community Magento Community
Magento Community
Magento Community
 
ddcas
Jr. Member
 
Total Posts:  7
Joined:  2012-04-23
 

Thanks for the response MagePsycho, but unfortunately that\’s not what I was trying to do.

I’m assuming that their exists some sort of layout or template for the \’My Account\’ pages (Account dashboard, Account information, Address Book, My orders), which specifies which blocks will be used to create this page. What I\’m trying to do is have my extension use this layout/template for the new pages it creates, not the standard shop template/layout which is used for most pages of the site.

I think I made a bad choice for the title of my original post, but I thought the post itself explained what I wanted to do. I\’ve already done what you explained in your answer for another reason, but I would also like to know how to add links to the my account navigation programatically, ie a link either appears or not in the \’My Account\’ navigation based the return value of a function in my model.

Thanks for you help

 
Magento Community Magento Community
Magento Community
Magento Community
 
Casper Munk
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2010-05-03
Denmark/Germany
 

I realise this is an old post, but Alan Storm wrote a tremendous article about this: http://alanstorm.com/magento_create_customer_page

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