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
-
Why you don't change the new CSS file directly?Marcel– Marcel2018年07月11日 07:01:28 +00:00Commented Jul 11, 2018 at 7:01
-
Are you updating same css file name on your layout xml?Sukumar Gorai– Sukumar Gorai2018年07月11日 07:29:43 +00:00Commented 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– jack2018年07月11日 07:46:05 +00:00Commented Jul 11, 2018 at 7:46
1 Answer 1
I figured it out:
- Extend my old theme in theme.xml of new theme.
- Create a new css file in new theme with a different name i.e. new_style.css
- Add the new css file in the layout.xml