|
Gee. The lack of documentation for Magento is just absurd… nearly every sentence of Periculi’s response above brought up more questions than it answered.
>> The block is located in magento/app/code/core/mage/core/block/text/list.php.
As far as I can tell, core/text-list deconstructs to core/block/list/text.php. That is, replace / with /block/, and subsequent hyphens with /.
>> In the xml you can find where the block is called, for instance in page.xml there is a call for the core/text_list block in the header as “top.menu” which you will find is declared in catalog.xml, and pointed to the html template top.phtml.
Is the only way to find such references by wading through directory trees?
>> In other xml pages you can find where the list is populated, for instance in customer.xml where the link My Account is added to top.links, which makes it part of the prepared list for top.menu.
Is there a way to deduce that it’s a list getting populated, or that adding a link to the top.links reference in customer.xml will make it part of the top.menu list defined in catalog.xml and called in page.xml? Or is this reverse-engineering knowledge?
>> But core/text_list actually serves more purposes than just simple list preparation. It is a generic loader for content blocks.
Is this documented anywhere? The most involved discussion on Google seems to be this thread.
>> For more clarity, you can see that the left, right and content blocks in page.xml seem to also call the use of this block. It doesn’t seem to be preparing a list…
How would one determine if it’s preparing a list or not?
>>...so perhaps it doesn’t do much? Removing the reference in page.xml removes the content placed in the block, so it looks like it really is doing something important after all. What I see there is that the text_list block sets up the empty container for the content blocks. So by saying <block type="core/text_list" name="right" as="right"/> what you are doing there is preparing a container, in this case ‘right’ to add other content blocks to. I think at that point the text_list declaration also is letting magento know that there are going to be further declarations to look for, by name for that block, i.e. ‘left’, ‘right’, or ‘content’.
Dear Varien: Magento’s layout model is quite complex, and by design, not linearly deconstructable. (it’s like traversing a singly linked list backwards - you have to search every node for one that points to you). That said, little things, like code comments, or a basic, concise map of the major default components would be quite simple to implement, and enormously simpler than hundreds of developers painstakingly desconstructing your model.
That is to say, Scavenger Hunts are great party games, but suck as a means of documentation.
|