I have tried to show the Customer Navigation menu in Custom template file.
Below is My Code:
<div id="customer_menu">
<?php echo $this->getLayout()->createBlock('customer/account_navigation')->setTemplate('customer/account/navigation.phtml')->toHtml();?>
</div>
The menu is not loading well. Showing like below image
Any suggestions will be appreciated.
Thanks,
Best Answer
The result you are getting is normal. The block with alias
customer/account_navigation
does not actually contain the customer account links.It acts only as a container where other layout files / modules can add links.
If you use a new instance of the block this one will not contain any links.
What I suggest is to add the following code to the layout handle of your page:
This will automatically load the layout directives for the customer account, including the navigation links.
You won't even need to add any html. The block will be displayed on the left sidebar.