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

Explain to me once and for all what the XML does. 
 
ScottSt
Member
 
Total Posts:  52
Joined:  2009-02-06
 

Magento Dudes,

I’ve spent a few weeks with the platform, created a very tricked out custom store and essentially ended up building myself a very complicated trap. I was ripping out chunks here, jury-rigging code there and by the time I got done I had a real mess on my hands. The solution was to just do a clean install and try and work in a more “by-the-book” fashion.

My biggest problem is this: I’m still not 100% certain on what the XML does. I know that it regulates the display of “blocks”, but how is that different from the pHTML? The tutorial in the template is to move the cart into the left column- Well, okay. But why didn’t I just do that in the pHTML code?

Is it because the XML acts as a kind of “style-sheet” for the display of blocks, in the same way that CSS regulates the physical orientation of the blocks?

I guess I’m just confused as to where the XML really comes into play.

Also, is there a resource for understanding what controls what? For example, if I’m in the Catalog page, I’m guessing that Catalog.xml is the place to look. But what about when viewing a single product? What XML doc is that controlled by?

Any thoughts/theory/101’s are greatly appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jballotti
Guru
 
Avatar
Total Posts:  339
Joined:  2008-04-20
Chicago area
 
ScottSt - 02 March 2009 11:44 AM

Magento Dudes,

I’ve spent a few weeks with the platform, created a very tricked out custom store and essentially ended up building myself a very complicated trap. I was ripping out chunks here, jury-rigging code there and by the time I got done I had a real mess on my hands. The solution was to just do a clean install and try and work in a more “by-the-book” fashion.

My biggest problem is this: I’m still not 100% certain on what the XML does. I know that it regulates the display of “blocks”, but how is that different from the pHTML? The tutorial in the template is to move the cart into the left column- Well, okay. But why didn’t I just do that in the pHTML code?

Is it because the XML acts as a kind of “style-sheet” for the display of blocks, in the same way that CSS regulates the physical orientation of the blocks?

I guess I’m just confused as to where the XML really comes into play.

Also, is there a resource for understanding what controls what? For example, if I’m in the Catalog page, I’m guessing that Catalog.xml is the place to look. But what about when viewing a single product? What XML doc is that controlled by?

Any thoughts/theory/101’s are greatly appreciated.

XML defines which and how the structural and content blocks are arranged on the different pages. The template (phtml) files define the content for the blocks and uses the CSS files to format the content. Viewing a single product is also controlled by the catalog.xml file (search for product view, around line 172).

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