Stack Exchange Network

Stack Exchange network consists of 175 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
1answer
27 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
13 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
15 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
15 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
18 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
12 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
47 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
21 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
20 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
20 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
19 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
20 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
40 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
8 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
47 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
31 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
1answer
40 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
15 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
21 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
votes
1answer
22 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
28 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
33 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
49 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
32 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 ...
1
vote
1answer
70 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
30 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
50 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 ...
2
votes
2answers
123 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
13 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
40 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
26 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
24 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
36 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
44 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
133 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
29 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
52 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
1answer
47 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
35 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
vote
1answer
21 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
49 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
58 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
22 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
118 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
17 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
34 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
42 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
80 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'...