控制magento左侧导航渲染的位置

时间:2015-03-30 13:32:06

标签: php html css xml magento

我想更改magento左侧导航渲染的位置,以便将其放置在给定类别上设置的静态CMS块之后,但在实际类别产品之前。

目前在catalog_category_layered中我设置了

    <reference name="content">
        <block type="catalog/layer_view" name="catalog.leftnav" template="catalog/layer/view.phtml">
            <block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
        </block>
        <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">

至少把它放在col-main div中,但它仍然高于静态CMS(我认为是由catalog / category / view.phtml输出的?)

我需要它在静态块之后渲染,因为该块本质上是一个全宽度的横幅。

当前的html输出是

<div class="col-main">
    <aside class="col-left sidebar col-md-3 col-xl-2 col-left-first" style="min-height: 1003px;">
    </aside>
    <section class="category-top"><img alt="" src="/skin/frontend/rwd/thejewelhut/images/cat/pandora.png">
    </section>
    <section class="category-topmobile"><img alt="" src="https://placehold.it/768x300"></section>
    <div class="col-main col-md-9 col-xl-10 category-products">
    </div>
</div>

,所需的输出将是

<div class="col-main">
    <section class="category-top"><img alt="" src="/skin/frontend/rwd/thejewelhut/images/cat/pandora.png">
    </section>
    <section class="category-topmobile"><img alt="" src="https://placehold.it/768x300"></section>
    <aside class="col-left sidebar col-md-3 col-xl-2 col-left-first" style="min-height: 1003px;">
    </aside>
    <div class="col-main col-md-9 col-xl-10 category-products">
    </div>
</div>

只是微妙的差异,但却有所不同。

想法?

1 个答案:

答案 0 :(得分:0)

尝试将=“ - ”放在leftnav块之前:

    <block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml">
        <block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
    </block>
相关问题