I hope you don't mind me expanding on this question. Using what's explained I got the css working in my template file. But I have not been able to get it working from local.xml, so I am repeating myself several times within the same layout file.
I got to thinking that a local.xml file would be useful in this situation, so what I tried to do was take the node that worked in the layout file and wrap it in a reference node in local.xml and call that reference node
This works
frontend/base/default/layout/modulename/layoutFileForModule
<user_register_form>
<block type="page/html_head" name="head" output="toHtml">
<action method="addCss"><stylesheet>css/normalize.css</stylesheet></action>
</block>
<block type="core/template" name="prefcentre_regform" output="toHtml" template="ps/prefcentre/signup.phtml" />
</user_register_form>
This does not work
frontend/base/default/layout/local.xml
<reference name="someReferenceHandle">
<block type="page/html_head" name="head" output="toHtml">
<action method="addCss"><stylesheet>css/normalize.css</stylesheet></action>
</block>
</reference>
frontend/base/default/layout/modulename/layoutFileForModule
<user_register_form>
<reference name="someReferenceHandle">
<block type="core/template" name="prefcentre_regform" output="toHtml" template="ps/prefcentre/signup.phtml" />
</reference>
</user_register_form>
I have misunderstood a tutorial somewhere, I thought Magento would look for the layout.xml file first when it compiles all the .xml files, then by me using the reference handle I was able to reference the block within that handle.
Why does example one work and example two fail?
someReferenceHandle
? This should be one of the existing block aliases:root
,head
,footer
,content
,left
,right
and so on. If you are referencing a block that does not exist, it's normal not to work.ps/prefcentre/signup.phtml
inside the<head>
tag of your page....unless you were hoping to see it in the page. Then you need to modify the reference name toheader
output="toHtml"
. If you are using a standard Magento layout configuration then the root block is already an output block (refpage.xml
).