How To

How to Create a New Page Layout Option in Magento

Without a doubt, your Magento product page is the precious place where your customers will decide to shop or leave. To improvise sales and you have to serve better user experience with your store design that turns your store customer into returning one. By default you can change your whole store layout by changing the theme from the store backend, but what if you want to change the page layout without store layout?

Here is the complete tutorial to create your new store frontend page layout option inside your Magento 1 store. For this purpose first you need to create your own extension and then you have to create layout option in store backend for drop-down selection.

First, create “Vendor_Extension.xml” file inside your extension folder at following path.
app\etc\modules\Vendor_Extension.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
 <modules>
     <Vendor_Extension>
         <active>true</active>
local
         <depends>
             <Mage_Page />
         </depends>
     </Vendor_Extension>
 </modules>
</config>

After that, you need to define your custom layout option.
app\code\local\Vendor\Extension\etc\config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
 <modules>
     <Vendor_Extension>
            <version>1.0.0</version>
     </Vendor_Extension>
 </modules>
 <global>
     <page>
         <layouts>
             <new_cms_layout module="page" translate="label">
                 <label>New Layout Option</label>
                    <template>page/custom.phtml</template>                 
             </new_cms_layout>
         </layouts>
        </page>
 </global>
</config>

Lastly, you need to write your own custom layout code “custom.pthml” file for the frontend.
app\design\frontend\Themes\Yourtheme\template\page\custom.phtml

<?php 
//Your code goes here... 
?>

That’s the final step! I hope you enjoy creating your own page layout in Magento 1.
Don’t forget to hit that stars and comment down below if you are facing an issue while using this code.
Happy Coding!

Click to rate this post!
[Total: 4 Average: 5]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate ?️ Certified Magento Developer?‍?. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.?

Recent Posts

How to Add Tooltip in Checkout Shipping Field in Magento 2?

Hello Magento Friends, In today’s blog, I will explain How to Add Tooltip in Checkout…

3 days ago

How to Integrate and Use MongoDB with Laravel?

MongoDB is a popular NoSQL database that offers flexibility and scalability when handling modern web…

4 days ago

NodeJS | Callback Function

In NodeJS, callbacks empower developers to execute asynchronous operations like reading files, handling requests, and…

5 days ago

How to Show SKU in Order Summary in Magento 2?

Hello Magento Friends, In today’s blog, we will learn How to Show SKU in Order…

7 days ago

Best Colors to Use for CTA Buttons

The "Buy Now" and "Add to Cart" buttons serve as the primary call-to-action (CTA) elements…

1 week ago

Magento 2: How to Save Custom Field Value to quote_address for Multi-Shipping Orders

Hello Magento Friends, In Magento 2, the checkout process allows customers to choose multiple shipping…

1 week ago