Issues creating child theme

OJS 3.2.0.3. PHP 7.3.23.

I’ve been trying to create a child theme of “default”, so that I can override the outer html templates (lib/pkp/templates/common/headerHead.tpl and lib/pkp/templates/frontend/components/headerHead.tpl). I have copied these two tpl files into my custom theme tree and modified them.

I spent nearly a day and a half with my custom theme plugin (defaulthnet) showing up in the plugin list and being enable-able, but with it not appearing in the theme select list on the appearance tab. Eventually I installed NateWR’s example child theme to see if it would work.
I enabled it, and suddenly my custom theme also showed up in the appearance tab, along with the example and “default”.

No log errors.

  • Problem one: why do I have to have a third theme installed and enabled before mine is included in the list?

  • Problem two: why aren’t my custom headerHead.tpl files being honored?

Documentation notes:

  • It would have saved me some time if the docs explicitly mentioned the necessity of locales files. I didn’t bother because I had no need to modify any of the strings or messages, or add any of my own. Neither the PKP theme documentation nor the example child theme readme mention this.

  • The documentation says the parent theme name in the setparent() call should match its directory name (i.e. “default”), but the example child theme uses “defaultthemeplugin”. Both appear to work, but fiddling with this in case it was the cause of my issue cost me non-trivial amounts of time.

My custom theme files are here: https://yagi.h-net.org/hnetdefault.tar.gz.

Hi @drboone,

See: OJS 3 Does not Register Custom Plugin

Regards,
Alec Smecher
Public Knowledge Project Team

That addresses the need for enabling the example child plugin. Still no joy on the template override.

Ahh, too much of the path cloned when I copied in files from lib/pkp/templates/…

Thanks @asmecher!

1 Like