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

How to replace the default page and tab of profiles in the user account?

I installed the "Profile" module on my "Drupal 9" website. When I create a profile type, the module automatically creates a tab in the user account for each profile type. For my ...
-1
votes
1answer
29 views

How can I re-organize the user account tabs?

I have a Drupal 9 site. I can't find how to rearrange or rename the user account tabs. How can I re-organize the user account tabs?
0
votes
1answer
13 views

Translating Menu Item Programmatically?

I have been trying to translate menu items programmatically but upon saving it just adds the english field value to all my translations. Below is the code I am trying to execute: if ($entity->...
0
votes
0answers
35 views

Create multiple Menu blocks from the same menu

In Drupal 7, the Blocks page contained a link for 'Add menu block', from where you could create multiple menu blocks of the same menu. In Drupal 8, menu blocks seem to be generated automatically, ...
0
votes
0answers
17 views

Recreate the Management menu during migration

I've just done the upgrade from Drupal 7 to 8 (on a site that was updated from Drupal 5 to 6, 6 to 7...) and the management menu seems to be a bit of a mess. An attempt at trying to fix it up left it ...
0
votes
0answers
25 views

Menu link Converting full URL to local

When I save a menu link pointing to a node (nid 5, alias /woohoo/magic/test, it's value in the database is: entity:node/5 I'm trying to convert fully formed user inputs such as "http://127.0.0.1:...
0
votes
0answers
14 views

Large menu management options

I have a site with about 800 pages in the main menu. When creating or editing a node, managing the menu item parent can be challenging with a select list containing so many options! I am using Big ...
0
votes
0answers
27 views

Using TB Megamenu, how to close one submenu when I open another submenu?

I'm building a couple of (Drupal 8.9.13 and Drupal 9 based) sites where I use TB Megamenu megamenu module (https://www.drupal.org/project/tb_megamenu) to create the menu. All is working fine on ...
0
votes
1answer
36 views

Create a View Block that shows a taxonomy vocabulary applied to the current node

I have a news section of a Drupal 8 website that contains an ever-growing list of nodes. To avoid a messy menu in the long term, they do not have a menu position assigned but instead are shown via ...
1
vote
1answer
27 views

Disable menu link for certain languages

I'm looking for a way to disable a single link in a menu for a certain language. From my understanding with similar issues, I'd like to activate translation for the menu link field Enabled since this ...
0
votes
0answers
15 views

Add Image to parent item smartmenus

I have created a dropdown menu using smartmenus module, now I've got a design request asking me to add an image to each parent item. Here's the idea: My first approach was to try with Menu Items ...
0
votes
1answer
11 views

Sub Menu items not showing

I am trying to create a navigation with a sub-menu in Drupal 9. I added the top level nav item with and used # as the value for the link, and checked "Show as expanded" Then I created a new ...
2
votes
1answer
45 views

How to properly check the menu for emptiness in twig?

I use Simplify Menu to display the necessary menu markup. How do I make sure that the menu is not empty (there are items there) and if there are menu items, they are enabled? {% set items = ...
0
votes
0answers
19 views

Inject a custom menu to the Administration menu

In Drupal 8 I would like to inject a menu at the first position of the Administration menu So that an editor can create a navigational structure for all users. So I would create a "Custom Admin ...
0
votes
0answers
33 views

How would I create and render, but not save, an entire menu tree programmatically?

I'm trying to pull a number of links from several services, and combine them into a renderable menu tree: Source one: pull links A, B and C Source two: pull links D and E Source three: pull links F, G,...
2
votes
0answers
22 views

At creation time, why are shortcut titles translated, but menu link titles are not?

The idiom that the community points to for creating menu links usually looks like this (from \Drupal\Tests\language\Functional\LanguageSwitchingTest::testLanguageSessionSwitchLinks()): // Add a link ...
1
vote
0answers
18 views

systemAdminMenuBlockPage callback not respecting menu link permissions

I added a custom permission on "admin/commerce/config" to disable access for certain user roles. class RouteSubscriber extends RouteSubscriberBase { /** * {@inheritdoc} */ public ...
2
votes
0answers
31 views

Menu link tree only loads enabled elements in subtree regardless of parameters

When loading a menu tree without any custom parameters: $tree = \Drupal::menuTree()->load('my-menu-name', new MenuTreeParameters()); The returned tree \Drupal\Core\Menu\MenuLinkTreeElement[] ...
0
votes
0answers
26 views

How to make simple dynamic menu item?

I would like to move edit, delete, revisions etc. functionality of the current node from tabs above the node to the Tools menu. Is it possible to create menu link in form [current node]/edit, [current ...
0
votes
0answers
17 views

How to create a primary tab that links to the first accessible seconday tab?

In D8, for primary tabs that are local tasks an explicit route is defined. If the route is not accessible to the current user, the primary tab is hidden. Typically the same route is used again in a ...
1
vote
2answers
50 views

How do I programmatically fix local menus to be shown only for a content type?

I am using the following lines in a links.task.yml file. x.nodename_updates: route_name: view.great_view_name1.page_1 base_route: entity.node.canonical title: 'Updates' weight: 50 x....
0
votes
0answers
16 views

how to get the expanded menu tree of a menu link?

I have the following menu items - Menu item 1 -- Menu item 1 child - Menu item 2 - Menu item 3 -- Menu item 3 child - Menu item 4 I have the id of the Menu item 3 like menu_link_content:bda6f3cc-...
0
votes
0answers
18 views

How to display the child menu items in a select list?

I want to display the menu items in a select list. $items = \Drupal::service('menu.parent_form_selector')->getParentSelectOptions('main:', ['main' => 'Main']); It gives the following select ...
0
votes
1answer
68 views

Replace UID in view tab with name on user profile page

I'm working on a Drupal 8 site. I made a custom page view displaying special content created by the user. The menu tab shows on the user profile correctly by using Pathauto to show the correct address ...
0
votes
0answers
11 views

Menu Link to views with % in URL

i have the following construct that i have the following URL: /node/nodeid/fooobar Foobar is a view that uses CONTEXTUAL FILTERS to draw the node id and then render the view. This works really well so ...
0
votes
0answers
14 views

“Content”- Section in Backend cannot be displayed after installing translation module (German)

after clicking on the "Content"-button (=Inhalt) there is an error displayed. I am not able to enter the "conten" Section of my Drupal 9 backend. This happened right after I ...
0
votes
1answer
29 views

Additional attribute for menu link

How I can add itemprop="url" for each link (<a>) in main menu? So, I need to get from <a href="/node/114" data-drupal-link-system-path="node/114">Test</a&...
0
votes
1answer
44 views

<nolink> top items rendered as <a> and remain clickable (give page refresh)

I have a TB megamenu (8.x-1.x-dev) with a few top-level (parent) items that are not links, they should just trigger the submenu to drop down. According to the documentation I could find, links marked ...
0
votes
1answer
72 views

Hiding a tab on a user profile based on the user role

I'm making a site using Drupal 8 and I have several roles defined, one of them is Writer. I made a view to show as a tab in the user profile pages called Backlist. If the user is a writer, they can ...
0
votes
1answer
33 views

Menu setting not visibile for other roles on Node Form

In Drupal 8 I am creating Editor role with limited access, but the Editor cannot see "Menu Settings" while creating or editing content, this would be helpful when Editor add the node to the ...
0
votes
0answers
76 views

How to organize the summary of a book?

I created a book with the module provided by Drupal 8, but I am unable to organize the pages of the book correctly in a view. I want to organize the book in this way. In the left block, pages and sub-...
0
votes
1answer
41 views

Tabs: invalidating cache tags does not lead to a rebuild of the tabs

I have a custom route defined with a custom access check. Apart from some more checks one of the rules for accessing the path is that a specific custom entity exists. The access check does the ...
0
votes
0answers
24 views

Adding custom module path to admin menu

I created a custom module with a configuration settings page. It works fine, but I can't get it to show up under the admin configuration menu. I think the problem is I specified system....
1
vote
3answers
60 views

Custom Module to remove User Menu Tabs

I'm hoping someone can take pity on me because I just can't seem to figure out how to make a simple module to remove, or hide some tabs in my user pages. I read the docs on making custom modules, ...
2
votes
2answers
76 views

What is the replacement for menu_link_load()?

Drupal 7 has menu_link_load() to load a single menu item. What is the Drupal 8 equivalent?
1
vote
1answer
17 views

Some pages hide content unless “Read more” is clicked

If I have multiple pages on Drupal, some show the full page, and others say "Read more" and will only show the whole page when it is clicked. It doesn't seem to have anything to do with the ...
0
votes
0answers
15 views

How to add a content navigation menu based on taxonomy or parent relation?

We are new to Group module and we can't figure out how to create a content navigation menu/tree we want to place to the left of the group page. We are evaluating generating this menu by taxonomy or ...
0
votes
0answers
46 views

How to properly configure the Mega menu module?

first of all I would like to point out that I speak very poor English, sorry in advance for the poor quality of the translations... (Google Translate) I recently encountered several problems with the ...
0
votes
0answers
12 views

How do i add an attribute to a certain script tag (my mobile navigation)

my problem is, that i have to add the attribute "data-pagespeed-no-defer" to the script tag of my mobile menu. i use responsive menus which produces the following tags (if advagg is disabled)...
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
0answers
39 views

Adding classes and aria labels to menu through template file to add accessibility, Drupal 7

How can I add classes and aria labels to main menu in template file Drupal 7 to enable accessibility in main menu dropdown. "ul" and "li" tags already have styling I need to add &...
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
40 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
96 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
22 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
124 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
56 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
42 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
23 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
2 3 4 5
32