Questions tagged [navigation]

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

Filter by
Sorted by
Tagged with
-3
votes
0answers
13 views

How to create a slide up menu on mouse click [on hold]

Does anybody knows a method or a Drupal module helps in achieving the Slide Up Menu shown in the above image for a online website: 1) The below image show that there is no visible menu to perform an ...
-3
votes
1answer
40 views

Login link in menu showing to logged-in user [on hold]

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 ...
-2
votes
0answers
29 views

How do I create a menu item from view results [closed]

My organization has several Departments. Some of these Departments have websites. Some do not. I have a Department Content Type. These Departments have an optional website field. I have a view that ...
0
votes
0answers
32 views

My user 1 doesn't have access to 'node/add'?

I'm logged into my site as user 1, but I'm getting a 404 error when I try to go to node/add. Actually, all my administrator users fail in the same way. However, node/add/a-content-type works fine, ...
0
votes
0answers
12 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 ...
-4
votes
0answers
38 views

Best solution for a multi column mega menu in combination with bootstrap 4 [closed]

I am using Bootstrap 4 (not the Bootstrap theme but a custom setup) for my custom Drupal 8 theme. I have a Main menu with taxonomy categories and links. I need to divide those categories and it's (...
1
vote
1answer
22 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
16 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
34 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
12 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
28 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
55 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
16 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
19 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
10 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
34 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
24 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... ...
2
votes
2answers
121 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
41 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
29 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
36 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
8 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
137 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
votes
0answers
27 views

How can I restore this functionality?

I recently just updated to 8.7 and for the most part everything is working well. In my dev environment I was working on a new feature using layout builder with menu_item_extras to apply a layout to ...
1
vote
0answers
30 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
26 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 ...
0
votes
1answer
204 views

How to add a nolink menu item

I'm creating a menu item for my main navigation bar. It looks like this: module/module.links.menu.yml: top.link: title: 'Operations' description: 'Operations' parent: main menu_name: main ...
0
votes
0answers
15 views

Change maximum depth of a menu tree

I discovered today that Drupal 8 only allows you to add menu items in a maximum of 9 levels. I understand this is more than enough for most users, but I'm using the menu system to organize pages for ...
0
votes
1answer
36 views

Submenu tree problem

I have a website build with Drupal 7 CMS and I am using the Submenu tree module. Everything was working fine for months, but few weeks ago I have received a feedback from the client that all the links ...
2
votes
1answer
20 views

How do I add an extra “Add content”-link to the admin toolbar dropdown

I am trying to add some improvement to the workflow of the webmasters. Right now they have to click "Content", and then click once more on the "Add content" button. Since I am working with the "Admin ...
0
votes
0answers
11 views

Menu link title used as page title on first access

Simple problem: I defined some main menu links under /admin/structure/menu. Whenever i access the linked page, the page title shows the menu link title and not the title set in .module. Every access ...
0
votes
1answer
12 views

main menu disappears only on home page

I have a site online engcorrect.net and for some reason my menu on my homepage disappears. On all other pages, it shows. The weird thing is that on my localhost (local machine) it shows correctly but ...
1
vote
1answer
61 views

How to tell if a menu link is route:<nolink> or not?

Trying to theme a menu in Drupal 8, running into a case where we need to add classes on certain links. In the case of a menu link that is route:<nolink> we need to not add any class at all. ...
-1
votes
2answers
62 views

Switch between View Modes from the URL

Under the manage display for the user profile /admin/config/people/accounts/display, I have 4 view modes as below: Default Profile (Machine name: user.profile) Company (Machine name: user.company) ...
1
vote
2answers
27 views

Is there a way to pass multiple arguments to menu_name while creating menu links programmatically?

Am using Drupal 7. Below is my code where am trying to create menu links programmatically: $links[] = array( 'menu_name' => 'management', 'link_path' => 'myheader/config', 'link_title' => '...
1
vote
0answers
40 views

Caching of sub site menus

Preamble We currently have a Drupal 8 site that has subsites (accessed via subdomains). On the main site (non-subdomain) we have a main navigation menu defined (this is presenting correctly on the ...
0
votes
0answers
54 views

Is there something I'm missing in getting this to work correctly?

I followed this tutorial but am having some issues. I enabled menu_link_extras and layout_builder on my site. I enabled layout builder on my menu, added a menu link and added a block to that link's ...
0
votes
1answer
51 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
15 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
21 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
18 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
27 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
14 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
99 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
29 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 ...