1
我希望能够使用模板page/template/links.phtml(例如,使用模板type="page/template_links"
输出的列表的UL元素添加一个类:顶部链接,页脚链接)。添加一个类到Magento中的links.phtml列表中的UL
有没有办法通过XML添加类?属性<block />
?
我希望能够使用模板page/template/links.phtml(例如,使用模板type="page/template_links"
输出的列表的UL元素添加一个类:顶部链接,页脚链接)。添加一个类到Magento中的links.phtml列表中的UL
有没有办法通过XML添加类?属性<block />
?
这可以通过对page/template/links.phtml
稍作修改,然后为每个希望添加类的链接块创建一小块布局xml。
首先,如果你还没有这样做,在page/template/links.phtml
拷贝到你的主题,并添加UL标签的类属性里面的以下内容:
<?php echo $this->getClass() ?>
然后,取页脚链接块作为例如,布局片段看起来像这样(显然用你想应用于ul的类替换'test-class'):
<reference name="footer_links">
<action method="setClass"><class>test-class</class></action>
</reference>
很好,谢谢。 – Glo 2012-07-31 14:35:38