1
<block type="customer/account_dashboard_mydesigns" name="customer_account_dashboard_mydesigns" as="mydesigns"   template="customer/mydesigns.phtml"/>

Above code does not load mydesign.phtml file. But It loads when I change as="mydesigns" to as="info". As I change so, magento fails to load info.phtml.

<block type="customer/account_dashboard_info" name="customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml"/>
  • You have to provide the complete layout block (with reference) in your questions to get better help. – Matthias Kleine Feb 18 '15 at 8:28
0

You need call your block at customer/account/dashboard.phtml using child block

<?php echo $this->getChildHtml('mydesigns') ?> Other wise it not render.

layout code look like:

<reference name="customer_account_dashboard">
<block type="customer/account_dashboard_mydesigns" name="customer_account_dashboard_mydesigns" as="mydesigns"   template="customer/mydesigns.phtml"/>

 </reference>
0

Just adding a block to the layout.xml isn't enough in the most cases. It depends on the parent block if your custom block is displayed.

If the parent block

  • has the type "core/text_list" it will display all child blocks automatically (you can reorder them with the before and after attributes)
  • inherits of "core/template" it won't be displayed automatically. In this case you have to add the following code into the template file (.phtml) of the parent block

Display your block:

<?php echo $this->getChildHtml('mydesigns'); ?>

The change to "info" works, because another block has the same name or alias. This is not allowed!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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