Questions tagged [navigation]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
317 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
94 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
256 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 ...
3
votes
2answers
1k 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
80 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
198 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 ...
1
vote
1answer
34 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
32 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
3answers
3k 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
268 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 ...
2
votes
1answer
267 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
242 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
42 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 ...
2
votes
1answer
287 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
118 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
209 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 ...
0
votes
1answer
23 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
3answers
468 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
1answer
676 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
188 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
2answers
292 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
682 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
618 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
1answer
787 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
325 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
1k 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 ...
1
vote
1answer
369 views

How to add an sms:number link to a menu?

In Drupal 8.5, when you're adding a menu item, you can add a telephone number by setting the Link to tel:1-555-555-5555. However, if you try to add an SMS link like sms:1-555-555-5555, it fails ...
1
vote
1answer
881 views

Adding onclick attribute to menu links

I'm trying to add the onclick attribute to some menu links in Drupal 8 in order to track conversions with Google. Here's a tutorial for adding onclick events in Drupal 7 that uses the Menu Attributes ...
0
votes
0answers
261 views

route:<nolink> looses styling and not working correctly in Superfish menu

I have set the parent item (reaching-out) on my main superfish menu as a "no link" item so that only the dropdown menu items link to pages. On doing so I lose my styling which is OK because somehow I ...
1
vote
0answers
1k views

How do I use the Bootstrap 4 mobile menu in a Drupal 8 theme? [closed]

I am trying to make a Drupal 8 theme from an existing HTML page. The page uses the Bootstrap 4 menu. I was able to get the normal version (desktop) of the menu working by copying menu--main.html.twig ...
1
vote
1answer
4k views

Add .active class to a menu link when other menu link is clicked

I have following scenario: Drupal 8.5.6, with a bootstrap subtheme. There are 2 menus (I'll call them main menu and secondary menu). The links in the main menu are geographic areas, I've managed to ...
3
votes
2answers
2k views

How can I add a span tag inside my menu link?

My twig file contains the following: <li{{ item.attributes.addClass(classes) }}> {{ link(item.title, item.url) }} </li> Which outputs: <li class="menu-item item--search"> &...
0
votes
2answers
704 views

How can I add "data-target" additional attribute in mega menu?

How can I add an additional attribute to menu item I am using mega menu? On element inspect my current menu url is displaying as : <a class="we-mega-menu-li activeNav" title=""href="/clients/...
0
votes
1answer
302 views

Per language menu item settings in node forms

I'm working on a drupal 8 website. On every node the admin can choose wether or not to show a node in the main menu, and where it should be placed. This works great with the menu settings node form ...
0
votes
1answer
97 views

How to add a block to a region in html.tpl?

I'm using Drupal 7. I have a custom template html--custom.tpl.php. I have a custom block that contains the main menu. This block is enabled in the header region of block admin. Up to this point, ...
0
votes
1answer
110 views

How on node forms do I show weight of all menu items?

I'm wondering how it is possible (with a hook) to show the weight next to the menu title in the parent drop down found in the Menu Settings tab. So this is what it is at this moment: And this is ...
1
vote
2answers
114 views

Non-breaking space in menu link name

How to put non-breaking space into a menu link name in Drupal 8? I tried &nbsp; but it got displayed   literally.
0
votes
1answer
58 views

How to move nested links in menu edition?

In Drupal 8 I created nested menu links. After some days I tried to move them. Eg. one nested link to one parent menu link but the moving got disabled. I remember that there were small cross icons ...
0
votes
1answer
220 views

Show/hide menu link based on changing custom $tempStore value

I'd like to show/hide a main-menu link based on a $tempStore variable the user can set and modify during their session, i.e. user sets $tempStore['vlaue'] = 0; --> menu link is hidden user sets $...
2
votes
0answers
54 views

How to add "#" as a menu link?

How can I simply add "#" as a menu link in Drupal 8? I want to have: <a href="#" ... output as a menu link. Do I have to define my own route token akin to <nolink> and write a custom ...
0
votes
1answer
969 views

How to export a menu and blocks?

I created a Superfish menu in a test installation of Drupal (8.5.4) and want to import it into another install (8.5.5). How can I do this? Is the navigation data stored in menu_link, ...
0
votes
1answer
393 views

Custom module to act on module configuration change

I'm working on a custom module to change the administrative menu structure. A few extra menu items are added; for some of them, I want to be able the change the name via a configuration page of the ...
0
votes
0answers
28 views

How to make edit node display all the nodes menu links

I have a site with a lot of content and some of it is linked in multiple menus (for example: one in the footer menu and another in a submenu of a page). By default, Drupal displays the first menu ...
0
votes
1answer
133 views

How can I uncollapse a footer menu?

I'm theming with Boostrap right now in Drupal 8 and created a footer menu with a bunch of links. The menu is displaying collapsed right now, but I want it to be uncollapsed and display like a default ...
0
votes
1answer
176 views

How do I display a link icon in custom modules?

I would like to display an icon of correct answer but in my condition full URL is displaying (it's not displaying icon ) how I'll manage. This icon will be on a table so the user can click that icon ...
2
votes
3answers
2k views

How to change title of "Log in" link in account menu for anonymous users?

How to change title of "Log in" link in account menu for anonymous users in Drupal 8? Thanks for any suggestions.
2
votes
1answer
211 views

Load menu items from one menu in other menu

I want to load the menu items from the main menu in a other menu. I've read a dozen examples but I can't get it to render the items at all. Here's my code from my_theme.theme function ...
0
votes
1answer
19 views

How to change order and depth of user account tabs

With Tab Tamer we can change the weight/order of tabs in the user account under user/% (e.g. put user/%/edit after user/%/some_settings), but we can't set depth between the tabs (e.g. user/%/...
0
votes
1answer
95 views

Show block menu links only on certain pages

I've built a menu with 20 links aprox. Then I put the block drupal creates for my menu on a region. Thing is I want some of the links to show for some pages, while others are hidden, like the option ...
-1
votes
1answer
119 views

Adding links to a menu without re-selecting the menu each time

I am adding links to a (SuperFish) menu in Drupal 8. Each time I add a link it returns me to the list of menus (admin/structure/menu). How can I add menu links without having to re-select the menu ...

1 2 3
4
5
32