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
190 views

Unable to Edit Main Navigation Drupal 8

I installed a custom theme called StartupGrowth. At the moment, I am trying to edit the main navigation. When I go to Structure->Menus->Main Navigation and disable the unneeded entries, they do not ...
5
votes
4answers
2k views

Font Awesome icons in link field

I would like to have a font awesome icon in my link text. <i class="fa fa-pencil"></i>Blogs Since link fields are generated in LinkGenerator.php, they get escaped. if (!SafeMarkup::...
0
votes
1answer
106 views

How to get links of translated node edit page in the secondary tabs

In D7, if a node is translated, let say in French and if you are in the entity.node.edit_form page then you could find 2 secondary tabs: [French] and [English] pointing to the edit_form of each ...
2
votes
2answers
269 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
2answers
726 views

How do I retrieve a menu using its link?

Let say I have a menu item with these attributes 'title' => 'Menu Title', 'link' => ['uri' => 'internal:/taxonomy/term/1217'], 'menu_name' => 'my-menu', 'expanded' => TRUE, I can find ...
0
votes
1answer
79 views

How can I programmatically delete a custom menu?

I'm writing a hook_deploy_N that moves a bunch of menu items from a deprecated custom menu to some newer ones. So far, so good. After moving the items, I want to delete the old menu, but can't figure ...
3
votes
3answers
4k views

Alter the access of menu links before rendering

I need to alter the access of menu links before being rendered. In Drupal 7, we used hook_translated_menu_link_alter() for it. Drupal 8 change records show that there are no direct replacement for ...
9
votes
2answers
6k views

What is the equivalent of hook_translated_menu_link_alter() to alter a menu link? [duplicate]

I want to alter the menu link in Drupal 8. In Drupal 7 we can achieve this using hook_translated_menu_link_alter(). function module_translated_menu_link_alter(&$item, $map) { global $user; ...
1
vote
1answer
339 views

How to translate menu items with migrate?

I'm importing menu items from CSV using migrate, migrate_tools, migrate_plus and migrate_source_csv. This is an example of how I'm doing it for the original language: source: plugin: csv path: '...
0
votes
0answers
21 views

Menu links won't appear

I generated 2 entities and addtyed a new Form with the overview of them. But when I try to add links, they won't appear. I follow the guide but wont work. Form and Entities work. The routings are ...
0
votes
0answers
38 views

getUrlObject() returning empty proto object

I'm trying to follow this post to turn my menu tree into an array I can more easily work with. When I run my code and look at $filteredArray I get: title: *Name here* url_obj: {} has_children: true ...
2
votes
1answer
333 views

Links in view - wrong language selection

Ok, I'm not sure where should I go with this problem, so forgive me if this is not the exactly best place for it. I've created multilanguage site, of course, got many problems, but solved them all - ...
0
votes
1answer
30 views

Drupal 8 Accessing Menu Tree in a Block's JS

How can I pass the menu into a block's javascript? I am trying to build a block for a custom mobile menu (client wants specific logic/animations/etc) and use that in Structure > Block layout > Main ...
4
votes
2answers
3k views

Set parent for programmatically created menu links

I'm currently programmatically generating a menu and menu links inside it. This is working but I'm having trouble setting the parents for the links. Here is my current code $langcode = 'es'; ...
4
votes
4answers
2k views

Customize the HTML of a link field from a custom theme

I've a Link field named field_home_link, attached to a Content Type named Home, and I'm trying to customize how it is rendered as HTML from inside a custom theme. Instead of the default generated ...
2
votes
1answer
174 views

How to add local task links to referenced entities for a specific content type?

I have a content type with some entity reference fields to another content types. I want to add local task tabs to the node view page, to link those referenced node. However I cannot figure it out how ...
0
votes
2answers
95 views

Breadcrumbs/menu for dynamic pages

Im breaking my head around getting the breadcrumbs set properly on views page. my views' page address is "teachers/%" where % is a term-id. I have a content type called 'program' with a field ...
0
votes
1answer
69 views

Render an HTML element before the menu with hook preprocess menu

I want to render an HTML element like <span>This is my menu</span> before my menu. I thought the most easy solution is to alter the menu. I already altered my menu to add a class. But how ...
1
vote
1answer
458 views

How to enable special characters in Drupal Menu? [closed]

I am using Drupal5 and Nice Menu Module. I need to provide a URL in my Menu dropdown. There are special characters in it. When I add the complete path it works but on giving the relative path special ...
0
votes
1answer
32 views

drupal 8 modifying the menu items path

I work on an drupal 8 application that use the group module with the restriction of only one group per user. i want to be able to modify the menu items so that the id of the user's group is always in ...
-2
votes
1answer
61 views

Change Superfish menu on specific pages

Is there any way I can change the menu in Superfish module in specific pages? What I know so far is that Superfish uses the "Main Navigation" in the admin structures by default. Can I create a ...
0
votes
1answer
79 views

Display selected menu parent with children in sidebar

I have a menu build with taxonomy menu structured like this : Agenda agenda1 agenda2 News News1 News2 Access Access1 Access2 My main navigation is like this (no children): Agenda | News | ...
0
votes
1answer
598 views

Bootstrap sub-theme navbar buttons

It looks like when you use the default Bootstrap subtheme, it renders a navbar with the Main Menu links at the top of the page, as <li><a>...</a></li> elements inside of a ...
1
vote
0answers
27 views

How to add a span before my menu title link [duplicate]

This is the default Drupal menu: <ul> <li class="menu-item parent"><a href="" title="">0.0 Bla</a></li> <li class="menu-item parent"><a href="" title="">...
0
votes
1answer
37 views

Multiple versions of the same menu, based on associated term?

I am trying to create a site with different portals. Each portal displays content filtered to that person's user tag, i.e. Student, Staff, etc. It's easy to create a view that displays nodes with that ...
1
vote
2answers
77 views

How to add /admin/people as a tab to a custom menu?

In a custom module (association), I ceated views that are accessible thru tabs: The paths are defined in the views; Adhérents et personnes -> /association (this one is also defined as a menu item) ...
0
votes
1answer
53 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
0answers
180 views

Fix problem in off-canvas menu module for Barrio Sub-theme [duplicate]

I need help with changing a Barrio(v 8.x-4.22) sub-theme of Drupal 8 This is what I've done until now: I installed the Barrio sub-theme I installed the Responsive and off-canvas menu Drupal 8 ...
0
votes
1answer
24 views

How to add a custom module to a menu?

I am using Drupal 7. I have just built a wonderful custom module. Now I need to add it to my main menu, under the parent item "Tools and Resources." I know I can go to the homepage and click on the ...
1
vote
4answers
8k views

Multilevel submenu with bootstrap 3

I am trying to make a multilevel menu using a Bootstrap theme on Drupal 8. I have created the menu and activated the "Show children" flag for all submenu containers but only first level submenus are ...
0
votes
0answers
37 views

Update module menu link location

I have a custom module on a Drupal 8 site which has a controller defined with a menu item placed in the main menu. I would now like to move the menu item from the main menu to a different menu. I ...
-2
votes
1answer
1k views

How to get the main menu and sub menu of a main menu

I've three main menus, like "About", "Organisation", and "For us" For the main menu About, it has three sub menus, they are "About You", "About Us", and "About the people around you". I've created a ...
1
vote
0answers
71 views

How do you update node menu links?

I am creating Drupal 8 node using code and same time I am assigning a menu link as well its working fine. I am creating a menu using this code. MenuLinkContent::create([ 'title' => $item['...
0
votes
0answers
43 views

How do you cache a menu when loading it programmatically?

I am having the below code to load the main menu tree. $tree = menu_tree_all_data('main-menu'); $parentMenu = array(); $index = 0; foreach($tree as $key => $value) { if (!empty($value['...
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.
1
vote
2answers
1k views

Drush cache-rebuild breaking menus [closed]

We have had an issue with an expanding menu on a drupal 8 website that stops working when the command drush cache-rebuild is used. MORE INFO ON ERROR: When triggered, the error causes menus set ...
0
votes
1answer
112 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
1answer
41 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 ...
12
votes
6answers
4k views

How to display more than 10 items in link widget autocomplete?

This is a question about the Link module. Since with the Link module you can enter external or internal links both, we strongly rely on it. Unfortunately the number of items to be displayed from its ...
2
votes
2answers
862 views

Alter contextual links

I'm trying to alter custom blocks contextual menu. In particular I need to remove "Configure block" and "Delete". Is there any way to achieve this?
2
votes
3answers
6k views

anchor (#) in url alias

I want to open same page from different contents. So I need to generate link like /testimonials#group-1 for these contents. I used pathauto module for this. I made pattern for this category ...
0
votes
3answers
249 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
923 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
131 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 (...
1
vote
4answers
733 views

How to show sub-menu in a block? [closed]

I have a menu in Drupal 7 with 2 main links like home and about us, but I have 3 sub menu in about us like About us About Us 1 About Us 2 I need to show these 2 submenu in a block and show ...
0
votes
1answer
52 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 ...
1
vote
1answer
359 views

Destroy Superfish plugin

I have the Superfish module on my site that my main navigation uses. The site I am building is responsive so I'd like to destroy Superfish when the viewport is smaller than a specific size. I see ...
0
votes
1answer
16 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
2answers
618 views

Contextual links for a custom module

I want to add in a contextual link to a block. The block shows up in different pages, not just a specific page. Here is my current setup $block['content'] =array( '#markup' => _get_markup(),...
0
votes
1answer
50 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,...

1 2 3
4
5
32