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
31 views

Administration menu links are incorrect

I installed drupal 8 using composer, which installed at location /var/www/html/drupal8/web. I updated apache root directory to this location, which allows me to access the site at mysite.com (rather ...
0
votes
2answers
26 views

Build out a complete main nav menu for a module - not just adding one menu link

I've been finding a lot of info about how to add a menu link as part of a module. That works fine using the route/controller & links.menu.yml file. But I am now trying to figure out how to add a ...
1
vote
0answers
45 views

Different node parent menu for per language

My struggle with Drupal 8 continues as I moved onto i18n settings. I've enabled and configured content translation and now I'm facing issue of menu displaying untranslated pages. Popular suggestions ...
0
votes
1answer
160 views

How to define an internal link as parent in mymodule.links.menu.yml?

How do I create a menu link programmatically to a node that I can use as a parent for other links? In MYMODULE.links.module, I defined some links for my navbar: MYMODULE.parent-fruits: title: '...
0
votes
0answers
25 views

Drupal 8 Menu Block is not showing in left region for dynamically created routing page

I created some menus under 'Main Navigation' and assigned into the side bar region. I selected the depth level starting from 2 to 4.(See the screenshot) The menu block is not showing for dynamically ...
0
votes
1answer
215 views

How to allow the translation of menu links provided by my_module.links.menu.yml

I have the Configuration Translation module installed in a multilingual site and I am able to translate any menu created with the UI.... This is fine!! I have a module which is creating some menus ...
0
votes
1answer
57 views

How to add a field to menus?

I am trying to add an extra text field to the menu entity. My field is showing up and saving input but the input saves for all menus not just the one I entered the data for. This is how it is now: ...
0
votes
0answers
63 views

Token support on the menu link field

Is there is any alternative way to make token to work in the Drupal 8 menu link field other than Menu Token module. I want to use token to set as a default value when I am creating new menu, but if I ...
0
votes
0answers
24 views

Views page menu shows up on all languages

I am working on a old website built on Drupal 6 which has two languages. There is a views on which I created a page for each language, but their menus shows up on both languages. I tried different ...
0
votes
0answers
27 views

Why do I see the node ID on the menu URL instead of the path alias?

I created different menus and need them to be displayed in a node based on the language currently visited for a specific node type. Via my theme.theme, I added the following code to retrieve the menus:...
1
vote
0answers
22 views

Local action on node but path a child of node?

I have created two local actions which I want to display on my nodes, General Configuration and Advanced Configuration. General Configuration will show at node/%node, but Advanced Configuration is ...
1
vote
1answer
46 views

Non-Config Menus

I have this requirement where I would need to create a menu every time a user creates a new instance of a custom entity I'm building. One can easily do this with Menu::create() on entity creation, but ...
0
votes
0answers
54 views

Menu token not working sometimes

I am using /user/[current-user:uid]/edit to generate the user profile setting page where user can edit there profile. Sometimes it works and sometimes it displays the wrong user id and sometimes I get ...
0
votes
2answers
30 views

Menu hook callbacks not working for anonymous users

My custom error handler module is somewhat based on the customerror module, but instead of returning markup, my menu callback function redirects based on the original path. It registers error paths as ...
3
votes
1answer
330 views

Navigate to next page / previous page based on entity reference field instead of Book module

I am trying to create next/previous page links like the Book module. I have two content types, Chapter and Page. The Chapter content type contains an entity reference field (unlimited) for pages. ...
0
votes
2answers
777 views

How to load a menu item and its children menu items? [duplicate]

I have the menu item id. I want to display that menu item with its children. Suppose for example I have menu item test and it has two children menu items. So I want to load them and display it as ...
3
votes
1answer
377 views

How can I remove all contextual links?

When using the layout builder module, the contextual links module is a hard dependency. This works quite well in the context of the layout builder. But I don't want those links anywhere else, because ...
1
vote
1answer
189 views

Change Classes in Nav-Tag of Custom Menu

On a Drupal 8 installation, I have a menu in the sidebar first region. I want to add classes to bootstrap classes to the different levels of that menu. For that I created a my own menu template, which ...
0
votes
1answer
126 views

How to get links of translated node edit page in the secondary tabs

In D7, if a node is translated, let say in French and if you are in the entity.node.edit_form page then you could find 2 secondary tabs: [French] and [English] pointing to the edit_form of each ...
0
votes
1answer
113 views

How can I programmatically delete a custom menu?

I'm writing a hook_deploy_N that moves a bunch of menu items from a deprecated custom menu to some newer ones. So far, so good. After moving the items, I want to delete the old menu, but can't figure ...
0
votes
0answers
21 views

Menu links won't appear

I generated 2 entities and addtyed a new Form with the overview of them. But when I try to add links, they won't appear. I follow the guide but wont work. Form and Entities work. The routings are ...
2
votes
1answer
68 views

When I clear cache, my menu ordering seems to go out of order

When I clear cache, especially on high traffic times, my menu seems to go out of ordering. Usually I don't see any log messages except for one time: Message Drupal\Core\Database\...
0
votes
2answers
86 views

Drupal Tokens in Menu Link and Title

menu_token module is working fine to achieve the purpose. Does the module token_filter has this functionality? I can use tokens in wysiwyg using token_filter but cannot make it working for menu title ...
0
votes
0answers
46 views

getUrlObject() returning empty proto object

I'm trying to follow this post to turn my menu tree into an array I can more easily work with. When I run my code and look at $filteredArray I get: title: *Name here* url_obj: {} has_children: true ...
0
votes
1answer
36 views

Drupal 8 Accessing Menu Tree in a Block's JS

How can I pass the menu into a block's javascript? I am trying to build a block for a custom mobile menu (client wants specific logic/animations/etc) and use that in Structure > Block layout > Main ...
2
votes
1answer
270 views

How to add local task links to referenced entities for a specific content type?

I have a content type with some entity reference fields to another content types. I want to add local task tabs to the node view page, to link those referenced node. However I cannot figure it out how ...
0
votes
2answers
126 views

Breadcrumbs/menu for dynamic pages

Im breaking my head around getting the breadcrumbs set properly on views page. my views' page address is "teachers/%" where % is a term-id. I have a content type called 'program' with a field ...
0
votes
1answer
111 views

Render an HTML element before the menu with hook preprocess menu

I want to render an HTML element like <span>This is my menu</span> before my menu. I thought the most easy solution is to alter the menu. I already altered my menu to add a class. But how ...
-2
votes
1answer
70 views

Change Superfish menu on specific pages

Is there any way I can change the menu in Superfish module in specific pages? What I know so far is that Superfish uses the "Main Navigation" in the admin structures by default. Can I create a ...
0
votes
1answer
32 views

drupal 8 modifying the menu items path

I work on an drupal 8 application that use the group module with the restriction of only one group per user. i want to be able to modify the menu items so that the id of the user's group is always in ...
1
vote
0answers
27 views

How to add a span before my menu title link [duplicate]

This is the default Drupal menu: <ul> <li class="menu-item parent"><a href="" title="">0.0 Bla</a></li> <li class="menu-item parent"><a href="" title="">...
1
vote
2answers
127 views

How do I add an external link in a module?

I'm attempting develop a module in drupal-8 that provides a link to an external password reset system. Specifically on the login page I'd like a reset my password link that points to a link such as ...
0
votes
1answer
101 views

Display selected menu parent with children in sidebar

I have a menu build with taxonomy menu structured like this : Agenda agenda1 agenda2 News News1 News2 Access Access1 Access2 My main navigation is like this (no children): Agenda | News | ...
0
votes
1answer
49 views

Multiple versions of the same menu, based on associated term?

I am trying to create a site with different portals. Each portal displays content filtered to that person's user tag, i.e. Student, Staff, etc. It's easy to create a view that displays nodes with that ...
1
vote
2answers
121 views

How to add /admin/people as a tab to a custom menu?

In a custom module (association), I ceated views that are accessible thru tabs: The paths are defined in the views; Adhérents et personnes -> /association (this one is also defined as a menu item) ...
0
votes
0answers
206 views

Fix problem in off-canvas menu module for Barrio Sub-theme [duplicate]

I need help with changing a Barrio(v 8.x-4.22) sub-theme of Drupal 8 This is what I've done until now: I installed the Barrio sub-theme I installed the Responsive and off-canvas menu Drupal 8 ...
0
votes
1answer
27 views

How to add a custom module to a menu?

I am using Drupal 7. I have just built a wonderful custom module. Now I need to add it to my main menu, under the parent item "Tools and Resources." I know I can go to the homepage and click on the ...
0
votes
0answers
45 views

Update module menu link location

I have a custom module on a Drupal 8 site which has a controller defined with a menu item placed in the main menu. I would now like to move the menu item from the main menu to a different menu. I ...
1
vote
1answer
432 views

How to translate menu items with migrate?

I'm importing menu items from CSV using migrate, migrate_tools, migrate_plus and migrate_source_csv. This is an example of how I'm doing it for the original language: source: plugin: csv path: '...
1
vote
0answers
80 views

How do you update node menu links?

I am creating Drupal 8 node using code and same time I am assigning a menu link as well its working fine. I am creating a menu using this code. MenuLinkContent::create([ 'title' => $item['...
0
votes
0answers
43 views

How do you cache a menu when loading it programmatically?

I am having the below code to load the main menu tree. $tree = menu_tree_all_data('main-menu'); $parentMenu = array(); $index = 0; foreach($tree as $key => $value) { if (!empty($value['...
0
votes
1answer
137 views

How to define frontend theme (non-admin) for a given node tab route?

In my custom module I want to define a new tab associated with nodes. I have my own custom route file with the required definitions and a Links file to make sure the new route will be displayed as a ...
0
votes
1answer
44 views

Last modified date in menu link

I have a book with some child pages and I'd like to show the last modified date of each corresponding node near them in their menu tree links, or a red badge near the nodes updated during eg. the last ...
0
votes
1answer
102 views

if current_node is in menu, do something in theme.inc

I'm trying to check if the current node (of a specific content type) has been added to a menu (using the "Provide a menu link" in the node edit GUI). if it has, I need to set a variable in .theme....
0
votes
3answers
291 views

How do you deploy a change to a main menu?

We have a small D7 site. We want to deactivate a main menu item. On dev server I was able to deactivate it in /admin/structure/menu/manage/main-menu I believe The menu is stored in the DB, right. ...
4
votes
1answer
1k views

How to get a section of the menu tree based on the current node?

I am currently struggling to wrap my head around how the menu tree and menu link services work for outputting part of a menu with some custom requirements. Admittedly I don't have to do this very ...
0
votes
1answer
165 views

how to a link in Admin black toolbar

I created a custom module and how to add a link along with icon. Basically, I want to add notification icon backlinks_notifications.index: title: 'Notifications' parent: system.admin_config_ui (...
0
votes
1answer
16 views

I have a site that is translated in English and French - can't change "Home" link in menu

My entire Drupal 8 site has been translated except I can't find where to change the translation of the "Home" link. When the site is in French mode (with the /fr) all my menu items show the ...
0
votes
1answer
50 views

Building a non-config, programmatically-created, semi-dynamic, semi-manual menu

We have a custom entity called "Topic". With this entity, users can build topics and reference other content to "belong" to the topic. We also have a requirement where, whenever a user creates a topic,...
0
votes
1answer
62 views

Menu options missing in node form

In Drupal 8, despite the fact that there is a menu set for the content type, menu options are not showing in the node form. I have disabled some menu modules in case they were interfering, but with ...

1
2
3 4 5
32