Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Page layouts, new one for home page
 
sccr410
Member
 
Total Posts:  48
Joined:  2008-04-02
 

I am having some issues figuring out how to handle the page layouts, specifically for how to ADD another template that can be used for the home page. My home page structure does not fit any of the already established template files. I can’t find a configuration setting for where to set which template to use for the home page either.

 
Magento Community Magento Community
Magento Community
Magento Community
 
archer
Jr. Member
 
Total Posts:  12
Joined:  2008-03-31
 

i do have the same problem too.. i want to set the homepage template to 3columns.phmtl but until now i wasn’t able to do it..
as far as i know.. the homepage is a CMS page so i went on to cms.xml layout and change 1column.phtml to 3columns.phtml but nothing happened..

anyone who could help me? All i need is to know where to set the homepage template.. thanks… smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tweakmag
Sr. Member
 
Avatar
Total Posts:  277
Joined:  2007-08-31
London, UK
 

To change the layout that the homepage uses you need to go to CMS > Manage pages. Then click on homepage, then custom design and choose your layout.

To add a new template, you need to first create the template and save it into app/design/frontend/[your interface]/[your theme]/template/page
Then you need too add this new template to app/code/core/Mage/Cms/etc/config.xml and look at line 170 (approx).

Cheers
Adam

 Signature 

adam martin: internet consultant / web developer
contact | adam.martin@internetconsultants.com.au | +61 4 3331 3374 | skype adam.j.martin
http://www.tweakmag.com - Tweaking and Customizing The Magento eCommerce Platform

 
Magento Community Magento Community
Magento Community
Magento Community
 
sccr410
Member
 
Total Posts:  48
Joined:  2008-04-02
 

Great, that sounds exactly like what I need. However, my only concern is upgrading - if I change that config.xml file, will I have to redo that change every time Magento is updated? I really want to avoid having to reapply changes every upgrade in the future so I was avoiding changing core files.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tweakmag
Sr. Member
 
Avatar
Total Posts:  277
Joined:  2007-08-31
London, UK
 

For now - yes you will have to rewrite the change everytime you upgrade… you could write your own xml (in local) to do the same job that would avoid the issue of redoing it everytime

 Signature 

adam martin: internet consultant / web developer
contact | adam.martin@internetconsultants.com.au | +61 4 3331 3374 | skype adam.j.martin
http://www.tweakmag.com - Tweaking and Customizing The Magento eCommerce Platform

 
Magento Community Magento Community
Magento Community
Magento Community
 
sccr410
Member
 
Total Posts:  48
Joined:  2008-04-02
 

Might have to submit a feature request about this - should be a lot easier to add template layouts beyond the few column layouts provided.

Thanks again

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tweakmag
Sr. Member
 
Avatar
Total Posts:  277
Joined:  2007-08-31
London, UK
 

ok, here is the code so that you don’t have to overwrite core smile

Create the following file:
app/code/local/Mage/Templates/etc/config.xml

in this file add the following:

<config>
    <global>
        <
cms>
            <
layouts>
                <
new_template1>
                    <
label>New Template 1</label>
                    <
template>page/newtemplate1.phtml</template>
                </
new_template1>
                <
new_template2>
                    <
label>New Template 2</label>
                    <
template>page/newtemplate2.phtml</template>
                </
new_template2>
            </
layouts>
        </
cms>   
    </global>
</
config>

Now create:
app/etc/modules/Mage_Templates.xml

in this file add the following:

<config>
    <
modules>
        <
Mage_Templates>
            <
active>true</active>
            <
codePool>local</codePool>
        </
Mage_Templates>
    </
modules>
</
config>

You should be able to now choose the new templates when creating / editing your cms pages. smile

 Signature 

adam martin: internet consultant / web developer
contact | adam.martin@internetconsultants.com.au | +61 4 3331 3374 | skype adam.j.martin
http://www.tweakmag.com - Tweaking and Customizing The Magento eCommerce Platform

 
Magento Community Magento Community
Magento Community
Magento Community
 
sccr410
Member
 
Total Posts:  48
Joined:  2008-04-02
 

Just wanted to say thanks again, this solution worked perfectly!

 
Magento Community Magento Community
Magento Community
Magento Community
 
schmelzgeist
Sr. Member
 
Total Posts:  92
Joined:  2008-05-27
Marzipane World Capital (Lübeck, Germany)
 

JUst wanted to say thanks.  it appears in the dropdown menu, but when i’m looking at it in the frontend, it says 404.  is there anything i might have overlooked?

 Signature 

WE have no future because our Present is too volatile.We have only riskmanagement.
The spinning of the given moment´s scenario. *Pattern Recognition.W.Gibson*

 
Magento Community Magento Community
Magento Community
Magento Community
 
schmelzgeist
Sr. Member
 
Total Posts:  92
Joined:  2008-05-27
Marzipane World Capital (Lübeck, Germany)
 

never mind, was just a typo. *blush*

 Signature 

WE have no future because our Present is too volatile.We have only riskmanagement.
The spinning of the given moment´s scenario. *Pattern Recognition.W.Gibson*

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jono
Member
 
Avatar
Total Posts:  36
Joined:  2008-05-04
Sydney
 

@ Ajazza - Brilliant piece of code - thanks a lot!

 Signature 

check out Weirdo :: T-Shirts for Humans | Weirdo [NZ] | Weirdo Tees | Charitees | Karma Police

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Member
 
Avatar
Total Posts:  73
Joined:  2008-05-28
Brazil
 

Great post. Thanks Tweakmag!

 Signature 

Gabriel Queiroz Silva

 
Magento Community Magento Community
Magento Community
Magento Community
 
xgabo
Member
 
Total Posts:  38
Joined:  2008-09-11
 

Ive been looking for someone who can answer this..>>> anytime I use magento connect to, let say, install the new blue template the magento provided.  One the template is installed, I go to system, design and put “blue” in the two configure fields.  Once this is done.  my navigation in the admin stops working. I cant click on anything.  this has happened with every version.  It may because by magento connect and have nothing to do with the template. Im not sure.

 
Magento Community Magento Community
Magento Community
Magento Community
 
center
Jr. Member
 
Total Posts:  3
Joined:  2008-06-20
 

Clear post, however…

When i hack app/code/core/Mage/Cms/etc/config.xml at line 170 (approx)… the new phtml files do show up in the pulldown under cms/manage pages/custom design. =)

But when i want to use the custom config.xml files in:
app/code/local/Mage/Templates/etc/config.xml
and
app/etc/modules/Mage_Templates.xml

...nothing happens |(

I also noticed that the directories /Mage/Templates/etc/ did not exist so i added them myself.

I like to have working the right way so i dont have to reapply the hack each time i upgrage magento…
I cant see what i am doing wrong here, could it be my custom xml files???

TIA

app/code/local/Mage/Templates/etc/config.xml

<?xml version="1.0"?>
<config>
    <global>
        <
cms>
            <
layouts>
                <
new_template1>
                    <
label>1 column home</label>
                    <
template>page/1column-home.phtml</template>
                </
new_template1>
                <
new_template2>
                    <
label>2 column left home</label>
                    <
template>page/2columns-left-home.phtml</template>
                </
new_template2>
            </
layouts>
        </
cms>   
    </global>
</
config>

app/etc/modules/Mage_Templates.xml

<?xml version="1.0"?>
<config>
    <
modules>
        <
Mage_Templates>
            <
active>true</active>
            <
codePool>local</codePool>
        </
Mage_Templates>
    </
modules>
</
config>

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53162 users|627 users currently online|107168 forum posts