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

asked Jul 11, 2018 at 0:17
3
  • Why you don't change the new CSS file directly? Commented Jul 11, 2018 at 7:01
  • Are you updating same css file name on your layout xml? Commented 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. Commented 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
answered Jul 11, 2018 at 7:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.