Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Where is the homepage layout? 
 
JazzcatCB
Jr. Member
 
Total Posts:  24
Joined:  2008-02-06
 

This may seem obvious, but for some reason I can’t find the homepage layout file. The designer’s guide mentioned main.xml, but I don’t have that file. Can anyone tell me what files I would need to modify to change the appearance of the homepage (apart from the cms content) Thanks!

And while I’m here, can anyone point me to a reference for the following? I need complete lists and descriptions for:

* Layout handles
* Block types
* PHP methods

Thanks a lot!

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

See attached screenshot.

To get started, look for ‘page.xml’ in the layout folder and ‘page’ folder under the template folder.

Image Attachments
m.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
JazzcatCB
Jr. Member
 
Total Posts:  24
Joined:  2008-02-06
 

Hi Chinesedream,

Thanks for replying. I did find page.xml, but I thought that was the basic page layout, not the specific homepage layout. It contains only structural blocks. Where are the homepage’s content blocks? Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

Sorry! I was a bit vague in my response.

The homepage block is in the admin, CMS > Manage pages. The Magento’s default homepage is ‘column on the right’, which is ‘2columns-right.phtml’ in the template > page folder.

To get started, you still need to know how the ‘page.xml’ works (and all xml files in the layout folder) in relationship with the templates. The Designer Guide, though not up-to-date with new changes on xml filenames, still, is a great resources one shouldn’t skip to read.

Hope this helps

 
Magento Community Magento Community
Magento Community
Magento Community
 
JazzcatCB
Jr. Member
 
Total Posts:  24
Joined:  2008-02-06
 

Hi Chinesedream,

You have been so helpful! I really appreciate everything you’ve done to help me out. Thank you for your patience.

I did read the designer guides, so I do know what layouts and templates are. I realize that page.xml is what they call the ‘skeleton’ because it contains the basic structure of the default page layout. I checked out 2columns-right.phtml, and I found a lot of ‘getChildHtml()’ calls. These reference structure blocks in a layout don’t they?

I know that there are components on the homepage that have to be generated on the fly from the db or a session. I’m speaking specifically of the category drop-downs (just below the header) and the mini-cart. Somewhere there has got to be code that creates these components. I would imagine that it would be in a template file and that it would get referenced by a content block in a layout somewhere. That’s what I’m looking for. Can you help me find that?

As always, I really do appreciate your help.

chinesedream - 12 February 2008 02:25 PM

Sorry! I was a bit vague in my response.

The homepage block is in the admin, CMS > Manage pages. The Magento’s default homepage is ‘column on the right’, which is ‘2columns-right.phtml’ in the template > page folder.

To get started, you still need to know how the ‘page.xml’ works (and all xml files in the layout folder) in relationship with the templates. The Designer Guide, though not up-to-date with new changes on xml filenames, still, is a great resources one shouldn’t skip to read.

Hope this helps

 
Magento Community Magento Community
Magento Community
Magento Community
 
JazzcatCB
Jr. Member
 
Total Posts:  24
Joined:  2008-02-06
 
ohminu - 12 February 2008 09:32 PM

JazzcatCM-

1. Category List - What do you need to change in this? Please specify.
2. Mini-cart - Mini Cart is introduced through ‘checkout.xml’, not ‘page.xml’.

I’m just trying to determine how the homepage is constructed. I’d like to know where and how each component on the homepage gets placed there. Thanks.

I checked out checkout.xml. I couldn’t find anything relating to the mini-cart there. What am I missing?

 
Magento Community Magento Community
Magento Community
Magento Community
 
JazzcatCB
Jr. Member
 
Total Posts:  24
Joined:  2008-02-06
 

I think I’ve pretty much figured it out.

page.xml references ‘topMenu’ which is modified by catalog.xml to point to “catalog/navigation/top.phtml”. That’s where the category list is defined.

checkout.xml ‘<default>’ references ‘right’ column which in turn references “checkout/cart/sidebar.phtml” which is where the mini-cart is defined.

Navigation of these blocks doesn’t seem very intuitive to me. Why couldn’t the mini-cart have been defined in a block or file named ‘mini-cart’ instead of ‘sidebar’? How does ‘sidebar’ tell me that I will find the mini-cart there? Same thing for the category list. I was looking for something named ‘category-list’ but instead it’s located in ‘topMenu’.

These templates refer to several php methods and apart from their names I have no idea what they do or how to use them.

 
Magento Community Magento Community
Magento Community
Magento Community
 
hez
Sr. Member
 
Avatar
Total Posts:  103
Joined:  2008-02-02
 

Oh wow!  I wish I had known about that earlier!

Thanks.
Heather

 
Magento Community Magento Community
Magento Community
Magento Community
 
JazzcatCB
Jr. Member
 
Total Posts:  24
Joined:  2008-02-06
 

ohminu, that’s fantastic! That’s a BIG help! Is there something like that for layouts too?

 
Magento Community Magento Community
Magento Community
Magento Community
 
JazzcatCB
Jr. Member
 
Total Posts:  24
Joined:  2008-02-06
 

@ohminu: I’m confused. Maybe you can help. Shouldn’t there be a reference to each template in a layout somewhere? Why can’t I find the layout references for these templates?

- page/html/head.phtml
- page/html/header.phtml
- page/html/top.links.phtml

I must be missing something in my understanding of Magento. Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
iblastoff
Sr. Member
 
Total Posts:  252
Joined:  2007-08-31
 

note the path of those templates (page/html/head.phtml).

that generally means you can find the layout references for those in page.xml.

 
Magento Community Magento Community
Magento Community
Magento Community
 
JazzcatCB
Jr. Member
 
Total Posts:  24
Joined:  2008-02-06
 

@iblastoff: Thanks for pointing that out. Yes, I just discovered the module relationship (e.g. page) between the templates and the layouts from the webinar. However, there are no references to the templates I mentioned in page.xml. I can’t find references to those templates in any layouts.

 
Magento Community Magento Community
Magento Community
Magento Community
 
homeboy
Jr. Member
 
Total Posts:  3
Joined:  2008-02-24
 

HI guys,

Have you figured out how to NOT include things in some pages? Here is my delima:
- I created an xml page called Homeleft.phtml that defines category navigation to show on the home page
- I know that the category is defined in category.xml, so I went in there an added a reference there to homeleft.phtml
- My homepage is using the 3column layout, so I wanted is there and called homeleft: <?=$this->getChildHtml('leftMenu')?>
- I did define leftMenu in page.xml: <block type="core/text_list" name="left.menu" as="leftMenu"/>

This works GREAT...I do see my left navigation on my home page, the only problem is IT ALSO shows up on the cateloge page. But since the catelogy page already calls a left nav, I now have two of them?

so
- How do I make it so that it only shows up on the home?
- Second, and perhaps more important, is IT POSSIBLE TO define the layout/structure of the HOME page ON an phtml page, instead of through ADMIN->CMS?

i HOPE THIS MAKES sense…

Thanks in Advance,
hOMEBOY

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@homeboy: if you want to show something only on specific CMS page (home page in your case), you should put layout update XML on this CMS page in “Layout Update XML” textare below the Content textarea.

It is definitely possible to define home page in phtml, and there are few ways of doing that.

The simplest would be setting Home CMS Page Content to:

{{block type="core/template" template="myhomepage.phtml"}}

Now you can create app/design/frontend/default/default/template/myhomepage.phtml or inside another theme folder and use it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
homeboy
Jr. Member
 
Total Posts:  3
Joined:  2008-02-24
 

Thanks Moshe...this seems to do it. But still have lot of questions on h ow to control the homepage....

will save it till I am frustrated...am getting it though…

 
Magento Community Magento Community
Magento Community
Magento Community
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 
ohminu - 14 February 2008 08:56 AM

@JazzcatCB

This is exactly why we’ve created the Template Path Hints functionality wink Admin -> Configuration -> [select your store] -> Developer tab -> [enable Template Path Hints]

Has this moved/been eliminated/changed? I can’t find it.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2