Вопрос

When I put the following block inside catalog_category_layered handle, it works and I can call it by getChildHtml(). But when I insert it in default handle it doesn't work at all. Is the catalog.layer.state somehow reserved for an specific list of handles?

<reference name="product_list_toolbar">
    <block type="catalog/layer_state" name="catalog.layer.state" template="catalog/layer/state.phtml" />
</reference>
Это было полезно?

Решение

Inside the default handle the block with the name product_list_toolbar is not defined therefore <reference name="product_list_toolbar"> will not lead to the result you expect since it doesn't find any block in that context.

You can reference only to those blocks which are defined inside the same handle or in a previous loaded hanlde. The deafult handle is always loaded first so you can reference inside that hanlde only to blocks defined inside that handle.

Here you can find some more details about the order layout handles are loaded and overwritten https://alanstorm.com/order-of-block-creation-in-layout-updates/

Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top