[SOLVED] OJS 3.1.2 - Bootstrap Child Theme Not Loading Parent Theme Styling

Hi Everyone,

I have written a child theme for bootstrap on OJS 3.1.2 and have followed the theme styling guide to a T Bootstrap3 Theme.
I am extremely stuck and not sure why creating a child from bootstrap 3 doesn’t load the parent styling. There are no errors in all my logs and I can’t seem to figure out what’s missing. My child theme folder is named bootstrap3-child. Any suggestions would be greatly appreciated!

Snippets of my code:

index.php
<?php

/**
 * @defgroup plugins_themes_bootstrap3 Theme plugin for base Bootstrap 3 theme
 */

/**
 * @file plugins/themes/default/index.php
 *
 * Copyright (c) 2014-2017 Simon Fraser University Library
 * Copyright (c) 2003-2017 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @ingroup plugins_themes_default
 * @brief Wrapper for default theme plugin.
 *
 */

require_once('BootstrapThreeChildThemePlugin.inc.php');

return new BootstrapThreeChildThemePlugin();

?>

BootstrapThreeChildThemePlugin.inc.php

<?php

/**
 * @file plugins/themes/default/BootstrapThreeThemePlugin.inc.php
 *
 * Copyright (c) 2014-2017 Simon Fraser University Library
 * Copyright (c) 2003-2017 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @class BootstrapThreeThemePlugin
 * @ingroup plugins_themes_bootstrap3
 *
 * @brief Default theme
 */

import('lib.pkp.classes.plugins.ThemePlugin');
class BootstrapThreeChildThemePlugin extends ThemePlugin {
	/**
	 * Initialize the theme
	 *
	 * @return null
	 */
	public function init() {
		$this->setParent('bootstrapthreethemeplugin');
	}

	/**
	 * Get the display name of this plugin
	 * @return string
	 */
	function getDisplayName() {
		return __('plugins.themes.bootstrap3-child.name');
	}

	/**
	 * Get the description of this plugin
	 * @return string
	 */
	function getDescription() {
		return __('plugins.themes.bootstrap3-child.description');
	}
}

version.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE version SYSTEM "../../../lib/pkp/dtd/pluginVersion.dtd">

<!--
  * plugins/generic/bootstrap3/version.xml
  *
  * Copyright (c) 2014-2017 Simon Fraser University Library
  * Copyright (c) 2003-2017 John Willinsky
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  *
  * Plugin version information.
  -->

<version>
	<application>bootstrap3-child</application>
	<type>plugins.themes</type>
	<release>1.1.4.0</release>
	<date>2018-06-10</date>
	<lazy-load>0</lazy-load>
	<class>BootstrapThreeChildThemePlugin</class>
</version>

48%20AM

1 Like

We ran into this as well. Finally found this bug report: Overridden plugin templates in theme not shown in child theme · Issue #4054 · pkp/pkp-lib · GitHub. The fix is there but you’ll have to pull in the changes that aren’t in a release / tag yet.

2 Likes

Hi @sarontt thank you for your response! I have been desperately trying to find a solution for this as it blocked my dev sprint. I have happily resolved the issue this morning! Thank you for your help, I hope you have a great week!

Just in case others might find this useful I am sharing a link from another post for health sciences child theme. [SOLVED] OJS Health Sciences Child Theme - Unable to Load Parent Theme Styling - #2 by Vitaliy