I am currently trying to develop a child theme for classic theme and have successfully integrated classic as a parent theme.
This is the content of my ClassicChildThemePlugin.inc.php:
<?php
import('lib.pkp.classes.plugins.ThemePlugin');
class ClassicChildThemePlugin extends ThemePlugin {
public function init() {
$this->setParent('classicthemeplugin');
$this->modifyStyle('stylesheet', array('addLess' => array('less/variables.less')));
$this->modifyStyle('stylesheet', array('addLess' => array('less/components/header.less')));
}
function getDisplayName() {
return __('plugins.themes.classicchild.name');
}
function getDescription() {
return __('plugins.themes.classicchild.description');
}
}
?>
What I want to do now is to include two less files with the function modifyStyle. This works partially, only the last included less file is used. In my example header.less.
I have also tried a different name for the first argument of modifyStyle and tried 'classic' or 'classictheme' instead of 'stylesheet', but this didnât work.
The first argument needs to have different names, for example âstylesheet1â and âstylesheet2â. I also recommend to use a bit more specific names like âchildtheme_stylesheetâ or something like that, because my impression is that a generic name like âstylesheetâ which may be used by other themes or the core causes problems.
Thanks @UBWolf for the hint!
I did not realize that the first argument is just a name to freely define. I thought it somewhat has to match the name of the parent theme, so I tried the classic variations.
I have just tried to implement your solution and changed the lines
Oh, Iâm sorry, my mistake. I always use âaddStyleâ and not âmodifyStyleâ, so there are different rules. Unfortunately I have no experience with modifyStyle (so itâs probable my advice with the first argument is wrong). I assume you have to combine those two rules into one. Something like