Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [navigation]

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

0
votes
0answers
5 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
7 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
33 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 ...
0
votes
1answer
28 views

Clear region with menu's per url cache

I have a region with menus, a menus displays depending on the url example if on the about page(sitename/about-us), display about menu and links as a sub menu. It works, but the problem is after ...
0
votes
0answers
22 views

Retrieving menu and turning into an array [closed]

I'm trying to get the menu and turn it into an associative array in which I will use as webservice. I manage to get it but I encountered an error in getting the subtree. here's what I have done so ...
0
votes
1answer
33 views

How do I implement a one page navigation with anchors?

So the specific functionality I'm looking for is a link on one page (e.g. drupalsite/home) leading directly to a specific section of another page (e.g. a section on drupalsite/otherpage). I believe ...
1
vote
1answer
12 views

Navigation for book collections

I'm working in a projet where I have to show a collection of books. In this website I managed using the books navigation block, for one collection with many books, with css I managed to set a tree ...
0
votes
1answer
10 views

“Expand all menu links” Menu Block selection shows all menu items in block not just active trail items

I have a menu block that I have setup with Initial visibility level = 2 and Number of levels to display = Unlimited. When I check the "Expand all menu links" checkbox and view my menu block it is ...
1
vote
0answers
15 views

How to track down what is printing the menu item?

I made a custom view page with path to admin/print and I set it to no menu under Page Settings > Menu in the view edit page. And behold I login to my site today, there's a menu item in the admin menu ...
-1
votes
1answer
20 views

dynamic drop down menu items

I'm new in drupal and I would like to add a link Projects to the main navigation menu: Projects proj 1 proj 2 ... proj n This link projects with a drop down menu with N links. Until now I ...
0
votes
0answers
24 views

Recurse through menu to check a field on the entity referenced by the menu item

working in Drupal 8 on a bit of an interesting concept. I want to be able to load a menu link on an entity provided by the module menu link (field). From there, I want to load the parent menu item ...
0
votes
0answers
27 views

How to change the icon classes using mmenu

I'm new to the drupal community, so I'm sorry if I make any mistakes in posting this question. I want to change the menu-item icons for the Mobile sliding menu module. I realize that my question is ...
1
vote
1answer
32 views

Add classes to the menu item <li>?

In a preprocess menu function(), I want to add custom classes on my li menu. For this I use this: $item['attributes']->addClass('section'); // or $item['attributes']->setAttribute('class', ...
0
votes
0answers
24 views

Rebuild menu after adding a menu item

I am migrating nodes from D7 to D8. For various reasons I am writing my own code to do this. The migration will run on a couple dozen different sites so the solution needs to be as generic as ...
0
votes
1answer
43 views

main menu link as language switcher

I have 2 language and these situation: main menu -> lang1 -> link to www.foo.com/ main menu -> lang2 -> link to www.foo.com/en All sites when switch manually on browser the language, But my main ...
0
votes
0answers
27 views

Redirect after saving referenced nodes

[Note, this question is almost identical to this one for Drupal 7, but since I never used it I cannot understand how the proposed solution can be ported to Drupal 8] I have a parent node type, let's ...
0
votes
1answer
26 views

Remove Home from menu at module installation

I can remove the "Home" tab from the main menu going to /admin/structure/menu/manage/main, but I would like to automate it so that it is done at module installation. I checked that the configuration ...
1
vote
1answer
64 views

Dynamic local tasks - caching problems

I try to create some local second level tasks depending on some settings for a custom entity. But unfortunately sometimes these local tasks do not appear - they appear again when rebuilding caching ...
0
votes
1answer
10 views

After calling drupal_flush_all_caches, menu items with access callback TRUE are giving access denied error

I was building a custom module that affected the front page and I found myself having to go clear the caches for it to take effect. So as part of the code, I put in drupal_flush_all_caches(). After I ...
1
vote
2answers
29 views

How to increase book weight range for a same-level chapters

I have a book of 33 chapters. These chapters are numbered with roman numbers: Chapter I, chapter II and so on.I'm a blind user, so I can't use drag & drop reorder. In Drupal 7, weight range is -15 ...
0
votes
1answer
21 views

Alter menu link if logged in

I have a regular node in my main menu that: if an anonymous user clicks on it, the node should be shown regularly if a logged in user clicks on it, there should be a redirect to an external website ...
0
votes
1answer
23 views

How config the single page site module

I have installed the Single Page Site module and I was follow the instructions but still don't works for me. the module conf: Menu: main Menu class/id = #block-mainnavigation Menu item selector = "...
0
votes
0answers
33 views

Why is menu_name in menu.twig null?

The first level prints the menu name but subitems do not. My menu.html.twig: {% import _self as menus %} {{ menus.menu_links(items, attributes, 0, menu_name) }} {% macro menu_links(items, ...
0
votes
0answers
40 views

Add class to UL in menu block if block has class

I have a menu that I am display in a menu block. I am using the Block Class module to add a class to my menu block. For example: I have a menu called "About Page Menu" that has 3 menu items. I place ...
0
votes
1answer
56 views

Sub-menu items in twig

How can I theme all the menu levels individually in menu.html.twig? I need to give different markup to the 2nd (child) and 3rd (grandchild) level, and in the twig I only have parent and child. {% ...
1
vote
1answer
28 views

How to prevent the conversion of text URL to link on a single URL?

I have a page that I am adding, and for my purposes I want to have a text-only URL without an automatic link, but only for that one link, one this specific page. I need to be able to add full html ...
1
vote
1answer
39 views

How to create menu overview?

I'm creating a custom menu in the administration for my module with multiple elements. This works fine by defining the forms, routes and menu links. How can I create a page like /admin/config for my ...
0
votes
0answers
25 views

How can I duplicate the auto-populating feature of the main navigation?

I'm trying to create a menu that is the same as the main navigation, but has its configuration tracked separately. This is important because there are some menu items on the new menu that I'd like to ...
0
votes
1answer
43 views

How do I add a link to the #title property of a checkbox?

I created a custom module for Drupal 8.6, and I want to post a link to my terms and conditions. This is the code I am using. namespace Drupal\commerce_agree_cgv\Plugin\Commerce\CheckoutPane; use ...
1
vote
1answer
34 views

Leaving first-level tab selected when clicking on a subtab

I have a menu like the following defined in mymodule.links.menu.yml: mymodule.page_memos: title: 'List of memos' description: 'View list of memos' route_name: view.document_list.page_1 ...
-1
votes
0answers
30 views

Converting an entity with existing contents to revisionable throws exception

I'm trying to convert a core entity (menu_link_content) to revisionable with existing data. I'm trying to figure out how to accomplish this. I saw this go to guide here - https://www.drupal.org/docs/...
0
votes
0answers
31 views

How to change access for menu link by the user roles

I have a module for Drupal 8 that allow you to administer access to the node content by user role. I need the same solution for administer access to the menu elements - do you know any solutions? ...
-1
votes
0answers
30 views

How to output the same menu in another region and add another template for this instance

I'm using Drupal 8, I would like to use one menu and create another instance of this block to put it in the footer region. This wil result in only maintaining one menu instead of two.
-1
votes
0answers
28 views

Wrap anchor links in button tags

it looks like this is the section that is drawing the navigation anchor links, I just want to wrap them in <button> <button/> tags, but I can't tell where to intercept the links? /sites/...
1
vote
1answer
19 views

Generate menu links for a view with contextual filter and parameters in the path

I have a view with a contextual filter, and a few tabs corresponding to a taxonomy. In my module.links.menu.yml I have something like this: mymodule.apple_view: title: 'List of apples' route_name:...
0
votes
2answers
35 views

Security model and menu access

Drupal 8.6.1 I have some menu items I would like to hide from some users: An administration menu with documentation about site admin; A contributors menu with documentation for contributors. etc. ...
1
vote
1answer
48 views

Adding a flag to Menu Content Link to display as a non-link [duplicate]

I have been struggling/failing for the last day to try find a way that I can add a flag/marker to the Drupal menu links that I can examine within the menu TWIG template to modify the link such that it ...
-1
votes
1answer
20 views

When does hook_menu run?

I need to edit the hook_menu function in my module. I need to add a new link to a menu, and edit the path for an existing link. Is this possible without creating a whole new module? The only ...
0
votes
1answer
20 views

Main Menu link to all newsletters and another for Articles

I am very new and not a developer. I would like to create two main menu links for newsletter content type (simplenews) and the core articles type. I want the behavior to be the same as blog. I ...
2
votes
2answers
80 views

Add Language Switcher on admin toolbar

What is the correct way for adding Language Switcher (Dropdown) or links on the admin toolbar menu from my custom module or from a contributed module?
0
votes
0answers
15 views

HTML 5 geolocation integration on GMap Module

I'm trying to use HTML 5 geolocation option with addressfield module. I have GMap, addressfield and addressfield_autocompleted modules installed. As per my understanding GMap have the option to use ...
0
votes
1answer
31 views

How to add another navigation bar/block at the top of your site?

I want to add a custom header/navigation block at the very top of my page like so, it's essentially a menu item. For example, it has two items: Home and Business. Once clicked it stays highlighted and ...
0
votes
1answer
34 views

TB Megamenu 3rd level does not expand

I'm using TB Megamenu on a D8 site. With a bit of tweaking all working fine.. However, when I try to have a third level of links I can't get this to show expanded. In the menu itself the level 2 item ...
2
votes
1answer
55 views

How to check “Show as expanded” by default on the Add menu item page

I need the 'Show as Expanded' checkbox on the Add menu item page to be selected by default. I created a module, 'expand_menu_items', and tried a hook_form_alter function to get the id, apparently it'...
1
vote
1answer
48 views

How create Menu items by permissions for a view page?

My client wants a menu with a link for each content type. Each item will displayed if the user have permission to create that content type. Each item will show a list of content only for that ...
0
votes
2answers
53 views

How to change theme template for the same block that is loaded twice on the page?

We have created two menu blocks: main_menu (region=main nav) and main_menu_footer (region=footer) that are added to all pages. They both are displaying the same main navigation menu except ...
0
votes
0answers
16 views

Custom menu item doesn't show up in admin menu bar for role

I have a D7 site using Admin Menu, and I have a URL defined in a custom menu that I want to display in the Admin Menu bar at the top of the page for two roles - Content Editor and Administrator. I ...
0
votes
1answer
96 views

Dynamically creating menu items

What I need is to add menu item to some menu, but it should have different parameters (title and url) depending on language. So I created new module and added links.menu.yml like: my_menu_item_id: ...
-1
votes
2answers
50 views

Add a svg icon before a link in menu YML

I've created a link menu and I want to add a SVG icon before it. This is my YML : double_vue_klesia.listeSwitch2: title: 'Double vue Klesia' route_name: double_vue_klesia.listeSwitch ...
0
votes
1answer
60 views

Inside drop-down menu child menus are not working

I am using bootstrap sub-theme and created a drop-down menu and set it's menu levels they are working correctly but when i extend to child menus it's not working. I have searched Expand menu links ...