2

How can i change the default layout of login.phtml in magento. Suppose , now by default the layout for login.phtml is 1column.phtml and if I want this to change to 3column.phtml, what should I do?

2
  • 5
    You seem to have a number of questions and no accepted answers on any of them. Before asking more questions on this forum I suggest you look through your past questions and accept some answers. Thanks.
    – philwinkle
    Commented Sep 13, 2013 at 6:06
  • 2
    @philwinkle. By "a number of questions" you mean "all", right?
    – Marius
    Commented Oct 9, 2013 at 6:26

3 Answers 3

8

Just extending the answer given by philwinkle.

If you are doing any layout updates then it is recommended to do it in a separate file normally with a name of "local.xml". If this file is not available in "$theme/$layout/" folder then create one and add the following code:

<?xml version="1.0" encoding="UTF-8" ?>
<layout>
    <customer_account_login>
        <reference name="root">
            <action method="setTemplate">
                <template>page/3column.phtml</template>
            </action>
        </reference>
    </customer_account_login>
</layout>

Updates to layout are processed in a single file. you can also do the updates in many files but it will end in confusion. and also if you are upgrading your magento package then those update changes will be lost.

Hence, keeping updates in a single file makes sense.

It seems you are beginner in magento. So, I would like to recommend you few links from where you can understand it better. :)

Well, I am also a beginner but learnt alot from the above links :)

7
  • Okay thanks, but I created a new local.xml file and pasted the above code , but I am not getting the output. Commented Sep 13, 2013 at 6:30
  • It should work. you can see that change when "customer_account_login" layout handle is called. Go through those tutorials.
    – Mr_Green
    Commented Sep 13, 2013 at 6:33
  • @AkashGoswami I updated my post check once and let me know.
    – Mr_Green
    Commented Sep 13, 2013 at 8:06
  • the code which you provided initially that worked for me and I have also specified that in a local.xml. Commented Sep 13, 2013 at 8:36
  • @AkashGoswami then please select the answer which helped you. otherwise we can't help you in future. because this site needs some accepted answers to survive.
    – Mr_Green
    Commented Sep 13, 2013 at 8:40
6

Insert the following into your theme's local.xml layout file:

<?xml version="1.0"?>
<layout>
    <customer_account_login>
          <reference name="root">
                <action method="setTemplate"><template>page/3column.phtml</template></action>
          </reference>
    </customer_account_login>
</layout>
9
  • Okay but can you please tell me where is that local.xml located? Commented Sep 13, 2013 at 5:23
  • app/design/frontend/[package]/[theme]/layout/local.xml
    – philwinkle
    Commented Sep 13, 2013 at 5:30
  • Package is what package you've defined in your System > Config > Design for your store view. Theme is what is listed for Theme in that same configuration panel.
    – philwinkle
    Commented Sep 13, 2013 at 5:31
  • Thank you. It worked. Actually I changed the layout directly from customer.xml file. Commented Sep 13, 2013 at 5:42
  • Great to hear - please upvote and accept this answer. I would encourage you to not make the change in the customer.xml if your theme is base/default as this will be overwritten during an upgrade. Best of luck.
    – philwinkle
    Commented Sep 13, 2013 at 5:44
3
<layout>
      <customer_account_login>
           <reference name="root">
                <action method="setTemplate"><template>page/3column.phtml</template></action>
            </reference>
         </customer_account_login>
</layout>

write this code in local.xml in your theme layout

2
  • It will not work because the layout handle "customer_account_login" is not present inside the "default" layout handle. or if you are including in "default" layout handle then you need to use update layout element. correct me if I am wrong. :)
    – Mr_Green
    Commented Sep 13, 2013 at 7:28
  • you are right @Mr_Green updated my answer
    – Keyur Shah
    Commented May 6, 2015 at 12:26

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.