обработчик макета переопределенного контроллера не работает


Я бы переопределил контроллер CatalogSearch/ResultController.
Мой config.xml нравится смотреть:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Excellence_Excatsearch>
            <version>0.1.0</version>
        </Excellence_Excatsearch>
    </modules>
    <frontend>
        <routers>
            <excatsearch>
                <use>standard</use>
                <args>
                    <module>Excellence_Excatsearch</module>
                    <frontName>excatsearch</frontName>
                </args>
            </excatsearch>
        </routers>
        <layout>
            <updates>
                <excatsearch>
                    <file>excatsearch.xml</file>
                </excatsearch>
            </updates>
        </layout>
    </frontend>
    <global>
        <rewrite>
            <excatsearch_result>
                <from><![CDATA[#^/catalogsearch/result/#]]></from>
                <to>/excatsearch/result/</to>
            </excatsearch_result>
        </rewrite>
    </global>
</config>

И мой excatsearch.xml:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <excatsearch_result_index>
        <reference name="root">
            <action method="setTemplate">
                <template>page/1column.phtml</template>
            </action>
        </reference>
        <reference name="search.result">
            <action method="setTemplate">
                <template>excatsearch/noresult.phtml</template>
            </action>
            <block type="catalog/product_new" name="new_arrival" template="excatsearch/newarrival.phtml"></block>
            <block type="page/html" name="best_seller" template="excatsearch/best_seller.phtml"></block>
        </reference>
    </excatsearch_result_index>
</layout>

Я должен видеть результат от <excatsearch_result_index>, но все равно я получаю результат от <catalogsearch_result_index>

Почему так происходит?

Author: Mohammad Faisal, 2014-02-06

1 answers

Я нашел решение.

Мне нужно добавить <catalogsearch_result_index> в мой layout xml вместо <excatsearch_result_index>, поскольку я переопределил CatalogSearch/ResultController indexAction().

 2
Author: Mohammad Faisal, 2014-02-06 12:38:13