Display variable viaTemplateManager::display doesn't work everywhere


We use OJS

In order to display some informations that aren’t provided out-of-the-box in some pages of our journals, we added functions in our themes to pass data to templates by using the event TemplateManager::display, and it works fine. We passed for example a variable in template “primaryNavMenu.tpl”.

However, we noticed somewhere where it is not working.

When a user registers in a journal, there is a redirect via the template “frontend/pages/message.tpl” to display a message of confirmation. The event TemplateManager::display seems to not be called in this template and it generates an
error. There is error in error_log file which indicates that variable in “primaryNavMenu.tpl” doesn’t exist.

Do you knwow how to solve this problem ?

Thanks in advance for your answer.
Best regards.

Hi @hcl,

According to the code, the frontend/pages/message.tpl template is registered by a fetch method, not the display. This method has TemplateManager::fetch hook. The same applies to frontend/pages/error.tpl. @NateWr, do you think it makes sense to change this?

@Vitaliy yes, good spot and it makes sense to change that. :+1: Mind filing an issue?

1 Like