Difference Between catalog_category_default and catalog_category_view – Magento 1.8

layoutmagento-1.8theme

in vendor.xml file
Difference between

<catalog_category_default >       
        <reference name="content">
            <block type="vendor/vendor" name="vendor" template="vendor/vendor.phtml" />
        </reference>
    </catalog_category_default>

and

<catalog_category_view>       
        <reference name="content">
            <block type="vendor/vendor" name="vendor" template="vendor/vendor.phtml" />
        </reference>
    </catalog_category_view>

both are showing my vendor form on all category page but what they have diff..

  1. I want to show a vendor block on particular category. how i show…..

Best Answer

catalog_category_view is loaded for all the category pages.
It's the default layout handler for the category page. The category page maps to the catalog module, category controller, view action.

catalog_category_default is loaded only for categories that are not marked as anchors.
There is also a layout handle called catalog_category_layered that is loaded for categories marked as anchor.

If you want to show a particular block for one single category, you can either make it as a static block and use the category display settings. Set the display mode as Static block and products and select the appropriate static block.
Or you can use the layout handle <CATEGORY_{ID_HERE}>. replace {ID_HERE} with the category id.
Also you can try to use the custom xml layout field in the category display settings in the backend.

[EDIT]
To use the category handle do this:
Let's say that you want to add a block for category with id 10.
Add this in the layout

<CATEGORY_10>
    <reference name="content"> 
        <block type="vendor/vendor" name="vendor" template="vendor/vendor.phtml" />     
    </reference>
</CATEGORY_10>
Related Topic