magento-使用local.xml添加和定位块 [英] magento - adding and positioning a block using local.xml

查看:97
本文介绍了magento-使用local.xml添加和定位块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在

 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文件中,我将该块定位在目录页面上. 但是可以同时将块放置在列的顶部吗?

I positioned the block on the catalog page by adding the following code to the local.xml file. However is it possible to position the block to the top of the column at the same time?

 <?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

推荐答案

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

Code for Positioning a CMS Block (layout xml file)

<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">

使用之前之后属性可以更改冻结顺序...

Using before and after attribute it is possible to change the block order...

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

http://www.magentocommerce.com/knowledge-base/进入/控制块顺序

这篇关于magento-使用local.xml添加和定位块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆