I tried reading the documentation but I still don’t really understand how magento’s xml layout files work.
In the directory app/design/frontend/default/modern/layout, i see a lot of xml files. How do I determine which xml file any given page on the website is using?
For example, if I were on the home page at http://mysite.com, which layout xml file am I using? What if I’m on http://mysite.com/hello-world, which xml file then?
High level version: You’re never using just one layout file.
All the XML files are combined in a giant XML file called the Package Layout.
Then, each page request products a number of special string symbols called “handles”.
Then, the Package Layout is searched for nodes that match these handles.
The nodes that match are combined into a single XML files called the Page Layout.
That’s the layout file any particular request uses.
(shameless, but useful, plugs follow)
I wrote a more in depth article on this, and if you go to the Commerce Bug demo page and look at the Layout tab, you can see an example of the handles any page request produces, as well as see output for the Package and Page Layouts.