开发者

magento: rewriting templates

开发者 https://www.devze.com 2023-01-23 18:50 出处:网络
I have altered a template fi开发者_StackOverflowle in: app/design/adminhtml/default/default/template/sales/order/shipment/create/tracking.phtml

I have altered a template fi开发者_StackOverflowle in:

app/design/adminhtml/default/default/template/sales/order/shipment/create/tracking.phtml

However i'd like to save this file with these new changes into a new file and leave tracking.phtml in its stock standard form and somehow redirect the block to the location of the new file and use it instead.

Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Tracking is the class I think i have to change and i've tried creating a constructor in it and using a few different methods such as Mage::settheme and $this->setTemplate but none of them make a difference.

Any help would be greatly appricated


Look in the file 'app/design/adminhtml/default/default/layout/sales.xml', tracking.phtml is used several times. If this change is for a module then create a layout file 'yourmodule.xml' and enable it from your config file. Otherwise name it 'local.xml'. It's contents will have to be an update something like this:

<?xml version="1.0"?>
<layout>
    <adminhtml_sales_order_shipment_new>
        <reference name="shipment_tracking">
            <action method="setTemplate">
                <template>your/new/tracking.phtml</template>
            </action>
        </reference>
    </adminhtml_sales_order_shipment_new>
</layout>
0

精彩评论

暂无评论...
验证码 换一张
取 消