Creating child theme

Hello again,

I have tried creating child theme for defaultManuscript (which is already a child theme for default one) per @ajnyga 's advice (to preserve changes more easily thru future theme/ojs upgrades).

I followed @NateWr guide here and it works for the most part - new child theme shows up in the Settings/Website/Appearance and all but once I select and save - front end breaks. It looks as if there is no style sheet applied to it. I’m pretty sure index.php and version.xml are not to blame. My guess is that I failed to set parent theme properly.

Could someone more experienced look into this and tell me what I did wrong?

Copy of my *Plugin.inc.php file below:

<?php

import('lib.pkp.classes.plugins.ThemePlugin');

class tomsChildThemePlugin extends ThemePlugin {

        public function init() {
                $this->setParent('DefaultManuscriptChildThemePlugin');

/**
 * Modifications below
 *              $this->
 */

        /**
         * Theme name & description
         */

        function getDisplayName() {
                return 'ToMS';
        }

        function getDescription() {
                return 'Child theme of defaultManuscript.';
        }

}

?>

Thank you.

P.S. Template cache was cleared after applying theme (and any modificiation)

Something isn’t right with setParent parameter. Maybe you need something like: 'defaultmanuscriptthemeplugin'

3 Likes

I tried that and then figured to try $this->setParent(‘defaultmanuscriptchildthemeplugin’);

It works now - appears that theme name is case sensitive…

Thank you @Vitaliy

1 Like

Dear @Vitaliy @ToMS
Is there any more detailed docs to make a child theme? I am a journal editor with not coding background.

I have read this https://github.com/NateWr/default-child but my amateur question is where do we start making it? Is it via GitHub or somewhere?

@NateWr refer to this thread Customize manuscript child theme - #3 by NateWr

Usually I clone the project that I’m interested in my repository and then from there to the local machine. You need install git to use git command from command line. You can skip this and do all changes just on your computer.

You can make a test OJS installation on your local computer (I use XAMPP as a server on a Windows) to test the theme there.

1 Like

As for guide: https://pkp.gitbooks.io/pkp-theming-guide/content/en/child-themes.html

2 Likes