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:
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.
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.
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 03: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.
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.
@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?
@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.
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?
@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: