簡體   English   中英

將過濾的分層導航添加到Magento中的1列類別頁面

[英]Add Filtered Layered Navigation to 1 Column Category Pages in Magento

我正在運行帶有RWD主題的Magento 1.9.1.0。 2 columns with left bar將頁面布局設置為2 columns with left bar我可以正確看到左側邊欄中的過濾器(按價格等排序)。 如何在1 column頁面布局中使用此功能(僅適用於類別)? 我想在產品的頂部使用Catalin SEO目錄分層導航(用於幻燈片價格欄等)創建全尺寸版本。

1column.phtml模板沒有左側的塊,這是通常插入層視圖塊的位置。 在local.xml中執行此操作的一種方法是將塊放入內容(或after_body_start或before_body_end或任何core / text_list子塊):

<catalog_category_default>
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
    <reference name="content">
        <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
            <block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
        </block>
    </reference>
</catalog_category_default>

在CSS中,如果您不希望它顯示但仍希望它加載,則可以隱藏html圖層塊:

.category-mycategory .block-layered-nav {
    display: none;
}

mycategory是您的類別名稱。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM