Magento Forum

Relation between xml layout handles and controller/actions
 
mp_daniel
Jr. Member
 
Total Posts:  17
Joined:  2009-03-25
 

Hi,

I’m a little bit confused with the naming convention of xml layout handles.
As far as I know is the handle named as module_controller_action.

For example, catalog.xml contains a handle catalog_category_layered_nochildren.

In the directory app/code/core/Mage/Catalog/controllers is a controller CategoryController.php, but the class code inside the
file has no function layered_nochildren_action() or anything else.

Has the naming convention changed?

And the second question: Is it true, that for each controller action which is called the corresponding xml handle applies to the layout?
I want to know how magento makes the decision which layout xml must be used for the current request (home page, product view, categories and so on..)

 
Magento Community Magento Community
Magento Community
Magento Community
 
mp_daniel
Jr. Member
 
Total Posts:  17
Joined:  2009-03-25
 

...is the magento community dead?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Periculi
Sr. Member
 
Total Posts:  249
Joined:  2009-02-03
 

Not entirely dead but generally incapacitated, for most of us just don’t know how to answer your question or where to find any answers at all.  There are plenty questions, and very few answers in these forums.  Especially to anything slightly technical.

In CategoryController there is viewAction(); in which there is:

if (!$category->hasChildren()) {
                $update
->addHandle('catalog_category_layered_nochildren');
            
}

So, wouldn’t viewAction(); be what you are looking for in regards to how the controller relates the xml handle?

I want to know how magento makes the decision which layout xml must be used for the current request (home page, product view, categories and so on..)

Me too.

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