문제

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