Search code examples
magentomagento-1.9

Magento admin: New block not showing after adding in layout


I have several custom blocks added in an admin page under my custom module. When I try to add another block by adding an entry in the layout file of my module, the new block does not display. Am I missing anything?

My existing block that is displaying well.

<block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
     <block type="adminhtml/sales_order_create_shipping_method_form" template="xxxx/xxxx/quote/create/shipping/form.phtml" name="form" />
 </block> 

The block I am trying to add below it, and it is not displaying

<block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
                            <block type="adminhtml/sales_order_create_billing_method_form" template="xxx/xxx/quote/create/billing/form.phtml" name="form" />
                        </block> 

BTW, the block is loading if I keep it inside the already existing block. Wondering how can I make it appear outside the existing one, as a standalone block.

<block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
                            <block type="adminhtml/sales_order_create_shipping_method_form" template="xxxx/xxxxxx/quote/create/shipping/form.phtml" name="shipping_form" />   
  <block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
   <block type="adminhtml/sales_order_create_billing_method_form" template="xxxxxx/xxxxxxxx/quote/create/billing/form.phtml" name="billing_form" />
   </block>  
</block>   

Solution

  • Fixed the issue. I had a data.phtml template file in the same folder my other phtml files were in, in which there was following code.

        <div id="order-billing_method" style="display:none"><?php echo  $this->getChildHtml('billing_method') ?></div>
    

    I changed the display:none to display:block and the new block of billing-method started showing without any problem. Thanks for the answers.