In OJS3, it would be nice to have a hook in the Schedule for publication form.
We have a national label for peer reviewed articles and that form would be the ideal place to attach it to the article metadata. Of course I can use the submission metadata form as well, but I think that the label is closer to the kind of metadata that the permissions are.
There is a hook in that form, I think – if you look at the parent Form class it uses a little bit of basic introspection to find out what class it’s implementing, then calls some hooks automatically based on that. The form you’re looking at triggers issueentrypublicationmetadataform::display, for example, when it’s displayed.
Regards,
Alec Smecher
Public Knowledge Project Team
With that hook, if I would want to add a new form field there, would I have to change the whole form template?
Edit: or is “TemplateManager::display” actually better?
The only examples I can find using this are either adding javascripts, adding header data, using smarty filters or chancing the whole template.
What I would like to do is to use the same method that you can use with the template hooks ie. add a template to an existing template. But I guess that is not an option here?
Smarty isn’t especially easy to work with if you want to inject some code into an existing template. It’s possible, however – I don’t think we have any examples of this in OJS3 at the moment, but OJS2 does include some (e.g. the Dataverse plugin). Check out Smarty’s register_outputfilter function. This allows you to register a filter on Smarty markup; you could watch for a particular form field e.g. by ID, then inject another field after that element closes.
Regards,
Alec Smecher
Public Knowledge Project Team