开发者

How to change category page layout in Magento?

My problem is I want to change my category 开发者_如何学运维page layout similar as homepage I tried a lot but didn't get the answer.


However, the best way to do this is to not edit catalog.xml, but page.xml

under , edit the first block you see there:

<block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">

change this to:

<block type="page/html" name="root" output="toHtml" template="page/2columns-right.phtml"> 

for further detail follow this link http://www.magentocommerce.com/boards/viewthread/16838/


Login to admin side

Catelog -> manage Categories -> Choose your category

Then on the tab section select Custom Design.

Change the Page Layout as what ever you want.


I am not sure if I understand your question. Anyways...

You can edit the category view at template/catalog/category/view.phtml.

If you require to use the 3 column layout like the home page, you need to assign the 3 column template in the catalog.xml file.


Edit catalog.xml from your /app/design/frontend/your_theme/default/layout/catalog.xml and in default block add a new reference block

<default>
...
        <reference name="root">
            <action method="setTemplate">
                <template>page/2columns-right.phtml</template>
            </action>
        </reference>
...
</default>

In this way, you overwrite the root block in page.xml (the main layout file Magento loads)


There is an extension located at this thread that allows you to set the page layout for your categories


Run the below given script. It will set the value “'three_columns'” to the field “Page Layout” of all categories.

$write          =      Mage::getSingleton('core/resource')->getConnection('core_write');
$updateQry  =   "UPDATE catalog_category_entity_varchar SET value='three_columns' WHERE attribute_id='61' ";
$write->query($updateQry);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜