[OJS 3] Static pages and the menu

Is there a means to add static pages to the horizontal mani nav menu in a journal? I think I was doing this in the theme in OJS 2.x, but haven’t got to custom theme work with 3.x yet. I thought I’d ask if there was a best practice before I start hacking into themes and templates.

Hi @verdonv,

For the moment, customizing the menu will require template overrides or modifications. This is filed for improvement at https://github.com/pkp/pkp-lib/issues/2178.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Is it possible to add some conditions for displaying menu items which consist of static pages?

For example, one of our journal has a special static page “Editorial Policy”, while the other does not have it.

If I add the following code to primaryNavMenu.tpl both journals display this menu item:

<li><a href="{url router=$smarty.const.ROUTE_PAGE page="about" op="editorialPolicy"}">
{translate key="about.editorialPolicy"}
</a>
</li>

Thus we need some <if> to check the existence of “editorialPolicy” static page.

Hi @rkhalikov,

You would need to check for the existence of the static page somewhere in the PHP code (an easy place to drop this for all templates to access it would be TemplateManager.inc.php) and then make use of the check’s results in the template file. But be warned that the static pages plugin is a plugin, and thus all its code is encapsulated in its plugin directory – adding references to it from the main codebase breaks that encapsulation. To maintain it, you could consider adding code to the static pages plugin that registers a Smarty postfilter that could hide the link when the desired static page was present.

We’re adding code to permit per-journal management of the menu bars, hopefully for the OJS 3.1 release, which should make this kind of thing a lot easier.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks, Alec!

Unfortunately, I fear this workaround is too complicated for me… :frowning: I’m not so familiar with php/smarty…

Sounds great that menu bar will be improved in 3.1, but as far as I understand this release is still very far from the final - 60% according github milestone…

Hi @rkhalikov,

We’re targeting the summertime for that release – it’s likely that many of the open issues will be deferred.

Regards,
Alec Smecher
Public Knowledge Project Team