Hi Everyone,
Forgive me if I am not posting in the right place but I am new at creating child themes for OJS. I started to modify the health sciences theme to a child theme and came across some issues seeing the styling from the parent theme.
Application Version - OJS 3.1.2
Description of issue
I have followed the theming guide Child Themes
and created new files from scratch to reference the parent health sciences theme. I have not added any custom styling in the child theme so I do not have a styles folder in my directory tree. Attached below are snippets of the code I’ve written so far. Am I misunderstanding that this child theme does not need less files from the parent theme as the $this->setParent(‘healthsciences’); will automatically know to grab the less from the parent theme? I am unsure of why I cannot see any of the css from the parent theme after installing the child theme.
Steps you took leading up to the issue
After writing the index.php/version.xml/HealthSciencesChildThemePlugin.php file was created I created a tar.gz folder and went to plugins and installed it. After viewing my site, the css is non-existent, even after inspecting element on the web page I could not see the css that is supposed to inherit from parent. Below I have attached some screenshots. Has anyone run into similar issues or has any thoughts on where I might be going wrong? Thank you for reading my response.
Index.php File
<?php
require_once('HealthSciencesChildThemePlugin.inc.php');
return new HealthSciencesChildThemePlugin();
?>
HealthSciencesChildThemePlugin.inc.php File:
<?php
import('lib.pkp.classes.plugins.ThemePlugin');
class HealthSciencesChildThemePlugin extends ThemePlugin {
public function init() {
$this->setParent('healthsciences');
}
function getDisplayName() {
// return __('plugins.themes.health-sciences-child.name');
return 'health-sciences-child';
}
function getDescription() {
return 'child theme for health sciences';
}
}
?>
version.xml
<version>
<!-- The application should match the theme folder to ensure it is unique -->
<application>health-sciences-child</application>
<!-- The type should always be `plugins.themes` -->
<type>plugins.themes</type>
<release>1.0.0.0</release>
<!-- The date of the latest version -->
<date>2016-05-31</date>
<!-- This should always be 0 -->
<lazy-load>0</lazy-load>
<!-- The class name of the plugin. See index.php -->
<class>HealthSciencesChildThemePlugin</class>
</version>
**What you tried to resolve the issue **
I have re-written the code to match the guide as much as I can, I have even followed NateWr’s github example GitHub - NateWr/defaultChild: An example child theme for OJS 3.. I installed his defaultChild theme and it installed and displayed perfectly on OJS. What could I be doing wrong? Thank you for reading!
Screenshots
Child Theme After Install
Inspecting Child Theme Shows No Styling
Error log messages if applicable - No Errors from PHP error logs