Magento 块定位永远不起作用

发布于 2024-10-20 02:02:23 字数 2743 浏览 2 评论 0原文

你好,我似乎总是遇到位置块问题。

请参阅我正在处理的网站:http://www.hemptationz.com

我想要左侧的块侧边栏按此顺序出现:

Facebook Block (callouts/facebook.pthml) 货币区块 (directory/currency.phtml) 产品类别块 (vertnav/left.phtml) 信息链接块 (callouts/left_col.phtml)

这是我在 XML 布局文件中的代码:

Catalog.xml

<reference name="left">
  <block type="core/template" name="facebook" template="callouts/facebook.phtml" after="currency" />
  <block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml" after="catalog.vertnav" />
</reference>

vertnav.xml

<reference name="left">
  <block type="vertnav/navigation" name="catalog.vertnav" template="vertnav/left.phtml" before="left.permanent.callout" />
</reference>

directory.xml

<layout version="0.1.0">

<!--
Category default layout
-->
    <default>
        <reference name="head">
            <block type="core/template" name="optional_zip_countries" as="optional_zip_countries" template="directory/js/optional_zip_countries.phtml" />
        </reference>
    </default>

    <catalog_category_default>
        <reference name="left">
            <block type="directory/currency" name="currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalog_category_default>

<!--
Category layered navigation layout
-->

    <catalog_category_layered>
        <reference name="left">
            <block type="directory/currency" name="currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalog_category_layered>

<!--
Catalog Search layout
-->

    <catalogsearch_advanced_index>
        <reference name="left">
            <block type="directory/currency" name="right_currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalogsearch_advanced_index>

    <catalogsearch_result_index>
        <reference name="left">
            <block type="directory/currency" name="currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalogsearch_result_index>

    <catalogsearch_advanced_result>
        <reference name="right">
            <block type="directory/currency" name="right_currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalogsearch_advanced_result>

</layout>

谢谢,希望您能帮助我。

Hello I always seem to have problems positions blocks.

Please see the website I am working on: http://www.hemptationz.com

I want the blocks on the left sidebar to appear in this order:

Facebook Block (callouts/facebook.pthml)
Currency Block (directory/currency.phtml)
Product Categories Block (vertnav/left.phtml)
Information Links Block (callouts/left_col.phtml)

This is the code I have in the XML layout files:

Catalog.xml

<reference name="left">
  <block type="core/template" name="facebook" template="callouts/facebook.phtml" after="currency" />
  <block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml" after="catalog.vertnav" />
</reference>

vertnav.xml

<reference name="left">
  <block type="vertnav/navigation" name="catalog.vertnav" template="vertnav/left.phtml" before="left.permanent.callout" />
</reference>

directory.xml

<layout version="0.1.0">

<!--
Category default layout
-->
    <default>
        <reference name="head">
            <block type="core/template" name="optional_zip_countries" as="optional_zip_countries" template="directory/js/optional_zip_countries.phtml" />
        </reference>
    </default>

    <catalog_category_default>
        <reference name="left">
            <block type="directory/currency" name="currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalog_category_default>

<!--
Category layered navigation layout
-->

    <catalog_category_layered>
        <reference name="left">
            <block type="directory/currency" name="currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalog_category_layered>

<!--
Catalog Search layout
-->

    <catalogsearch_advanced_index>
        <reference name="left">
            <block type="directory/currency" name="right_currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalogsearch_advanced_index>

    <catalogsearch_result_index>
        <reference name="left">
            <block type="directory/currency" name="currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalogsearch_result_index>

    <catalogsearch_advanced_result>
        <reference name="right">
            <block type="directory/currency" name="right_currency" before="facebook" template="directory/currency.phtml"/>
        </reference>
    </catalogsearch_advanced_result>

</layout>

Thanks hope you can help me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无法回应 2024-10-27 02:02:23

beforeafter 属性的范围是有限的。他们只能影响

当子块core/test_list或其他自动呈现排序子项的块时,特定子块内的块顺序强>.

您没有就如何使用问题中的属性提供足够的背景信息来为您提供具体建议,但我认为您无法使用该功能做您认为可以做的事情。更明确地表达您的问题并提供代码示例以及“我期望 foo,我得到 bar”样式上下文,这将为您提供帮助。

The before and after attributes are limited in scope. They can only influence

The order of blocks within a particular sub-block when that sub-block is a core/test_list or other block that automatically renders sorted children.

You've not given enough context around how you're using the attributes in your question to give you specific advice, but I don't think you can do what you think you can with the feature. Be more explicit in your question and provide code example, along with "I expected foo, I got bar" style context, and will help you.

千仐 2024-10-27 02:02:23

您想要这个订单:
1.脸书
2. 货币
3. 垂直导航
4. 信息链接
但在您的布局中,您已指定 facebook 追求的是货币。如果你想先显示一些东西,你必须使用 before="-" (在 facebook 链接中),然后使用 after="facebook" 作为货币,after="currency" 作为 Catalog.vertnav 并使用 after="-" 为 left .permanent.callout 将其放置在底部。

You want this order:
1. Facebook
2. Currency
3. Vertical Navigation
4. Information Links
but in your layout you have specified that facebook is after currency. If you want something to show first you have to use before="-" (in facebook link), then use after="facebook" for currency, after="currency" for catalog.vertnav and use after="-" for left.permanent.callout to position it on the bottom.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文