Questions tagged [navigation]

Use it for questions about navigation menus and links used in a site.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

megamenu mouse over dropdown not working on mobile devices

We are using megamenu to create a dropdown menu. For each sub menu there is a dropdown which appears on mouse over of the top level menu items. There is also a burger menu which replaces the main ...
0
votes
0answers
34 views

How to get identifier for menu link item in form hook?

How to get something unique (like 'menu link id' mlid in Drupal 7) in the form for editing one menu link item? hook_form_alter(&$form, FormStateInterface &$form_state, $form_id) { $mlid=... ...
0
votes
0answers
12 views

How to get array of activeTrail menu id's based on given url

I have a custom module that returns a json output so we can dynamically build the main menu. The issue I've come across is setting the active trail for the current page and the trail up. I am trying ...
0
votes
0answers
11 views

Hook to call a function after menu rebuild?

After a menu rebuild, such as one that occurs automatically when visiting the Modules admin page, some of my Drupal JS behaviors are not in the correct state. I need to re-initialize or attach them ...
0
votes
0answers
16 views

I Cant enable the Responsive-Navigation module after installing it

I want to make the Nav menu responsive for my website and I just downloaded the files for Responsive-Navigation and responsive-nav.js plugin and copied them in modules and libraries folders ...
-4
votes
1answer
26 views

How to have all options of some menu on the same line?

In the mayo theme I use for my site, I have a footer menu. By default, the options of this menu are displayed vertically: I'd like to have the options displayed horizontally. How can I do that?
-2
votes
1answer
28 views

Getting translated version of Menu

I'm trying to get translated variant of Manu, but I can't make it work. This is code of what I'm trying to do, but this is for content node. $entitytype_manager = \Drupal::service('entity_type....
0
votes
0answers
15 views

How to show menu items depending on the user's roles and the node type?

I would like to show some menu items (merged with the main navigation menu) when viewing a node (full content) of a custom content type. Also, this menu items depend on user's roles. It could be ...
0
votes
3answers
51 views

Menu tree from taxonomy terms and nodes which belong to them

i need to create a collapsible menu tree from taxonomy terms and nodes which belong to them (not nested terms, but content pages) i'm totally stuck about it i've found solutions for nested taxonomy ...
0
votes
0answers
9 views

How can I replace Main Menu with other set of Menus as per Roles?

I am using Drupal 7.67. I would like to replace the entire set of MAIN MENU with a different set of menu that I have created for a number of specific users. I want this new menu to show when those ...
0
votes
0answers
14 views

Setting default value to custom fields in menu items

I created a custom boolean field in my menu item using this hook_entity_base_field_info function Mymodule_entity_base_field_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) { if ($...
0
votes
0answers
18 views

How to add an additional link into node links array programatically?

I would like to add a additional link into the links list of my node-type teaser-display (where "write a comment", "read more" link are located). Also I would like to pass some tokens (token module ...
0
votes
1answer
10 views

Creating 'index' content views for L1-LX within a taxonomy

Note: This is a follow-on question from Creating a displayable 'index' of content nodes within a path Ok, starting to find my feet again within Drupal, and still getting up to speed with views. What ...
0
votes
2answers
33 views

How to get and display menu items except the parent item?

Let's say my menu tree is like below: Parent Sub-Parent Child I want to get the Sub-Parent title and all child's title and url. How can I do it in Drupal 8? I have looked at this answer but it ...
2
votes
1answer
61 views

How can I translate the 'enabled' Boolean of menu items?

I'm trying to translate the 'enabled' field of a menu item in Drupal 8. So far I have written this code in mymodule.module file: function mymodule_entity_base_field_info_alter(&$fields, \Drupal\...
0
votes
1answer
23 views

How do I turn off mobile menu collapse for bootstrap 3 theme in drupal 8?

I am looking to use a different mobile menu solution and replace the default bootstrap 3 mobile menu. How can I turn off the bootstrap collapsed mobile menu function?
1
vote
1answer
26 views

Is the homepage considered in_active_trail?

I'm learning Drupal 8, so still very new to it. I'm working on customizing the main menu. I've been able to add Twitter Bootstrap to my custom theme. I've made a custom menu--main.html.twig file. I'...
0
votes
0answers
35 views

Display another page's content without changing url for drupal 8

I want to display another page's content without changing url for drupal 8 . In drupal 7 I used menu_execute_active_handler() , but drupal 8 this function is not available. I got a solution from ...
0
votes
1answer
7 views

What is needed to keep parent menu element active while browsing subpages (Bartik Theme)

Let's say we have 2 sections with pages like this structure: /section1 * /section1/page1-1 ** /section1/page1-1/page1-1-1 ** /section1/page1-1/page1-1-2 ** /section1/page1-2 ** /section1/page1-3 ** /...
0
votes
1answer
114 views

Error when upgrading to Drupal 8.7.1 on module menu_link_content

When running database updates (on domain.com/update.php) from 8.6.15 to 8.7.1, I got the following error: module menu_link_content Update make_menu_link_content_revisionable Custom menu links have ...
0
votes
0answers
20 views

Using Layout Builder With Menu Items

I recently just updated to 8.7 and for the most part everything is working well. In my dev environment I was working on a new feature using layout builder with menu_item_extras to apply a layout to ...
1
vote
0answers
28 views

Menu item URL not updating using MenuLinkManagerInterface::updateDefinition()

When trying to update an existing menu link URL/ URI with updateDefinition() - https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Menu%21MenuLinkManagerInterface.php/function/...
0
votes
0answers
25 views

How to limit the number of top level menu items

I have a horizontal top level menu and only room for 7-8 links without breaking the layout. Is there a way limit the number of top level menu items? I found an old answer to the same question on ...
0
votes
1answer
128 views

How to add a nolink menu item

I'm creating a menu item for my main navigation bar. It looks like this: module/module.links.menu.yml: top.link: title: 'Operations' description: 'Operations' parent: main menu_name: main ...
0
votes
0answers
14 views

Change maximum depth of a menu tree

I discovered today that Drupal 8 only allows you to add menu items in a maximum of 9 levels. I understand this is more than enough for most users, but I'm using the menu system to organize pages for ...
0
votes
1answer
35 views

Submenu tree problem

I have a website build with Drupal 7 CMS and I am using the Submenu tree module. Everything was working fine for months, but few weeks ago I have received a feedback from the client that all the links ...
1
vote
1answer
17 views

How do I add an extra “Add content”-link to the admin toolbar dropdown

I am trying to add some improvement to the workflow of the webmasters. Right now they have to click "Content", and then click once more on the "Add content" button. Since I am working with the "Admin ...
0
votes
0answers
11 views

Menu link title used as page title on first access

Simple problem: I defined some main menu links under /admin/structure/menu. Whenever i access the linked page, the page title shows the menu link title and not the title set in .module. Every access ...
0
votes
1answer
12 views

main menu disappears only on home page

I have a site online engcorrect.net and for some reason my menu on my homepage disappears. On all other pages, it shows. The weird thing is that on my localhost (local machine) it shows correctly but ...
0
votes
1answer
38 views

How to tell if a menu link is route:<nolink> or not?

Trying to theme a menu in Drupal 8, running into a case where we need to add classes on certain links. In the case of a menu link that is route:<nolink> we need to not add any class at all. ...
-1
votes
2answers
60 views

Switch between View Modes from the URL

Under the manage display for the user profile /admin/config/people/accounts/display, I have 4 view modes as below: Default Profile (Machine name: user.profile) Company (Machine name: user.company) ...
0
votes
2answers
25 views

Is there a way to pass multiple arguments to menu_name while creating menu links programmatically?

Am using Drupal 7. Below is my code where am trying to create menu links programmatically: $links[] = array( 'menu_name' => 'management', 'link_path' => 'myheader/config', 'link_title' => '...
1
vote
0answers
40 views

Caching of sub site menus

Preamble We currently have a Drupal 8 site that has subsites (accessed via subdomains). On the main site (non-subdomain) we have a main navigation menu defined (this is presenting correctly on the ...
0
votes
0answers
38 views

Using Layout Builder with Menus

I followed this tutorial but am having some issues. I enabled menu_link_extras and layout_builder on my site. I enabled layout builder on my menu, added a menu link and added a block to that link's ...
0
votes
1answer
41 views

Menu on the taxonomy term page

maybe the solution to my problem is quite simple but I can not find a way on the taxonomy term page to show a menu block! I use drupal 8 with bartik theme and have a menu based on taxonomic terms (...
0
votes
0answers
14 views

Creating menu tabs in a child page

I have a suite of modules that go together, and they are all ideally housed under one parent item on the 'management' menu. The normal pages of these modules are correctly being placed under this ...
0
votes
1answer
19 views

Drupal 7 how to use item menu as MENU_LOCAL_TASK and MENU_NORMAL_ITEM simultaneous?

I have hook_menu with 3 pages they are defined by default as MENU_NORMAL_ITEMs and I see them from in main menu: $items['accounting'] = [ 'title' => 'Accounting', 'page callback' => '...
0
votes
0answers
16 views

How to add menu links to a dropdown programmatically

I have added a menu item to my Drupal website via the following: business_listing.links.menu.yml business_listing.listings: title: 'Browse Members' description: 'Browse Business Listings' ...
0
votes
1answer
26 views

Render a menu block in current user's language

I have a multi-language site. How this is supposed to work is that on /fr pages, everything except main navigation block should be in French. However, main navigation menu block should be in whatever ...
0
votes
0answers
14 views

Hide “empty” menu parents

I have the following scenario: I have a sidebar that contains my mainmenu. Menuparents are linked to route:<nolink>. Those parents can be expanded using superfish (accordion). When a user has ...
0
votes
0answers
88 views

Clean URLs for pager links?

I need to change the pager links from taxonomy/term/12?page=1 to taxonomy/term/12/page/1, in Drupal 8. I know about the Cleanpager module, but it works only in D7. Its development snapshot for Drupal ...
0
votes
0answers
26 views

Need to add custom block have previous, next and up links for book page

I am stuck in an issue where I need to create a side bar block on book pages. This block will contain links for: previous chapter, next chapter and up level. Tried searching on google. Also, tried ...
0
votes
1answer
21 views

Template suggestion don't work with a custom menu link (custom route)

In a module I have created a custom link by creating a custom route inside the mymodule.routing.file.yml and the mymodule.links.menu.yml file. In my theme.theme file I have defined a hook_page_alter ...
0
votes
1answer
9 views

How do I edit the links in a filter

I don't know if this is the right forum, but I'm updating our corporate website, and picking up where the previous person in my job left off. From the main horizontal menu on the front page (...
0
votes
0answers
24 views

How can I add custom field to menu block?

I want to display a menu in my theme with an editable background. So I'm trying to add a custom field of type image on my menu block. I tried via HOOK_entity_base_field_info but it seems that block ...
1
vote
1answer
24 views

Unclickable Menu link keeps refreshing my page

Hello and sorry for my bad English. I am using Drupal 8 and i want to make a menu with categories. The menu title has to be CATEGORIES and when someone click on it, the menu has to show the categories ...
0
votes
1answer
23 views

Why do my main menu tabs show up on two lines instead of one?

In Drupal 8, I have a main menu in the "Primary menu" block of the default Bartik theme. You can see a screenshot below. This site was upgraded from Drupal 7. Why does the menu show up on two lines ...
1
vote
1answer
169 views

Add icon to module's menu item in Administration menu

I've searched for a bit and I haven't found a solution to my liking: I want to avoid adding more modules to the project. I'm very new to Drupal, so I have minimal knowledge on that matter. I have ...
0
votes
0answers
13 views

User profile local task link

How can I create a link with comments/%user in the local task in user profile page for all users. This want to include it after the "Edit" and do it programatically in the .theme file. . If I try ...
0
votes
1answer
92 views

Hiding menu item depending on specific access

I work on a D8 (8.6) I want to hide some item on my menu depending on route param onto this link. When I try to access the route I get a 403 error and works as expected but the the link inside the ...