pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
297 stars 443 forks source link

The primary navigation menu doesn't display on the site level #9695

Closed TheBigGoldenEagle closed 7 months ago

TheBigGoldenEagle commented 7 months ago

Describe the bug On a multi-journal site, the primary navigation menu displays without issue when a journal is selected but it does not display on site level

To Reproduce Steps to reproduce the behavior:

  1. Make sure you have more than one hosted journal. Go to Administration/Site Setting/Navigation
  2. Click on "Add Menu" give it a title and assign it to the "primary" navigation area
  3. Drag any "Unassigned Menu Items" you wish and drop it below the "Assigned Menu Items"
  4. Hit "Save" clear cache and go to the main url of your website

What application are you using? OJS 3.4.0.4

Additional information I have tried almost all available themes but no matter what I do, the primary navigation menu will not display

defstat commented 7 months ago

Hi @TheBigGoldenEagle! Thanks for reporting that. Unfortunately I can't reproduce the problem that you are referring to on OJS 3.4.0.4

I have added a new Primary Navigation Menu on the Site level, and I can see it on the site level without having to do anything more. Is it possible that you are trying to access your new Site Navigation Menu from within a specific context? What is the URL that you try to access?

image

TheBigGoldenEagle commented 7 months ago

Thank you for your response and trying it out. I fought for it for a week and then gave up and added a static menu to the header.tpl. That's the best approach for me as I want a consistent navigation menu across all the hosted journals. I'm closing this issue, Thank you

defstat commented 7 months ago

@TheBigGoldenEagle thanks. The best approach would be to make your installation work though. Did you create a new theme for that, or you overrided the core/header template?

If so you may have issues on upgrading your installation, or unexpected behavior on the ui part.

If I understand correctly you want all your journals to have the same primary menu. The site navigation menu toolset manages the 'site' level and is not designed to make the a navigation menu be displayed across the installation's journals.

We could work on making a db data workaround for your case, though, and still use the build-in capabilities of navigation menus, without having any problems regarding upgrading your installation.

TheBigGoldenEagle commented 7 months ago

Thank you again for getting back to me. yes, I had altered the bootstrap theme and now to demonstrate the issue I have switched to the default theme that I have not modified its source code (except for adding a custom.less for styling). The URL PageSource is https://www.gsijournals.com/ and I have attached two screenshots of the primary menu setting that I expect to see on the site level. Settings_1 Settings

defstat commented 7 months ago

@TheBigGoldenEagle I think I know what the problem is here - you are trying to display some context related Menu Items at the Site level, something that will not work like that.

If you check the code here you can see that each navigatiuonMenuItem has a _isDisplayed property that can be calculated. For specific types like NMI_TYPE_CURRENT and NMI_TYPE_ARCHIVES, this property will be set to false if not in the context of a specific Journal.

That is the reason why you don't see something there.

TheBigGoldenEagle commented 7 months ago

It worked thank you very much!