Dropdown Horizontal Menu

Hi All,

I work on Drupal 3 weeks ago, I am beginner.

Today i’m trying to change the menu « Tool » of the cern theme.
I would like a horizontal menu dropdown like main menu.

I have several categories and I would like the user not to have returned to the main menu each time he wants to access another category.

I would like to reproduce the hazard menu of my main menu in a block if possible.

Is there any other type of horizontal menu than the one proposed by “Tools” in the Menu category (Home -> Administration -> Structure -> Menus) ?

22

I don’t know why there are a circle a the end of « Non Ionising Radaition » and why the submenu are very different to the rest of the menu.
When I click on « Laser » for exemple, like the background is white, the submenu is hidden.

Url:
https://test-2-ep-th-safety.web.cern.ch/hazards/chemical

Your help would be greatly appreciated.
Many thanks

Hello mclercq,

I will have investigate it and come back to you later.

Kostas

Hi,

I think in general the Tools menu’s purpose is to provide moderators and content maintainers with options to manage content. It’s not a big deal since you can of course repurpose it for whatever you see fit.

The issue with how the menu is displayed has to do with how the theme renders menus: since you are using the left navigation bar region to place the menu block, it will always look like a vertical list.

To render it horizontally, you might try to render it on the Header region together with the top menu, but using the 2nd level as starting point, so it only shows the secondary level links. But in general I think showing the supporting menu on the left or right navigation bar in a vertical list of links works pretty well, so maybe you could go with that instead.

PS: The round icon on the menu should actually be an arrow that toggles the sub-menu (in your example, the Laser / Magnetic / UV menu). I guess the CSS on the theme doesn’t manage very well the icons on menus placed outside the header…

If I have some time to investigate I will update this

1 Like

Hey again mclercq,

Some notes on your implementation:

  • As @ogomezal already mentioned, its better to create a new menu item with a more specific name (eg. Submenu or Hazards menu etc) in order to make the life of the next maintainer easier. Just navigate under Administration -> Structure -> Menus and create a menu item

  • Also as Oscar mentioned, the menus on the sidebars by default render vertically. For now we do not have a way to render horizontal menus, but it is a nice feature so I will add it as a feature for the next features (eg. when you place it in the content section).

  • Regarding where the menu will appear. If you navigate to the block settings of the menu block, then you will notice that there are some settings regarding the initial visibility level and the number of levels to display.

    • Initial visibility level: You choose which level to be the initial one. For example if you choose 2, then the first level will be the children of the current page.
    • Number of levels to display: You choose the depth of the menu. In this case I think that 2 is optimal because you don’t want the users to get lost.

Can you explain exactly when you want to display the menu and what exactly you want to display in order to further help you?

  • Regarding the sidebar menu, I applied a fix and now it looks like the following image. I will apply the fix in the upcoming version of the CERN theme.
    19

Kostas

1 Like

Hi !

Thank you very much for such quick answers.

I really like what was done by @kplatis

19

It is true that currently the theme of the Cern is causing some problems on the vertical menus.

I will create my own Hazars Menu, Experiments Menu etc… and wait for the next release to use the vertical menu style that @kplatis offers.

Do you have an estimated date for the next release of the cern theme ?

Ps: @ogomezal I’m still going to try your idea for the horizontal menu in the header. I find your idea very interesting. I’ll come back to you if I’m lost.

Hey @mclercq,

Regarding the next release the workflow goes like this:

  1. New version is released by theme/module maintainers
  2. The version is pulled in the test infrastructure of Drupal websites from the Drupal admins. This action is always done when a new Drupal core version is released so that the admins will not have to duplicate their work. As you can see in the official page of Drupal core releases, a new release is deployed every ~ 2 weeks.
  3. One week after (approximately) the updates are deployed in the official [production] websites too.

So to answer your question, the next version will probably be deployed in 1-2 weeks, depending on the Drupal core.

Also if you want to apply changes in the CERN Theme, I would suggest to have a look in the CERN Override theme.

Let us know if you have more questions.

Kostas

Thanks you very much,

I like the new menu style… more clean, pretty, pleasant.