Magento – how to override only .phtml files in the custom module in magento

layoutmagento-1.8

I don't want to override .php files I want to edit only .phtml files of Page Module

how can I create layout file and assign?

thanks.

Best Answer

to edit the layout use the local.xml file in your template. In case it's not there yet you can go ahead and create it.

If you want to have a custom layout file like, for example, magentonav.xml you will be required to have your own extension that includes it in the layout.

In case you want to create a new block in your layout with a custom .phtml file you can do the following for example

<?xml version="1.0"?>
<layout version="0.1.0">
    <default translate="label" module="page">
        <reference name="left">
            <block type="core/template" name="my_custom_name" template="magentonav/mytemplate.phtml"/>
        </reference>
    </default>
</layout>

Notice the type core/template. This will allow you to add a .phtml file to your layout without requiring you to write your own custom block class

Related Topic