Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [navigation]

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

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

How to add taxonomy and menu to content Mirgation using migrate, migrate_tools, migrate_plus and migrate_source_html?

I am new to Drupal and Would really appreciate the help I am importing html pages using migrate, migrate_tools, migrate_plus and migrate_source_html it is working but I would like to also populate the ...
user avatar
0 votes
1 answer
4 views

Editing block to update/remove menu items

I am new to Drupal and I'm trying to fix items on a website, which have several blocks containing menu items. I don't want to delete the blocks, I just want to edit them to remove/update the menu ...
Karen Petkau's user avatar
0 votes
0 answers
28 views

Overriden Book Navigation template is not showing for anonymous user

On Drupal 10, I have copied and modified the book-navigation.html.twig file to my custom subtheme "templates" folder (/themes/custom/my_subtheme/templates/book-navigation.html.twig). This ...
Clément BK's user avatar
0 votes
0 answers
25 views

nodeaccess hidden main menu navigation

I have enabled the nodeaccess module for my Drupal 10 site and trying to figure out how to display the site menu navigation for certain user roles. In Drupal 7, there was a module called Always ...
Chad's user avatar
  • 1
-2 votes
1 answer
121 views

Is there a Drupal way to make a menu horizontal and responsive and leveled (similar in style and behavior to a main navigation menu)? [closed]

I have added a menu to a block in a full width region but my problem is that this menu appears vertical and I didn't find a way in Drupal to make it horizontal, similar in style and behavior to a main ...
drupaler's user avatar
2 votes
2 answers
143 views

How can I invalidate the entire cache when saving menu item?

I use the Simplify Menu module. Since changes in the menu are not applied, I would like to clear the entire cache. Unfortunately the following code does not work function ...
Joe Fred's user avatar
0 votes
0 answers
54 views

How can I prevent Drupal's translation functionality from changing a menu's links?

I have an about page at /about and a Spanish translation of the page at /es/about. However, when I visit /es/about, the links in my main menu all have /es prepended to the paths. How do I prevent ...
arnoldbird's user avatar
  • 1,213
0 votes
1 answer
117 views

Hook for hiding menu links based on user access

I have a Drupal 7 module that uses hook_preprocess_menu_link() to hide menu links based on user access. I am in the process of migrating to Drupal 9, and it seems that hook_preprocess_menu_link() ...
user avatar
0 votes
0 answers
28 views

Get current node url in a custom block [duplicate]

I'm trying to embed Discourse comments in Drupal, so I'm tryinig tu use this code snippet in a custom block : <div id='discourse-comments'></div> <meta name='discourse-username' content=...
Vanessa Lambert's user avatar
0 votes
0 answers
15 views

Italics in Text Menu Field [duplicate]

I am building a menu that contains the titles of books. This would normally be coded as <cite>Book Name</cite> in html. The Menu Link Title portion of the menu is a Text field which ...
Greg Sims's user avatar
  • 573
0 votes
0 answers
22 views

Tabs menu action when parameter is present

Building a module in Drupal 10: The module consists of several pages. All of which are accessed by tabs. The tabs are the same set of tabs for each page within. The second tab goes to a form for ...
Cy Jobes's user avatar
0 votes
0 answers
48 views

Unable to add Menu Items due to IntegrityConstraintViolationException

Background I recently encountered an error when I try to create a new menu item: Drupal\Core\Entity\EntityStorageException: SQLSTATE[HY000]: General error: 1364 Field 'parent' doesn't have a default ...
GeorgeCiesinski's user avatar
1 vote
1 answer
32 views

Include html entities in dynamic menu links

I implemented a class CopyrightMenuEntry extending MenuLinkDefault which provides a custom menu entry (without link) with the current year and the site name. class CopyrightMenuEntry extends ...
piridium's user avatar
1 vote
0 answers
90 views

Disable custom module Block Caching or force correct caching

I have build a custom module that builds out a list of child page links based on 'this' page's id. Logged in it works as expected. But an anon user has problems which range from the block not showing ...
ice70's user avatar
  • 131
1 vote
2 answers
105 views

Finding all nodes not referenced by a menu

I see this question was asked for Drupal 7, but the menu_link table doesn't exist in Drupal 9. Is there a SQL query for listing all nodes that are not assigned to a menu?
C0c0b33f's user avatar
2 votes
2 answers
90 views

How to show menu tab only for certain node type?

I have the following, In the routing.yml mymodule.cache_clear: path: '/node/{node}/cache' defaults: _form: '\Drupal\mymodule\Form\APICacheClearForm' _title: 'Cache Clear' requirements: ...
Sivaji's user avatar
  • 2,478
0 votes
2 answers
320 views

How to get translated menu link entity

I have a headless Drupal 9 solution and I'm currently working on i18n of the whole site. I've managed to do everything except menus. The content translation core module is installed and setup ...
frajer's user avatar
  • 1
1 vote
1 answer
210 views

Custom Menu Template not Rendering Menu Links

I'm building a custom module that modifies the main theme (barrio bootstrap in this case) to establish a landing page. In that process, it hides blocks in some regions and takes over rendering the ...
micbay's user avatar
  • 13
0 votes
0 answers
51 views

Group and Group content menu

I'm trying to display menu from Group page. All is ok with the module Group content menu. But when I'm trying to display the same menu on a subpage of the Group, there is no menu as if the context is ...
Gary's user avatar
  • 1
0 votes
0 answers
64 views

Menu links to media library items

Is it possible to link to media library items such as documents and images rather than be restricted to content nodes? Fairly new to Drupal development and thought this would be fairly standard but ...
Monki's user avatar
  • 1
0 votes
0 answers
45 views

How can I extend the maximum number of items in a menu?

I maintain a website where a particular content type is always displayed with a left-hand navigation menu present. As part of the process for adding new content of this, the site editors add a link to ...
user871967's user avatar
0 votes
2 answers
278 views

menu.tree_storage service is missing from my site

I have upgraded my Drupal 9 site to Drupal 10.1. One of my custom module uses \Drupal::service('menu.tree_storage')->loadByProperties(); which works fine in drupal 9.5.9, but I get the following ...
hobbsie's user avatar
  • 53
0 votes
0 answers
51 views

How can I show the "content" menu without the "Access the Content overview page" permission?

On a site, I installed the Media and Microcontent modules. I need to set up two user roles, one which should access only the "Media content overview" page and the other one which should ...
Giuseppe's user avatar
  • 971
0 votes
1 answer
330 views

How to get a menu link UUID from a menu tree item?

I'm trying to create a select box like the one that allows the selection of a menu parent on the node form. I might be barking up the wrong tree in my approach. I figured if I can get an array of menu ...
JAyenGreen's user avatar
0 votes
1 answer
239 views

Turn off caching for local tasks menu

I have a somewhat complicated view that uses multiple displays for showing events. It uses a datepager (https://www.drupal.org/project/date_pager), exposed filters (using better exposed filters), and ...
fallenturtle's user avatar
0 votes
1 answer
50 views

Can I add classes to individual menu links?

I am using the main menu /admin/structure/menu/manage/main There are a couple of links that I want to display only in mobile devices, and then also another couple of links that I want to display only ...
Juc1's user avatar
  • 369
0 votes
0 answers
92 views

New pages not included in main navigation but display in sidebar

I have recently inherited this website and was made aware of an issue where new pages that are added to the main navigation are only displaying in the sidebar. I have followed the steps for adding ...
divspan's user avatar
  • 31
1 vote
1 answer
405 views

How do I import/export menus?

I want to import/export all menus of site1 in into site2. Currently I am using the entitysync module to synchronize the content between two sites. I can see there is an option for "Custom Menu ...
user3463733's user avatar
0 votes
0 answers
49 views

Custom menu that handles content type creation

I'm a Drupal 9 newbie, and right now I'm on steep side of the learning curve. I apologize if my question is a bit messy and long. Please bear with me. I'm on Drupal 9.4.8 with a Bootstap 5 theme. I'm ...
FrankDK's user avatar
0 votes
1 answer
37 views

Add theme suggestion to a node depending on the menu it belongs to

I have a mega menu that displays child menu items when you click on a parent menu item in form of a drop-down menu. The thing is that, this menu, also displays cards as nodes and I want to add a theme ...
Alejandro's user avatar
0 votes
1 answer
30 views

Menu items are displayed differently

I have a multilingual page with the languages Spanish and English. When I edit the menu items in the backend, my default or original language is English. Now the menu links in this menu are always ...
Bavramor's user avatar
0 votes
1 answer
1k views

How do I programmatically alter the links displayed in the main navigation menu?

The main navigation menu in the site I am currently working on has a lot of menus. I want to hide the disabled ones. I figured out that it is rendered via the menu_edit_form form. entity.menu....
Binny's user avatar
  • 902
0 votes
1 answer
461 views

How to get menu Attributes from a theme's preprocess function?

I am developing a theme and trying to send custom vars to a twig menu template (since it pulls data from config) and have a loop to add variables in preprocess: foreach($attributes as $attribute => ...
adam_bear's user avatar
  • 293
1 vote
0 answers
41 views

How to disable menus from list of menus per role

I'd like to enable visibility per role of menus placed in /admin/structure/menu . What I want is to allow, for each menu (Administration, development, Footer etc + custom menus), the possibility for a ...
Sanci's user avatar
  • 103
1 vote
1 answer
506 views

How edit or alter the links in the secondary toolbar?

I'm on D9.3.x with Gin theme and Gin Toolbar. I need to edit the link available in the secondary toolbar. Namely, I'd need to hide the shortcuts link for everyone and hide the edit profile sub-link ...
Giuseppe's user avatar
  • 971
0 votes
2 answers
1k views

Add target="_blank" in menu items (main navigation)

I use Drupal 8.9.3 with custom theme. I need to do a menu item on the main navigation who go on an external link. I would like to add target="_blank" on this link, but I don't see where I ...
Gab's's user avatar
  • 1
1 vote
1 answer
64 views

Persist query string arguments across all links in a particular menu?

I have a menu "Display Style Switcher" which has two links: Map, and List. You click Map, you get the Map display of search results, and if you click List you get the list display of search ...
Lester Peabody's user avatar
1 vote
1 answer
575 views

How to add a top-level link to the Admin menu via the links.menu and routing yaml's

Let's say I want to add an additional link to the admin toolbar after Reports such as Groups does. In my_module.routing.yml I have: my_module.admin: path: '/admin/my_module' defaults: ...
JAyenGreen's user avatar
1 vote
1 answer
71 views

Problem with auto-generated url alias when attempting to make a third-level menu item

Using [node:menu-link:parents]/[node:title] as the pattern for nodes in Url Aliases works fine for a menu that is only two levels, but if I attempt to assign a node to a third level under a menu, ...
Pat Leonard's user avatar
0 votes
1 answer
145 views

How to hide / modifiy ['operations']['#links'] edit / delete under structure -> menus in D8

I am trying to hide the edit and eelete links in the operations menu under structure -> menu for specific roles. I was just trying to hide the operations dialog at all by this code but it returns ...
macbert's user avatar
  • 363
0 votes
1 answer
85 views

Update menu links based on the site URL

I have URLs defined in links.menu.yml file as "route_parameters: {webform: 'abc'}", but I need to update webform value based on the page URL. If URL has "/type1/" in it, keep ...
Thkr's user avatar
  • 143
0 votes
1 answer
584 views

theme_preprocess_menu is not seeing main menu

Background: I have an event website where I want to hide the event registration menu item when registration for the event is closed. theme_preprocess_menu is not triggering on anything except '...
user13167's user avatar
1 vote
1 answer
637 views

MenuLink vs MenuLinkContent - what's the point?

I'm struggling to figure out relationship between MenuLink and MenuLinkContent. I'm creating new menu item like: $menuItem = MenuLinkContent::create($params); I can also query those elements like: $...
MilanG's user avatar
  • 539
0 votes
2 answers
74 views

Change default user tab

After logging in, users would be redirected to their user profile page. I have added a new tab, My dashboard using hook_menu(). Everything functions well. After the users log in, I would like they are ...
MMT's user avatar
  • 41
-1 votes
1 answer
33 views

hook_menu() items disappeared and no longer work

I'm feel like I'm losing my mind here. I have written a custom module and implemented hook_menu to add custom admin pages. Last week this worked perfectly - this week they stopped working then ...
Robert's user avatar
  • 1
0 votes
0 answers
40 views

Set URL alias for dynamically created menu links via MenuLinkContent::create [duplicate]

I am creating a menu link via the MenuLinkContent::create method as follows: MenuLinkContent::create([ 'title' => $createdNodeTitle, 'link' => ['uri' => "entity:node/$createdNodeId&...
supersize's user avatar
  • 263
1 vote
0 answers
26 views

How can I delete bogus links under /admin/structure?

I am running Drupal 9.3.4. I see four bogus links under /admin/structure. See the screen shot below. These were paths used by the Context module that were deleted. They are no longer listed under /...
Dorian Winterfeld's user avatar
1 vote
1 answer
641 views

Dynamic language links from menu?

I am trying to find a way to do the following: Add languages to Drupal 9 menu items Translate content/menu links Provide (from the Main Navigation) a list of languages the current page is translated ...
Kevin's user avatar
  • 27.9k
0 votes
0 answers
685 views

How can I remove or rename tabs from the local tasks block?

I'm using Drupal 9.2.6 with Group module and I want to remove some tabs from local tasks block and rename some of them. I've created the module and placed above code with hook_menu_local_actions_alter ...
Alex Sh's user avatar
  • 11
0 votes
1 answer
103 views

Primary tabs display differently for different roles?

In my Drupal 8 site (using the Seven theme), the primary tabs navigation are displaying differently for different roles. See screenshots below. It would appear that for the limited Editor role, it's ...
Sam's user avatar
  • 819

1
2 3 4 5
33