Dear Magento team, Dear All
I’ve just started studied Magento, and as a web-designer, I think I’ve been reading everything that could’ve help me understand the structure of this beautiful engine, for my personal needs and customization.
However, the more I read the more questions are coming to my head and I am just unable to find answers as you don’t provide consistant documentation, or what we would call a ‘codex’ for Magento.
I found the Designer’s Guide itselft very vague and unprecise on a lot of important points. It is a great base to understand the whole concept but we are constantly introduce with words and new concepts that are not explained and that don’t find their answers in it.
Now, this post took me more than one hour to compose, and I really hope I will be able to find answers and get your attention on some points that might need a bit of clarification.
This post’s first purpose is not to blame or criticise. Magento looks great and the only thing I’d like is to learn more and more about it. However, there is no really efficient tool or reference to help. While every concept and term makes sense to you guys, it is still ready hard for us designers to integrate.
Anyway, here we go. While some of my question might look stupid to you because the answer might seems obvious, I really need clarification on the following points. Without it I won’t be able do develop something on Magento. Thanks in advance :
Building Your Theme -> Step by Step Guide to Building a Theme -> Where to find layouts
In the Skeleton Template explanation:
*(...), you will create the (X)HTML markups for each structure type and save them as skeleton templates (...).*
So basically, any page of the store can have a different structure, and this structure is defined by the markup of those skeleton templates?
*Upon scanning through the sample skeleton template above, you will notice a PHP method called <?=$this->getChildHtml()?> inside each presentational markup. This is the way Magento loads structural blocks into skeleton templates and hence is able to position all the contents of the structural blocks within a store page.
So basically this function works like an ‘include’ and should bring content from the structural block template into their assigned markup areas?
*Skeleton templates are assigned to the store through the layout.*
What does this mean? Aren’t we supposed to place our objects with CSS? Can you define what you are calling ‘layout’ for magento in common and easy english please?
Cut up your (X)HTML according to functionality.
*Once youÃ¢â¬â¢ve created your skeleton templates, you will now need to create the template for each content block.*
When do we create the template for a structural block?
So far what I understood is that, we have our presentational markup (the basic divs), that contains a simple call to its structural block. Which contains the content blocks. So where is the step to building the template for structural markup?
Let’s continue further:
*Each layout file (should it be necessary) further sections into per-page basis layout command.*
This sentence makes no sense to me. Where is the verb? It looks like a very important point to me, althought I can’t understand it. Can you please clarify?
*A default layout (page.xml) is the layout that by default applies itself to almost every page in the store.*
Does that mean that the main and almost most important layout file is the page.xml file? If yes, why is not more visible in the guide? Is this small sentence, hidden in the middle of the guide, is supposed to introduce one of the major convention/concept of magento?
So I continue to the example, hoping it’ll help me understand or confirm this:
*(...) you want a two-column structure that includes a right column. To accommodate this, you will leave the default layout alone and open catalog.xml in which you can place some layout commands that tells the application to load the two-column structure to your product page instead of the default three.*
Catalog.xml?? Am I supposed to know that? Is it obvious? Does this mean that the catalog.xml file is handling the behaviour of the product page? Is this again a convention that is introduced in a simple example? What about the customer.xml file as well?
If those are really conventions to magento, wouldn’t it make sense to clearly mention it, or to make a list of what each xml file reffers to? I mean it has been certainly written by someone who knows the subject well but, me as a newcomer who is trying to teach himself with those lines, it’s making me asking a lot of questions.
Okay, maybe this will be explained in the next chapter, Intro to layouts see part 2 :