0

I am calling a css file from a theme skin folder located at

/skin/frontend/[myfolder]/default/css/reset.css

in a layout block

<block type="page/html_head" name="head" as="head" template="[mylayoutfolder]/html/head.phtml">
    <action method="addCss"><type>css</type><stylesheet>reset.css</stylesheet></action>
</block>

This appears in the HTML but incorrectly as

<link rel="stylesheet" type="text/css" href="http://ae2015.uk/skin/frontend/[myfolder]/default/css" reset.css />

If I change the < type > to be skin_css then the output is:

<link rel="stylesheet" type="text/css" href="http://ae2015.uk/skin/frontend/base/default/skincss" reset.css />

Any clues as to what is going on gang?

1

It should be:

<action method="addItem"><type>skin_css</type><name>css/reset.css</name><params/><if/></action>

Or

<action method="addCss"><name>css/reset.css</name><params/</action>

The second is basically a shorter version of the first one. Open app/code/core/Mage/Page/Block/Html/Head.php if you want some reference.

  • DOH! thanks Mayers. I had it a few lines further down: <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name> <params></params> <if>lt IE 8</if> </action> ....what a clutz :) – Jon Holland Sep 4 '15 at 15:03
  • We all have our moments, glad I helped ;) – Mayers Sep 4 '15 at 15:09
  • Yer some frantic ctrl-c ctrl-v before going on holiday...come back and find it's all broken :) – Jon Holland Sep 4 '15 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.