【问题标题】:control where magento left nav renders控制 magento 左侧导航的渲染位置
【发布时间】:2015-06-03 13:10:20
【问题描述】:

我想更改 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>

只有细微的差别,但会产生重大影响。

想法?

【问题讨论】:

    标签: php html css xml magento


    【解决方案1】:

    尝试将 before="-" 放在 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>
    

    【讨论】:

    • 恐怕它的位置与现在完全相同。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-21
    • 1970-01-01
    • 2013-03-30
    相关资源
    最近更新 更多