1

我有一个模板

 app\design\frontend\base\default\template\dir\template.phtml

看起来像这样

<div class='block block-list'>  
    <div class='block-title'><strong><span>Some Block</span></strong></div>
        <div class='block-content'>  
            &nbsp;<?php echo "my content"; ?>
        </div>
    </div>

通过将以下代码添加到 local.xml 文件中,我将块定位在目录页面上。但是,是否可以同时将块定位到列的顶部?

 <?xml version="1.0"?>
 <layout version="0.1.0">    
      <catalog_category_default translate="label"> 
       <reference name="right">
         <block  type="core/template" 
            name="somename"
            template="dir/template.phtml" />
      </reference>
     </catalog_category_default>    
 </layout>

跟进https://stackoverflow.com/posts/15736207/edit

4

1 回答 1

1

用于定位 CMS 块的代码(布局 xml 文件)

<block type="cms/block" before="-" name="left.permanent.callout">
<block type="cms/block" before="some-other-block" name="left.permanent.callout">
<block type="cms/block" after="-" name="left.permanent.callout">
<block type="cms/block" after="some-other-block" name="left.permanent.callout">

使用beforeafter属性可以更改块顺序...

some-other-block是块的名称属性

http://www.magentocommerce.com/knowledge-base/entry/controlling-block-order

于 2013-04-03T08:16:34.800 回答