0

We have a stylesheet that is present in a theme from an old website, since we want to keep the same overall template files but only change styles, we want to keep the old stylesheet and add another stylesheet in a new theme to override some colors and such.

E.g.

Old Theme

/skin/frontend/oldtheme/css/style.css

New theme

/skin/frontend/newtheme/css/style.css

Layout XML

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

Since the theme has been changed to a new theme, only the new stylesheet will be loaded and not the old one. I was wondering if there is a way to directly reference a CSS file that's not in the currently used theme.

I tried this:

<action method="addItem">
        <name>skin/frontend/oldtheme/css/style.css</name>
        <params/>
</action>

But it doesn't seem to be able to reference the old theme's CSS file.

Is there a way to directly reference a CSS file with a longer path?

Thanks

3
  • Why you don't change the new CSS file directly?
    – Marcel
    Jul 11, 2018 at 7:01
  • Are you updating same css file name on your layout xml? Jul 11, 2018 at 7:29
  • Because the old CSS file will be the stock standard css that we require for all new websites going forward, where-as the new CSS file will be particular to that website.
    – jack
    Jul 11, 2018 at 7:46

1 Answer 1

0

I figured it out:

  1. Extend my old theme in theme.xml of new theme.
  2. Create a new css file in new theme with a different name i.e. new_style.css
  3. Add the new css file in the layout.xml

Your Answer

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

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