Your shopping cart is empty. Browse our Store

Magento

Open Source eCommerce Evolved

Magento Forum

   
How to tell which layout is being loaded? 
 
Jawbreak
Jr. Member
 
Total Posts:  3
Joined:  2008-04-25
 

How can you tell which layout file is being used when a page is loaded?  Also, within the xml files there are the different handles, so how do you know what these should be and which ones are being used?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Wiseguy Digital
Member
 
Avatar
Total Posts:  55
Joined:  2007-09-17
Bristol, UK
 

Hey Jawbreak, to start with you can simply add a visual guide in the layout pages to know which ones are being used. So each of the page layouts up and add it’s name in an HTML tag e.g.

Open 3columns.phtml and then wherever you think it would be most visible add:

<pre>3columns.phtml</pre>

Do this for each page and then have a good browse through the site until you know roughly which pages use which template. Eventually you can just delete these entries.

Hope that helps,

jim

 Signature 

WISEGUYDIGITAL
Digital design, development and consultancy. From video, Flash virals, to e-commerce and bespoke development.
http://www.wiseguydigital.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
glaDiator
Member
 
Total Posts:  56
Joined:  2008-03-17
 

Turn on the Templates path hints from admin panel......... it will show you the details of every page while u browse.

 Signature 

GlaDiator
cracking my head in the wrold of open source

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jawbreak
Jr. Member
 
Total Posts:  3
Joined:  2008-04-25
 
glaDiator - 28 April 2008 03:41 AM

Turn on the Templates path hints from admin panel......... it will show you the details of every page while u browse.

Yeah I’ve done this, but this only tells you what template files are being called and not what layout(xml) files is being used to create the page.  So when designing our site, we don’t need to worry about the layout files?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Wiseguy Digital
Member
 
Avatar
Total Posts:  55
Joined:  2007-09-17
Bristol, UK
 

Ah sorry I misread your needs. The XML template files are fairly well named. The key file is page.xml as it defines the standard overall elements on the page and the next I would say is catalog.xml which sets up most of the sections used in the store.They tend to be well named, but so far it has been some trial and error for me.

I don’t know of a way of displaying this - it may be shown in the debugger, but I have not checked.

 Signature 

WISEGUYDIGITAL
Digital design, development and consultancy. From video, Flash virals, to e-commerce and bespoke development.
http://www.wiseguydigital.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
ohminu
Magento Team
 
Avatar
Total Posts:  171
Joined:  2007-08-07
Los Angeles
 

@Jawbreak-

Template hints are actually a good reference point (for what layout files are being called) for the following reason:
When the template hints displays the path of each template, it does so by revealing the name of the module that the template interacts with.
For instance, say the hints displays a template path like ‘app/design/frontend/default/default/checkout/cart/sidebar.phtml’. You will know that the page calls the layout ‘checkout.xml’, because of the layout files are all named after its module, and the template files are all organized on a per module basis.

So if the template path says:
- ‘app/design/frontend/default/default/catalog/template_name.phtml’, you know that the layout ‘catalog.xml’ is loaded in the page
- ‘app/design/frontend/default/default/contacts/template_name.phtml’, you know that the layout ‘contacts.xml’ is loaded in the page
- so on and so forth…

As to the handlers, the layout files are well commented, so by virtue of reading the comments and trying things for yourself, you should be able to figure things out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jawbreak
Jr. Member
 
Total Posts:  3
Joined:  2008-04-25
 
ohminu - 28 April 2008 02:43 PM

@Jawbreak-

Template hints are actually a good reference point (for what layout files are being called) for the following reason:
When the template hints displays the path of each template, it does so by revealing the name of the module that the template interacts with.
For instance, say the hints displays a template path like ‘app/design/frontend/default/default/checkout/cart/sidebar.phtml’. You will know that the page calls the layout ‘checkout.xml’, because of the layout files are all named after its module, and the template files are all organized on a per module basis.

So if the template path says:
- ‘app/design/frontend/default/default/catalog/template_name.phtml’, you know that the layout ‘catalog.xml’ is loaded in the page
- ‘app/design/frontend/default/default/contacts/template_name.phtml’, you know that the layout ‘contacts.xml’ is loaded in the page
- so on and so forth…

As to the handlers, the layout files are well commented, so by virtue of reading the comments and trying things for yourself, you should be able to figure things out.

Thanks for the replies.

Does this mean more than one layout(xml) file is called per page?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ohminu
Magento Team
 
Avatar
Total Posts:  171
Joined:  2007-08-07
Los Angeles
 

Absolutely smile

 
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) to request a call-back.
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
32117 users|333 users currently online|72012 forum posts