我很确定你不能那样做。你得到一个,Array因为它将<url helper="core/url/getCurrentUrl"/>XML 节点解释为一个Array. 此操作将处理函数addLinkRel而不是<url />助手(从不)。
更好(也更有趣)的方法是创建一个模块,您可以在其中定义一个新的块类型来呈现<link rel='canonical' href='{$currentUrl}' />.
这是我的做法,大约需要 4 个文件:
应用程序/代码/社区/Electricjesus/Canonical/etc/config.xml
<?xml version="1.0"?>
<config>
  <modules>
    <Electricjesus_Canonical>
      <version>0.1.0</version>
    </Electricjesus_Canonical>
  </modules>
  <global>
    <blocks>
      <canonical>
          <class>Electricjesus_Canonical_Block</class>
      </canonical>
    </blocks>    
  </global>
</config> 
应用程序/代码/社区/Electricjesus/Canonical/Block/Link.php
<?php
class Electricjesus_Canonical_Block_Link extends Mage_Core_Block_Template {
}
app/design/frontend/base/default/template/canonical/link.phtml
<?php $currentUrl = Mage::helper('core/url')->getCurrentUrl(); ?>
<link rel="canonical" href="<?php echo $currentUrl ?>" />
应用程序/etc/modules/Electricjesus_Canonical.xml
<?xml version="1.0"?>
<config>
  <modules>
    <Electricjesus_Canonical>
      <active>true</active>
      <codePool>community</codePool>
      <version>0.1.0</version>
    </Electricjesus_Canonical>
  </modules>
</config>
所以,现在的方法是(在你的local.xml):
<reference name="head">
    <block type="canonical/link" name="canonical_link" template="canonical/link.phtml" />
</reference>
所以这基本上只是我在几分钟内完成的草稿,我对另一种问题使用了相同的解决方案(但范围相似)。所以,如果你愿意,可以试一试。