Override OJS classes in theme

Dear all,

in a theme, is it possible to override OJS classes by copying the original files in the theme folder and modifying them there? If yes, which structure should the directory for this modified class file have for OJS to find it?

The reason I am asking is, that I need to include an external captcha tool (in public service I am not allowed to use reCaptcha) and hence I need to include multiple single lines of code into different class files (e.g. Form.inc.php).

I am glad for any help!

Best Regards,


Hi @GrazingScientist,

It’s possible to override templates, but not classes – at least not by simply putting the class file in a particular location in a plugin. (I’ll think about whether that kind of functionality is something we could add.)

But as for the specific task you want to accomplish – we’ve had other requests for alternate services (see e.g. reCaptcha not working from China · Issue #2993 · pkp/pkp-lib · GitHub) so if it’s something that’s broadly useful we’d consider merging other options into the core codebase, so you wouldn’t need to maintain it as a plugin.

Alec Smecher
Public Knowledge Project Team

Mh! Sad! At least my institute would appreciate to have a reCaptcha alternative out of the box.

Thanks for your quick response! :slight_smile: