Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
add a new layout template for CMS Page
 
delsea
Member
 
Total Posts:  61
Joined:  2008-12-22
The Hague, Holland
 

I ain’t a programmer unfortunately and i really am afraid for all magento php files to be honest.

<config>
    <
modules>
        <
Mage_Page>
            <
version>0.7.0</version>
        </
Mage_Page>
    </
modules>
    <global>
        <
models>
            <
page>
                <class>
Mage_Page_Model</class>
            </
page>
        </
models>
        <
blocks>
            <
page>
                <class>
Mage_Page_Block</class>
            </
page>
        </
blocks>
        <
page>
            <
layouts>
                <empty 
module="page" translate="label">
                    <
label>Empty</label>
                    <
template>page/one-column.phtml</template>
                    <
layout_handle>page_empty</layout_handle>
                </empty>
                <
one_column module="page" translate="label">
                    <
label>1 column</label>
                    <
template>page/1column.phtml</template>
                    <
layout_handle>page_one_column</layout_handle>
                </
one_column>
                <
two_columns_left module="page" translate="label">
                    <
label>2 columns with left bar</label>
                    <
template>page/2columns-left.phtml</template>
                    <
layout_handle>page_two_columns_left</layout_handle>
                </
two_columns_left>
                <
two_columns_right module="page" translate="label">
                    <
label>2 columns with right bar</label>
                    <
template>page/2columns-right.phtml</template>
                    <
layout_handle>page_two_columns_right</layout_handle>
                </
two_columns_right>
                <
three_columns module="page" translate="label">
                    <
label>3 columns</label>
                    <
template>page/3columns.phtml</template>
                    <
layout_handle>page_three_columns</layout_handle>
                </
three_columns>
            </
layouts>
        </
page>
    </global>
    <
frontend>
        <
translate>
            <
modules>
                <
Mage_Page>
                    <
files>
                        <default>
Mage_Page.csv</default>
                    </
files>
                </
Mage_Page>
            </
modules>
        </
translate>
        <
layout>
            <
updates>
                <
page>
                    <
file>page.xml</file>
                </
page>
            </
updates>
        </
layout>
    </
frontend>
    <
adminhtml>
        <
translate>
            <
modules>
                <
Mage_Page>
                    <
files>
                        <default>
Mage_Page.csv</default>
                    </
files>
                </
Mage_Page>
            </
modules>
        </
translate>
    </
adminhtml>
    <
install>
        <
translate>
            <
modules>
                <
Mage_Page>
                    <
files>
                        <default>
Mage_Page.csv</default>
                    </
files>
                </
Mage_Page>
            </
modules>
        </
translate>
    </
install>
    <default>
        <
design>
            <
head translate="default_description" module="page">
                <
default_title>Magento Commerce</default_title>
                <
default_description>Default Description</default_description>
                <
default_keywords>MagentoVarienE-commerce</default_keywords>
                <
default_robots>*</default_robots>
                <
default_media_type>text/html</default_media_type>
                <
default_charset>utf-8</default_charset>
            </
head>
            <
header translate="welcome" module="page">
                <
logo_src>images/logo.gif</logo_src>
                <
logo_alt>Magento Commerce</logo_alt>
                <
welcome>Default welcome msg!</welcome>
            </
header>
            <
footer translate="copyright" module="page">
                <
copyright>&amp;copy2008 Magento Demo StoreAll Rights Reserved.</copyright>
            </
footer>
        </
design>
    </default>
</
config>

this is how it looks like when i open the file you requested but what do i have to add?

thanks for your help

 
Magento Community Magento Community
Magento Community
Magento Community
 
brianb421
Sr. Member
 
Total Posts:  144
Joined:  2009-04-23
 
Unirgy - 18 July 2008 03:04 PM

no that definitely wouldn’t work. try exactly this: edit app/etc/local.xml, add this before closing </global></config>:

...
<!-- 
add from here -->
        <
cms>
            <
layouts>
                <
redirect>
                    <
label>Status Check Redirect</label>
                    <
template>page/status-check-redirect.phtml</template>
                </
redirect>
            </
layouts>
        </
cms>
<!-- 
to here -->
    </global>
</
config>

Worked perfect.  Thanks! 

I was confused on how to refresh my cache.  But I just went to System - Cache Management.  And selected all the top sections boxes, chose Refresh from the drop down box, and hit save.  Maybe there is a more precise way, but that seemed to work for me.  thanks again.

 Signature 

Post After Feb 1, 2012 refer to Magento Version 1.4.2
Post Before Feb 1st 2012 refer to Magento Version 1.3.3.0
the best selling green barley powder is alka green

 
Magento Community Magento Community
Magento Community
Magento Community
 
rogmabi
Member
 
Total Posts:  46
Joined:  2008-10-28
Canada, Québec
 

Worked perfect !! (do not forget to refresh the cache… or delete var/cache and var/session after upgrade...)

 
Magento Community Magento Community
Magento Community
Magento Community
 
panda85
Jr. Member
 
Total Posts:  1
Joined:  2009-11-26
 

Hello,

I had to insert a new layout template and the file I need was in : app/code/core/Page/etc/config.xml
I use the Magento ver. 1.3.2.4 , version and I couldn’t find the file where the others said.

Hope this will help others.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jnorton01
Member
 
Total Posts:  49
Joined:  2007-10-22
 

I have created an extension to handle custom layout templates. Check it out here: http://jnorton.co.uk/blog/ecommerce/magento-free-custom-pages-module

You only need to edit an XML file to get your new templates listed and the beauty of the extension is that you can apply a custom template to all pages not just CMS pages. Let me know if this helps you.

 Signature 

J Norton Interactive Design User Experience Design and Online Advertising.

 
Magento Community Magento Community
Magento Community
Magento Community
 
StevePeters
Jr. Member
 
Total Posts:  5
Joined:  2009-11-18
 
stereotomy - 09 May 2008 07:45 PM

varien changed the layout desc file with 1.0

it’s now in app/code/core/Mage/Cms/etc/config.xml

add a new layout under <layouts> and voila! there is your new custom layout!

Looks like it’s been changed again as of Magento ver. 1.3.2.4

When you look in config.xml “layout” refers to app/design/frontend/default/default/layout/cms.xml

That file only references the one column layout, so clearly this is not where one would have available layouts show up in the CMS gui for “custom design”.

I think what I’m finding out is that doing a custom layout is so infernally complicated that it isn’t worth the effort.

 
Magento Community Magento Community
Magento Community
Magento Community
 
StevePeters
Jr. Member
 
Total Posts:  5
Joined:  2009-11-18
 
StevePeters - 04 January 2010 09:28 PM

stereotomy - 09 May 2008 07:45 PM
varien changed the layout desc file with 1.0

it’s now in app/code/core/Mage/Cms/etc/config.xml

add a new layout under <layouts> and voila! there is your new custom layout!

Looks like it’s been changed again as of Magento ver. 1.3.2.4

When you look in config.xml “layout” refers to app/design/frontend/default/default/layout/cms.xml

That file only references the one column layout, so clearly this is not where one would have available layouts show up in the CMS gui for “custom design”.

I think what I’m finding out is that doing a custom layout is so infernally complicated that it isn’t worth the effort.

How the heck did this reply end up on this thread?  I wrote that on a completely different thread.

However, the good news is:

look in:
Your App Install Directory /app/code/core/Mage/Page/etc/config.xml
Look for the <layouts> section and add in your custom cms layouts.

...does indeed add your new custom layout to the CMS layout dropdown menu

 
Magento Community Magento Community
Magento Community
Magento Community
 
ollik
Jr. Member
 
Total Posts:  4
Joined:  2009-10-09
 

The solution of jnorton01 is in my opinion the only correct one, if you do not want to loose update compatibiliy. Create your own module that override/extend the core page-node in local and activate that in a seperate module xml-file in etc/module.

If you just copy an core folder to local (e.g.Page) and change in the Mage_all.xml the module Mage_Page from “core” to “local” (as I did before) you have also your new templates, but you loose the Header/Footer etc. section in your admin-system-configuration-design panel. Weired..

 
Magento Community Magento Community
Magento Community
Magento Community
 
efy2for5
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2009-04-21
 

i just want to bump people to this thread if they are having any issues in regards to caching custom templates http://www.magentocommerce.com/boards/viewthread/46203/P15/

saved me hours of panic

 Signature 

liverpool web development | Quadronation

 
Magento Community Magento Community
Magento Community
Magento Community
 
enoc22
Jr. Member
 
Total Posts:  14
Joined:  2009-01-03
 

One Thing i stumbled on by accident.
Adding
<?xml version="1.0"?>
<config>
<global>
<page>
<layouts>
<map>
<label>Map</label>
<template>page/map.phtml</template>
</map>
</layouts>
</page>
</global>
</config>
As a file name Mage_Pagext.xml to app/etc/modules seemed to do the trick.
I don’t know if this is the best way...but it works

 
Magento Community Magento Community
Magento Community
Magento Community
 
thenior
Jr. Member
 
Total Posts:  6
Joined:  2010-04-25
 

Hey people - I had just figured out how to do this, and then I ran across this thread. At first it was very confusing but then I realized everyone was using older versions of Magento.

Here is how to do it, based on This Link I found some of the instructions confusing, so I have rewritten them here:

1) Navigate to app/code. Create the following directories, one inside the other: local > Mage > Page > etc

2) Navigate to app/code/core/Mage/Page/etc . Copy “config.xml” to the local/Mage/Page/etc folder you created.

3) Navigate to app/design/frontend/YOURINTERFACE/YOURTHEME/template/page. For our example, make a copy of 1column.phtml and rename it to whatever you choose (my-new-theme.phtml or whatever). Don’t delete 1column.phtml, just make a copy of it in this folder.

4)Open the config.xml file you created in local on step 2. Around line 47, beneath the <layouts> tag, add the following:

<your_layout_name module="page" translate="label">
                    <
label>Description name here</label>
                    <
template>page/the-name-of-the-file-you-created-here.phtml</template>
                    <
layout_handle>a_descriptive_handle_name</layout_handle>
                </
your_layout_name>

5) Open app/etc/modules/Mage_All.xml. Around line 41-47, you should find the following:

<Mage_Page>
            <
active>true</active>
            <
codePool>core</codePool
            <
depends>
                <
Mage_Core />
            </
depends>
        </
Mage_Page>

Change

<codePool>core</codePool>
to
<codePool>local</codePool>

6) Upload your files, delete/refresh the cache. Your file should now show up in the CMS.

 
Magento Community Magento Community
Magento Community
Magento Community
 
thenior
Jr. Member
 
Total Posts:  6
Joined:  2010-04-25
 

Sorry, double post!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mag SG
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2010-07-06
 

The location of this config.xml file has changed

from:
/
app/code/core/Mage/Cms/etc/config.xml

to
:
/
app/code/core/Mage/Page/etc/config.xml

 Signature 

Regards,
Mag SG

 
Magento Community Magento Community
Magento Community
Magento Community
 
[Orases] Brett
Member
 
Total Posts:  57
Joined:  2009-05-13
 

You can do this in your local.xml file just as easily (or if you have a core module you can do it in the module config given that it’s enabled).

In app/etc/local.xml (or app/code/local/{namespace}/{MyModule}/etc/config.xml ) within the <global> XML node add a node called “page”:

<page>
    <
layouts>
        <
my_layout>
            <
label><![CDATA[My Custom Layout]]></label>
            <
template><![CDATA[page/my_custom_layout.phtml]]></template>
        </
my_layout>
    </
layouts>
</
page>

So the full file might look something like:

<?xml version="1.0"?>
<config>
    <global>
        ...
        <
page>
            <
layouts>
                <
my_layout>
                    <
label>My Custom Layout</label>
                    <
template>page/my_custom_template.phtml</template>
                </
my_layout>
            </
layouts>
        </
page>
    </global>
</
config>

I can guarantee that works in EE 1.7.1 and CE 1.3 and 1.4. 

If you want to see examples of that in action, visit http://www.catgenie.com (EE), or http://www.greenplaque.com (CE) or http://www.coasttocoastmattress.com (CE) as all use the same code above in different numbers (CatGenie has 4 custom layouts, Coast To Coast has 2 or 3 custom layouts, and Green Plaque has 2 custom layouts).

Hope that helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Girdy
Jr. Member
 
Total Posts:  12
Joined:  2009-04-19
 

I am newish to all this and understand the method of getting the new layout to show in the options from the above but how where are the layout files that you alter and where do you tell magento to look for these.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
701238 users|803 users currently online|497299 forum posts