1

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.

  • What is it your custom extension needs to do? If Magento already does what you need, then just to modify the template files in your theme. – zigojacko Mar 5 '14 at 10:10
  • @GeoffJackson-zigojacko, I just edited my template files but how to create layout.xml i.e page.xml file. see my actual thread link. – Magento Nav Mar 5 '14 at 10:12
4

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

1

if you don't want to create any module or xml file, just simply copy the file /app/design/frontend/base/default/template/page/XXXX.phtml

to

/app/design/frontend/default/default/template/page/XXXX.phtml

then modify the files under your theme. Magento will overwrite itself.

hit: default/default is based on you use the default theme. so change that if you use different theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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