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 Answer 1

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.

3
  • 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 :) Commented Sep 4, 2015 at 15:03
  • We all have our moments, glad I helped ;) Commented Sep 4, 2015 at 15:09
  • Yer some frantic ctrl-c ctrl-v before going on holiday...come back and find it's all broken :) Commented Sep 4, 2015 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.