Change core theme OJS 2.4.8

Greetings
I sucessfully updated OJS 2.1.1 to 2.4.8.
My question is, on 2.4.8, what would be the correct way to modify the core theme so it looks the same on all journals? I’m trying to use the Mason Publishing Theme.
On the old 2.1.1 the files on templates/ were modified, I managed to change the look by doing the same in 2.4.8, and also by changing the files in lib/pkp/templates/common/, but I’m lost as to which should I use and where would the CSS modifications should go, and what else has to be done besides that.
Any help is appreciated.

Hi @NULL-SWEAT,

The Mason Publishing Theme overrides many built-in OJS templates with its own contents; look for these in plugins/themes/mpg/templates. You can accomplish the same as you did before by editing the templates/CSS there.

Generally speaking this isn’t ideal, because you’ll need to make sure you preserve the modification across future upgrades; we’ve addressed this in OJS 3.x by permitting child themes, which can selectively override other theme contents. If and when you’re ready to move to OJS 3.x, I’d suggest looking at that instead.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks for the answer @asmecher

Unfortunately I was told to use v2.4.8 by the university, so I’ll stick to editing the files in mpg/.

Is there a var I can set to make the mpg theme as default for all journals?
I started working on OJS last week so I’m still in the process of understanting and finding my way in it.

Hi @NULL-SWEAT,

There’s no quick way in the UI to set all journals to the same theme, but if you want to change this in the database you can alter the journal_settings table. Look for…

SELECT * FROM journal_settings WHERE setting_name='journalTheme';

Make sure you flush your data cache (e.g. rm cache/*.php) after changing the settings directly in the database.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

@asmecher
Exactly what I need.
Thanks a lot!

Hi @asmecher

That didn’t work for me, the setting_name='journalTheme' row only appears in the journal_settings table after I change a journal’s theme via the UI, so I can’t set the setting_value to 'mpg' for the entire site and all journals in one go.

My solution was to set the variable $themePluginPath='mpg'; in classes/template/TemplateManager.inc.php, instead of letting it get it’s value from the DB.

Thanks again for the support.

Hi @NULL-SWEAT,

That should work too. Glad you got it going!

Regards,
Alec Smecher
Public Knowledge Project Team