1

I what to append content in block using XML file. Please check below image

enter image description here

I have added below code but it is overtiring content. (I want to appending).

<reference name="order_items">
      <action method="addColumnRender">
         <column>name</column>
         <block>adminhtml/sales_items_column_name</block>
         <template>sales/items/column/name.phtml</template>
      </action> 
</reference> 

I have checked core file there are creating block programmatically.

1 Answer 1

1

If you know the block names/aliases of both blocks you can move the block that is appearing first to display AFTER the block you want to appear first.

In this example I will call the block you want to appear first first.block, and the block you want to appear second second.block which has an alias of secondBlockAlias.

<reference name="order_items">
    <action method="unsetChild">
        <alias>secondBlockAlias</alias>
    </action>

    <action method="insert">
        <block>second.block</block>
        <siblingName>first.block</siblingName>
        <after>1</after>
    </action>
</reference>
2
  • Block is creating using this code ` $this->getLayout()->createBlock($this->_columnRenders[$column]['block'])->setTemplate($this->_columnRenders[$column]['template'])->setRenderedBlock($this);` How can I know block name? Commented Jan 7, 2017 at 6:09
  • I have added this code in config.xml file <adminhtml_sales_order_view> <reference name="order_items"><block type="adminhtml/sales_items_column_name" name="sales.order.product.customizer.info" as="salesOrderCustomizerInfo" template="productcustomizer/sales/order/view/additional-1.phtml"/><action method="unsetChild"><alias>salesOrderCustomizerInfo</alias></action><action method="insert"><block>sales.order.product.customizer.info</block><siblingName>adminhtml/sales_items_column_name</siblingName><after>1</after></action></reference> </adminhtml_sales_order_view> but it is not working Commented Jan 7, 2017 at 6:15

Your Answer

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

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