繁体   English   中英

Magento 在 local.xml 中添加外部 CSS

[英]Magento Add External CSS in local.xml

我有以下文件

url/var/www/html/app/design/frontend/default/default/template/productslider/widget/slider.phtml

那应该使用位于 url/var/www/html/skin/frontend/boilerplate/default/productslider/css/less-compiled.css url/var/www/html/skin/frontend/boilerplate/default/productslider/ 中的 css css/sass-compiled.css

有没有办法通过 local.xml 添加我的外部 .css ?

我试过

  <reference name="head">
    <action method="addLinkRel">
        <rel>stylesheet</rel>
        <href>http://cerrajerianecochea.com.ar//var/www/html/app/design/frontend/default/default/template/productslider/widget/css/sass-compiled.css</href>
    </action>
</reference>



 <reference name="head">
    <action method="addLinkRel2">
        <rel>stylesheet</rel>
        <href>http://cerrajerianecochea.com.ar//var/www/html/app/design/frontend/default/default/template/productslider/widget/css/less-compiled.css</href>
    </action>
</reference>

解决了

<link rel="stylesheet" href="<?php echo $this->getSkinUrl(); ?>css/yourCssfile.css" type="text/css" />

尝试将它们添加为 head 部分中的文本,如下所示;

<reference name="head">
<block type="core/text" name="uniquename">
    <action method="setText"><text><![CDATA[<link href="http://cerrajerianecochea.com.ar//var/www/html/app/design/frontend/default/default/template/productslider/widget/css/sass-compiled.css" rel="stylesheet" type="text/css"/>]]></text></action>
</block>

如果这些将加载到安全和非安全页面上,请从链接中省略 http:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM