I developed a custom theme for Magento 1 for one of my projects. Or tried to follow the guidelines of the communites. I have not overwritten the files {layout}.xml I have created new ones on a module and modified the concerned designs. I also created some Block classes that extended the originals but modified some small logic.

I have a doubt though. In these pages all, for convenience, I overwritten the block: "content" entirely, because the structure was always totally different:

<block type="core/template" name="content" template="myfront/page/catalog/category/content.phtml">

Not using <reference name = "content"> and the various methods inside to customize.

Is this wrong / discouraged? or can I be calm? :)


In the native layout page.xml, the block content is defined as a core/text_list block :

<block type="core/text_list" name="content" as="content" translate="label">

It seems that you have overrided it with a core/template block :

<block type="core/template" name="content" template="myfront/page/catalog/category/content.phtml">

This could be the cause of a lot of issues as a core/template block and a core/text_list block don't have the same behavior.

For example, every childs of a core/text_list block will be rendered without having to write echo $this->getChildHtml('your-child') in the associated template (you can have a look to app/code/core/Mage/Core/Block/Text/List.php:35 in order to understand why).

  • This is clear, it is calculated, it is not a problem in this case. I wanted to know if there were any best practices that advised against this. – BOES Mar 14 '19 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.