I would like to have a menu item that doesn’t link to a page in order to put child pages underneath it. This seems to be possible by creating a menu item and setting the link to “<nolink>”. However, in this case the styling appears to be wrong:
Is this not supported with the CERN theme?
What is the use case that you want a menu link not being a link?
Doing that creates inconsistencies because you will have a 1st level menu like:
TEST: not a link
SOMETHING ELSE: link
so the users will not know which one is a link and which one is not. What I do when I do not have a page to link to, I just link to one page from the submenu that is the most relevant.
For example If you have:
---- ALL BANDS
---- ROCK BANDS
---- JAZZ BANDS
you can link both
ALL BANDS to the same page.
Let me know what you think of it.
I would only use this for menu items that have children, so hovering over them reveals the sub menu. Not sure then that it would be confusing to users, this is quite a common interface paradigm.
Linking to one of the pages would be an option, of course. But it is not always as obvious as in your example that there is a single “default”.
I managed to sort of fake what I want by linking to “#”. The only issue is that clicking the link then reloads the current page. See the “Events” menu item on:
To me, as Drupal supports
<nolink> then this is a bug with the CERN theme. Looking at the source code, if the menu item is a link then you have:
<ul class="nav navbar-nav">
<a href="/link" class="dropdown-toggle">Text<span class="caret"></span></a>
While if it is a
<nolink> you have:
<ul class="nav navbar-nav">
<span class="dropdown-toggle">Text<span class="caret"></span></span>
So the only difference is the replacement of the
a tag with a
span with the same class.
In the CSS the styles are applied to
body header .nav > li > a which should be relatively simple to extend to also support the span.
You are right on that so I created
a Gitlab ticket to be deployed in the next patch version of the theme.
Thanks for following this up.
a fix to the issue you mentioned. The following screenshot shows how menu items that are not links (last item of the menu) will be displayed starting from
v2.6.4 of the CERN Theme.
Thanks for reporting this.
Thank you for the quick follow up. When will the
v2.6.4 of the CERN Theme be released and how do I upgrade to it?
I don’t know exactly when, most probably in the next few weeks. If you are an admin in the website you will get an e-mail when the deployment is applied. It is also announced in the
Announcements section of the forum.
how do I upgrade to it
You dont need to do anything on your side since the Drupal infrastructure is centralised and when the theme is updated, the update is applied in all websites.
Let me know if you need something more.