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

This should be easy . . . 
 
corbykissler
Member
 
Total Posts:  39
Joined:  2008-05-14
 

Thought I had this down, but something changed and I’m a bit stuck now.  Let me recap what I _think_ I know along with what I’m trying to do.

First off - page.xml controls all the display areas on every page in the site -everywhere - meaning that you need to either define “labels” for the areas or the labels along with the actual code snippet to display (the phtml file).

Then - I can define different templates to use to display these areas - for instance - I create a main page template and defined 4 different zones in it.

As my user moves through the site - say to the category list - I can reset the main page template to another template, say main page template 2.

The different modules are inserted via teh different xml layout files and you can also override the main template in these files.

Okay - so let’s say I’m good so far.

What I’ve done is create a module that displays on the main website page (template 1).  This module displays categories of product (all of them).

When the user clicks a product category - they should go to the main category page, which lists subcategories and also uses a new template (Template 2).

What happens now, is the user clicks on the category, I get the category url in the browswer window, but the template doesn’t change to template 2.

In the category xml file - if I override the default handle with template 2 - the main page gets changed to template 2 when template 1 should be displayed.

If I put the template override in the catalog.xml=>catalog_category_default handle - nothing happens .. .

Which leads me to this question?  How does Magento know where it’s at in the hierarchy and thus which handle to use?  And what exactly is the difference between the default handle and the other handles?

Okay - maybe that’s not so easy, but I’m _this_ close to getting the elegance of the system.

Thanks!

Corby

 
Magento Community Magento Community
Magento Community
Magento Community
 
corbykissler
Member
 
Total Posts:  39
Joined:  2008-05-14
 

Let me ask another way . .

How does Magento know which update handles to use when presenting content?

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

Loading of layout update handles happens during $this->loadLayout(); call in each controller action.

If no method arguments were specified it will load layout updates specified by <default> and <{module}_{controller}_{action}> handles.

If first argument is provided, layout updates refered by these specific handles will be loaded.

Layout update files do not have any specific handling by names, besides order of loading. So the updates for handles in page.xml, catalog.xml, etc. will be cached and loaded everywhere it is required.

Each module will specify layout files it wants to be loaded in it’s own etc/config.xml.

If you are editing <catalog_category_default> handle, you should also look into <catalog_category_layered> handle which will be shown for “Anchored” categories.

 
Magento Community Magento Community
Magento Community
Magento Community
 
corbykissler
Member
 
Total Posts:  39
Joined:  2008-05-14
 

Uhhhh, one thousand thanks.

That took care of a problem I was having from putting tags into the default section of the catalog file.

So the layer section of the file is show for anchored categories only then . .

Great - that is good information to know.

Appreciate the answer greatly!!

Corby

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top