1

What should I put instead of <???> to include my style on every page? (not on <customer_account_create> only)

<?xml version="1.0" encoding="UTF-8"?>

<layout>

 <???>
  <reference name="head">
    <action method="addItem"><type>skin_css</type><file>css/additional.css</file></action>
  </reference>
 </???>      

  <customer_account_create>
    <reference name='customer_form_register'>
      <action method='setTemplate'><template>address/persistent/customer/form/register.phtml</template></action>
    </reference>
  </customer_account_create>

</layout>

As suggested in similar Q&A, I tried without <???></???> or putting there default, global and cms_index_index, but none of them included the stylesheet.

1
  • As I wrote in question, <default></default> doesn't work for me, nor <rwd></rwd>. My layout file is in app\design\frontend\rwd\default\layout\mymodule_layout.xml Commented Jun 16, 2014 at 8:11

2 Answers 2

1

It depends on what kind of pages you would like to load your css.

On all pages, use:

<default>...</default>

Only on product pages:

<catalog_product_view>...</catalog_product_view>

Only homepage:

<cms_index_index>...</cms_index_index>

Etc.

Edit: Make sure you did a layout update in your module config.xml file:

<config>
    <!-- ... -->
    <frontend>
        <layout>
            <updates>
                <company_module>
                    <file>mymodule_layout.xml</file>
                </hetnieuweweb_slider>
            </updates>
        </layout>
    </frontend>
    <!-- ... -->
</config>
Sign up to request clarification or add additional context in comments.

1 Comment

As I wrote in question, <default></default> doesn't work for me, nor <rwd></rwd>. My layout file is in app\design\frontend\rwd\default\layout\mymodule_layout.xml
1

Try this (check your path):

<layout>
...
<default>
    <reference name="head">
        <action method="addItem"><type>skin_css</type><name>css/your-style.css</name><params/></action>
    </reference>
</default>
...
</layout>

May be you need Create file "local.xml" in app/design/frontend/default/[your-theme]/layout/

You can add handle with options to your layout:

<customer_account> <!-- any handle name -->
    <reference name="head">
        <action method="addItem"><type>skin_css</type><name>css/my_style.css</name><params/></action>
    </reference>
</customer_account>

And call it for example in:

<customer_account_create>
       <update handle="customer_account"/>
       ...
   </customer_account_create>

P.S. - <default></default> - should work!

1 Comment

As I wrote in question, <default></default> doesn't work for me, nor <rwd></rwd>. My layout file is in app\design\frontend\rwd\default\layout\mymodule_layout.xml

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.