1

I'm trying to move a block to another page but when I add it to the page everything except that block disappears. No header, footer or styles or anything just that block. The block still works without any errors, it's just that it the only the on the page!

Here's the xml:

        <trackorder_index_view>
            <reference name="head">
                <action method="addCss" >
                    <stylesheet>trackorder/css/trackorder.css</stylesheet>
                </action>
            </reference>        
            <label>Customer My Account Order View</label>
            <reference name="root">
                <action method="setTemplate">
                    <template>page/2columns-left.phtml</template>
                </action>
            </reference>
            <reference name="content">


here's the block I added --> <block type="trackorder/trackorder" name="root" output="toHtml" template="trackorder/trackdetail.phtml" /> 





                <block type="sales/order_info" as="info" name="sales.order.info" template="trackorder/info.phtml">
                    <block type="sales/order_info_buttons" as="buttons" name="sales.order.info.buttons" />
                </block>
                <block type="sales/order_view" name="sales.order.view" template="trackorder/view.phtml">
                    <block type="sales/order_items" name="order_items" template="sales/order/items.phtml">
                        <action method="addItemRender">
                            <type>default</type>
                            <block>sales/order_item_renderer_default</block>
                            <template>sales/order/items/renderer/default.phtml</template>
                        </action>
                        <action method="addItemRender">
                            <type>grouped</type>
                            <block>sales/order_item_renderer_grouped</block>
                            <template>sales/order/items/renderer/default.phtml</template>
                        </action>
                        <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
                            <action method="setLabelProperties">
                                <value>colspan="4" class="a-right"</value>
                            </action>
                            <action method="setValueProperties">
                                <value>class="last a-right"</value>
                            </action>
                            <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml" />
                        </block>
                    </block>
                </block>
            </reference>
            <reference name="sales.order.info">
                <action method="addLink" translate="label" module="sales">
                    <name>view</name>
                    <path></path>
                    <label>Order Information</label>
                </action>
                <action method="addLink" translate="label" module="sales">
                    <name>invoice</name>
                    <path>*/*/invoice</path>
                    <label>Invoices</label>
                </action>
                <action method="addLink" translate="label" module="sales">
                    <name>shipment</name>
                    <path>*/*/shipment</path>
                    <label>Shipments</label>
                </action>
                <action method="addLink" translate="label" module="sales">
                    <name>creditmemo</name>
                    <path>*/*/creditmemo</path>
                    <label>Refunds</label>
                </action>
            </reference>
        </trackorder_index_view>

Anyone know what up with this?

1 Answer 1

3

The problem may be caused by the name="root" that you set on the block. This is likely overwriting the main block (that is also named "root"), causing everything else to disappear.

Try naming it something else, like:

<block type="trackorder/trackorder" name="order.trackorder" output="toHtml" template="trackorder/trackdetail.phtml" />
1
  • Thank you for your reply, but I managed a work around. What I done was add the block as a CMS static block then added to the page. Surprisingly it worked. Sorry I can't mark your answer as correct.
    – Freejoy
    Aug 10, 2016 at 21:39

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.