is there a way to change the logo option in the theme settings in OJS 3.2.1? The function modifyOptionsConfig seems to only be usable on the theme page, not the setup page (which is quite logical).
I would like to change the Label, because we are using the Logo in a slightly different way.
Yeah, as youāve discovered the logo is not part of the theme options and so isnāt one of the fields configured by the theme. Instead, you can use a hook to modify the fields of any setup form. The one you want is FORM_APPEARANCE_SETUP. Something like this should work if you put it in your themeās init method:
HookRegistry::register('Form::config::before', function($hookName, $form) {
if (!defined('FORM_APPEARANCE_SETUP') || $form->id !== FORM_APPEARANCE_SETUP) {
return;
}
// Look through $form->fields to find the field
// with an id of pageHeaderLogoImage, and replace
// the label with whatever you want. Something
// like the following (untested)
$form->fields = array_map(function($field) {
if ($field->id === 'pageHeaderLogoImage') {
$field->label = __('your.custom.locale.key');
}
return $field;
}, $form->fields);
return false;
});
In case anyone else wants to do this: Insteadt of āif ($field->id === āpageHeaderLogoImageā)ā it is āif ($field->name === āpageHeaderLogoImageā)ā.