Questions tagged [navigation]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
23 views

How to define frontend theme (non-admin) for a given node tab route?

In my custom module I want to define a new tab associated with nodes. I have my own custom route file with the required definitions and a Links file to make sure the new route will be displayed as a ...
0
votes
0answers
19 views

How can I create a menu item AND tabs in a view?

Building on How to create views tabs in D8? where the asker gets information on how to turn the different pages in their view into tabs, I would like to also add a menu item for my default tab in the ...
0
votes
1answer
28 views

Last modified date in menu link

I have a book with some child pages and I'd like to show the last modified date of each corresponding node near them in their menu tree links, or a red badge near the nodes updated during eg. the last ...
0
votes
1answer
16 views

if current_node is in menu, do something in theme.inc

I'm trying to check if the current node (of a specific content type) has been added to a menu (using the "Provide a menu link" in the node edit GUI). if it has, I need to set a variable in .theme....
0
votes
3answers
54 views

How do you deploy a change to a main menu?

We have a small D7 site. We want to deactivate a main menu item. On dev server I was able to deactivate it in /admin/structure/menu/manage/main-menu I believe The menu is stored in the DB, right. ...
4
votes
1answer
80 views

How to get a section of the menu tree based on the current node?

I am currently struggling to wrap my head around how the menu tree and menu link services work for outputting part of a menu with some custom requirements. Admittedly I don't have to do this very ...
0
votes
1answer
42 views

how to a link in Admin black toolbar

I created a custom module and how to add a link along with icon. Basically, I want to add notification icon backlinks_notifications.index: title: 'Notifications' parent: system.admin_config_ui (...
0
votes
0answers
12 views

In the “Add menu link” form, filter “Parent link” field to show only the menu I'm adding the link to

In the Add Menu Link form, the "Parent link" field has <Administration> and its children as options. This makes sense, as I clicked "Add link" from the "Operations" for the Administration menu. ...
0
votes
1answer
10 views

I have a site that is translated in English and French - can't change “Home” link in menu

My entire Drupal 8 site has been translated except I can't find where to change the translation of the "Home" link. When the site is in French mode (with the /fr) all my menu items show the ...
0
votes
0answers
19 views

Add Class to Parent of route:<nolink> Menu Item

I am trying to work out how to add a class to the parent item of a route:<nolink> menu item. Use case: Having over a hundred Appendix pages that all reside under an Appendixes link (A view page ...
0
votes
0answers
38 views

Region with menu block disappears suddenly, re-appears after re-saving menu

We have a website with a menu in a block, that is placed into a region "Sidebar". My customer notified me that the whole region containing the menu keeps disappearing on the live site, on average once ...
0
votes
1answer
46 views

Building a non-config, programmatically-created, semi-dynamic, semi-manual menu

We have a custom entity called "Topic". With this entity, users can build topics and reference other content to "belong" to the topic. We also have a requirement where, whenever a user creates a topic,...
0
votes
1answer
30 views

Menu options missing in node form

In Drupal 8, despite the fact that there is a menu set for the content type, menu options are not showing in the node form. I have disabled some menu modules in case they were interfering, but with ...
0
votes
1answer
8 views

Added menu link not showed in menu configuration

I have a very weird problem. If I add a new menu item, I can do it without any error in the menu configuration page, but the item isn't showed in the menu in this page neither in the menu. If I check ...
0
votes
1answer
20 views

Adding an extra class to the last element of the navigation/tree menu

For one of my projects, I have to create a tree menu, with parents and children, that would be used to navigate through the website. The parents are collapsible. Below is the twig file that I am using ...
0
votes
1answer
19 views

hamburger menu moved after update

We use we-mega-menu. After performing an update the mobile (hamburger) menu changed its alignment to the left as well as some other things I was able to fix the other things but I can't seem to figure ...
1
vote
2answers
100 views

How can I add a link on the “Structure” admin page?

I created a view page with the path being /abc and I want to add this link on Administrative page with a link in Drupal 8.
0
votes
0answers
25 views

How can I only show the current book on book navigation?

I have a list of books and I would only like to see the current book on the book navigation. How can I achieve that?
-1
votes
1answer
16 views

Can I add a menu link with a parameter? [duplicate]

I would like to add a menu link using the "Link"-Field with Autocomplete, but I would like to add a parameter afterwards. Pretty much like this: ...which is not working. Is that possible? Thanks!
0
votes
1answer
27 views

hook_menu() item never reached?

I have a module where hook_menu() was already used to process ajax calls, like this: function bizaudit_menu() { return [ 'bizaudit/ajax' => [ 'page callback' => '...
0
votes
0answers
12 views

Create Taxanomy Menu with specified starting term

D8 Taxonomy Menu module is perfect to create a dynamic menu for a given vocabulary. I would like to create a menu starting with a term or subterm. For example, Vocabulary VocabA 1 Term1 1.1 ...
1
vote
1answer
27 views

Looking for a Menu Module on Node Page [closed]

Out site has many, many nodes included in a number of menus. When creating a node, the Parent Item select box under Menu Settings is quite long. Is there a module that provides a better, more usable ...
0
votes
1answer
30 views

How do I get the menu block choice “Expand all menu items” to stay checked

I have 2x menu blocks. One in the header and one in the footer. I'd like the header one to stay unexpanded, but expand all the items in the footer. When I check "Expand all menu items" in the footer,...
0
votes
0answers
38 views

Divide menu tree parents and children links into columns

I have the following menu tree for my main navigation: Parent 1 (= level 0) SubParent 1 (= level 1) SubChild 1.1 (= level 1) SubChild 1.2 (= level 1) SubChild 1.3 (= level 1) SubSubParent 1 (= ...
-3
votes
1answer
42 views

Login link in menu showing to logged-in user [closed]

On a Drupal 7 site, I created a login link on the main menu with the path user/login. For some reason, the link remains visible to users that are already logged in. I thought this link is supposed to ...
1
vote
0answers
14 views

Can't add sub tab local tasks to admin/content/my_entity

I have a custom content entity list which has its own tab into admin/content/my_entity. The content of this tab is generated by using EntityListBuilder class. Actually, I created it with the drupal ...
1
vote
1answer
25 views

Using the menu API, how do I get only the enabled links?

Using the code below I am able to get all the titles and links from the main menu, however, I only need the enabled ones. I have been searching for an answer for a couple of days but have been unable ...
0
votes
0answers
25 views

.removeClass() for Detached sub menu in menu-main.html.twig

I have a need to have the sub menu not be a nested item in the main level menu li's. I'm not sure my approach is the best, but it is working with a couple caveats: The div <div class="r-sub-menu-...
0
votes
0answers
40 views

How to get identifier for menu link item in form hook?

How to get something unique (like 'menu link id' mlid in Drupal 7) in the form for editing one menu link item? hook_form_alter(&$form, FormStateInterface &$form_state, $form_id) { $mlid=... ...
0
votes
0answers
13 views

How to get array of activeTrail menu id's based on given url

I have a custom module that returns a json output so we can dynamically build the main menu. The issue I've come across is setting the active trail for the current page and the trail up. I am trying ...
0
votes
0answers
13 views

Hook to call a function after menu rebuild?

After a menu rebuild, such as one that occurs automatically when visiting the Modules admin page, some of my Drupal JS behaviors are not in the correct state. I need to re-initialize or attach them ...
0
votes
0answers
16 views

I Cant enable the Responsive-Navigation module after installing it

I want to make the Nav menu responsive for my website and I just downloaded the files for Responsive-Navigation and responsive-nav.js plugin and copied them in modules and libraries folders ...
-4
votes
1answer
26 views

How to have all options of some menu on the same line?

In the mayo theme I use for my site, I have a footer menu. By default, the options of this menu are displayed vertically: I'd like to have the options displayed horizontally. How can I do that?
-2
votes
1answer
30 views

Getting translated version of Menu

I'm trying to get translated variant of Manu, but I can't make it work. This is code of what I'm trying to do, but this is for content node. $entitytype_manager = \Drupal::service('entity_type....
0
votes
0answers
16 views

How to show menu items depending on the user's roles and the node type?

I would like to show some menu items (merged with the main navigation menu) when viewing a node (full content) of a custom content type. Also, this menu items depend on user's roles. It could be ...
0
votes
3answers
61 views

Menu tree from taxonomy terms and nodes which belong to them

i need to create a collapsible menu tree from taxonomy terms and nodes which belong to them (not nested terms, but content pages) i'm totally stuck about it i've found solutions for nested taxonomy ...
0
votes
0answers
9 views

How can I replace Main Menu with other set of Menus as per Roles?

I am using Drupal 7.67. I would like to replace the entire set of MAIN MENU with a different set of menu that I have created for a number of specific users. I want this new menu to show when those ...
0
votes
0answers
23 views

Setting default value to custom fields in menu items

I created a custom boolean field in my menu item using this hook_entity_base_field_info function Mymodule_entity_base_field_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) { if ($...
0
votes
0answers
23 views

How to add an additional link into node links array programatically?

I would like to add a additional link into the links list of my node-type teaser-display (where "write a comment", "read more" link are located). Also I would like to pass some tokens (token module ...
0
votes
1answer
11 views

Creating 'index' content views for L1-LX within a taxonomy

Note: This is a follow-on question from Creating a displayable 'index' of content nodes within a path Ok, starting to find my feet again within Drupal, and still getting up to speed with views. What ...
0
votes
2answers
45 views

How to get and display menu items except the parent item?

Let's say my menu tree is like below: Parent Sub-Parent Child I want to get the Sub-Parent title and all child's title and url. How can I do it in Drupal 8? I have looked at this answer but it ...
0
votes
0answers
37 views

8 - Cannot get clean URL's to work in macos mojave

Trying to install Drupal 8 on my macos mojave but cannot get clean URL's to work. But failing. Here are my configs at /etc/apache2/httpd.conf: Rewrite mod and vhosts include is uncommented... ...
3
votes
2answers
162 views

How can I have the language-specific 'enabled' Boolean of menu items being respected?

I'm trying to translate the 'enabled' field of menu items in Drupal 8. So far I have written this code in MYMODULE.module file: function MYMODULE_entity_base_field_info_alter(&$fields, \Drupal\...
0
votes
1answer
79 views

How do I turn off mobile menu collapse for bootstrap 3 theme in drupal 8?

I am looking to use a different mobile menu solution and replace the default bootstrap 3 mobile menu. How can I turn off the bootstrap collapsed mobile menu function?
1
vote
1answer
85 views

Is the homepage considered in_active_trail?

I'm learning Drupal 8, so still very new to it. I'm working on customizing the main menu. I've been able to add Twitter Bootstrap to my custom theme. I've made a custom menu--main.html.twig file. I'...
0
votes
0answers
41 views

Display another page's content without changing url for drupal 8

I want to display another page's content without changing url for drupal 8 . In drupal 7 I used menu_execute_active_handler() , but drupal 8 this function is not available. I got a solution from ...
0
votes
1answer
10 views

What is needed to keep parent menu element active while browsing subpages (Bartik Theme)

Let's say we have 2 sections with pages like this structure: /section1 * /section1/page1-1 ** /section1/page1-1/page1-1-1 ** /section1/page1-1/page1-1-2 ** /section1/page1-2 ** /section1/page1-3 ** /...
0
votes
1answer
198 views

Error when upgrading to Drupal 8.7.1 on module menu_link_content

When running database updates (on domain.com/update.php) from 8.6.15 to 8.7.1, I got the following error: module menu_link_content Update make_menu_link_content_revisionable Custom menu links have ...
1
vote
0answers
32 views

Menu item URL not updating using MenuLinkManagerInterface::updateDefinition()

When trying to update an existing menu link URL/ URI with updateDefinition() - https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Menu%21MenuLinkManagerInterface.php/function/...
0
votes
0answers
30 views

How to limit the number of top level menu items

I have a horizontal top level menu and only room for 7-8 links without breaking the layout. Is there a way limit the number of top level menu items? I found an old answer to the same question on ...