Skip to main content

Questions tagged [navigation]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

menu tree behaves differently on two differents sections

i'm maintaining a drupal i didn't developed. I fixed some issues in the menu template (e.g. /themes/custom/{mytheme}/templates/menu--menu-{my-menu-name} ) this template is called at two places in the ...
3 votes
1 answer
3k views

Why does jQuery slideToggle revert back to initial hidden state after running?

I have a Superfish menu and a simple jquery slideToggle animation attached to each menu item. I am using Drupal 7 & the Superfish module. The idea is that on click it will show the body content ...
0 votes
1 answer
506 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 ...
1 vote
1 answer
653 views

Dynamic language links from menu?

I am trying to find a way to do the following: Add languages to Drupal 9 menu items Translate content/menu links Provide (from the Main Navigation) a list of languages the current page is translated ...
0 votes
1 answer
802 views

How can I programmatically reorder active menu items?

I have an 'audience' menu which has 4 links. When a user visits one of these links, it becomes active, and I want to push it to the front of the menu item list. Outcomes would like like; Pitchers | ...
1 vote
1 answer
1k 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, on this specific page. I need to be able to add full HTML ...
1 vote
1 answer
525 views

How edit or alter the links in the secondary toolbar?

I'm on D9.3.x with Gin theme and Gin Toolbar. I need to edit the link available in the secondary toolbar. Namely, I'd need to hide the shortcuts link for everyone and hide the edit profile sub-link ...
0 votes
1 answer
1k views

How to get menu title inside menu--main.html.twig file

I created a suggestion for menu and using menu--main-sidebar.html to render menu. I want to include menu title (title of block added to specific region from admin side) as first child of menu I ...
1 vote
1 answer
1k views

Transfer (export/import) url aliases and menu links automatically

I want to transfer/synchronize url aliases and menu links from one site to another. Is there any way (drupal module, drush command, script) to do it automatically? The module menu_import looked ...
1 vote
2 answers
2k views

add link in Colorbox caption

In my gallery, what i write as image title is the caption of my image and that is great. Now I would like to add a link (external url) to my caption, how can i do that? I already try to write normal ...
1 vote
0 answers
21 views

How to add menu to a region when viewing a node revision?

We have a layout with the menu in a left 'sidebar' region. The menu opens to the correct parent item when browsing a node as it should. When browsing the latest (or any) revision of the node, the menu ...
0 votes
2 answers
1k views

Problem with menu position module

I have a menu like this: In the first sidebar you see the main menu with links. The second sidebar is a block that is visible on pages that begin with stocklijst/. The link in the first sidebar ...
0 votes
1 answer
685 views

Adding class to nested UL in menu

I'm creating my menu using view along with Bootstrap to create a mega menu style navigation. I'm having a problem with the nav showing expanded at times when you come to the site and or refresh. not ...
1 vote
2 answers
397 views

login_destination module and link with anchor

I want to to use login_destination module to have a link to login screen in comment-wrapper.tpl.php, so after the login, the user came back to write the comment. I have installed and configured ...
3 votes
1 answer
2k views

Providing menu route parameter values from url

Suppose I have the following route in my ej.routing.yml file: ej.form.user.profile: path: '/user/{user}/ej_profile' defaults: _title: 'EJ Profile' _form: '\Drupal\ej\Form\User\ProfileForm' ...
2 votes
1 answer
393 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 ...
1 vote
1 answer
487 views

Change Classes in Nav-Tag of Custom Menu

On a Drupal 8 installation, I have a menu in the sidebar first region. I want to add classes to bootstrap classes to the different levels of that menu. For that I created a my own menu template, which ...
0 votes
1 answer
492 views

How can I increase the 128 character limit of a menu path?

I know there are patches to core, but they were never backported to Drupal 6 from what I can tell. Increasing path length to 255 chars Menu path length is limited by the UI to 128 characters How ...
1 vote
1 answer
434 views

How do I import/export menus?

I want to import/export all menus of site1 in into site2. Currently I am using the entitysync module to synchronize the content between two sites. I can see there is an option for "Custom Menu ...
0 votes
1 answer
430 views

Menu item extras field in page.html.twig

I need a background image per menu item. For this I'm using menu_item_extras. I added an image field to menu items. This field I'd like to use in page.html.twig. How can I use this field in this ...
0 votes
1 answer
402 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 ...
0 votes
1 answer
485 views

Outputing the field as link doesn't properly show the field properties

I want to output an image field as a link in a view. I've seen many tutorials but get stuck at one point. I already added the link on top of the image field. By clicking on the image at rewrite ...
0 votes
0 answers
19 views

How to add taxonomy and menu to content Mirgation using migrate, migrate_tools, migrate_plus and migrate_source_html?

I am new to Drupal and Would really appreciate the help I am importing html pages using migrate, migrate_tools, migrate_plus and migrate_source_html it is working but I would like to also populate the ...
8 votes
6 answers
14k views

How do I programmatically update or delete menu items?

I have seen How do I create menu links programmatically? but how do I update or delete menu items in Drupal 8? By programmatically, I mean dynamically; YAML configuration files are not going to help.
0 votes
2 answers
546 views

Filters as rewrite results link path parameters

I am currently using this approach to link lists view's rows to detail pages in Drupal 8 I would like to pass the entity title of the row to the receiving page and use that to select view blocks ...
0 votes
2 answers
510 views

Multiple aliases per node (and active trail)

Our site is split down the middle for tenants and landlords. But we have content the is the same for both such as "how to report antisocial behaviour". User would normally navigate something like "...
1 vote
1 answer
1k views

Content edit links?

I'm new to Drupal 8 and can't figure out a way to show the edit contextual links for content displayed through the Views module. This was simple in Drupal 7, but in Drupal 8, a view only shows the ...
0 votes
2 answers
2k views

How to add active class to title which is loaded via views in block

I have created content type XXX, via views I collected all titles of XXX content. That all titles works as links, I want to add active class to title which was clicked in block. It should works as ...
0 votes
1 answer
659 views

All added links open as target, how to prevent it?

In my Drupal based website, all links that I added from CKeditor open as (target="_blank" Link example: (<a href="node/add/name">Name</a>) After adding, example from html source: (<a ...
0 votes
1 answer
413 views

View button that links to current node

I'm trying to create this button in my views with a custom text, that needs to link to the current node. I know you can use links and that works, but.. i need something like a variable that makes the ...
0 votes
1 answer
440 views

No working link to network files

For an intranet solution I would like to add a bunch of rather static links in Drupal to network files which change from time to time and are maintained by people not using Drupal. To achieve this I ...
0 votes
1 answer
483 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 ...
0 votes
1 answer
7 views

Editing block to update/remove menu items

I am new to Drupal and I'm trying to fix items on a website, which have several blocks containing menu items. I don't want to delete the blocks, I just want to edit them to remove/update the menu ...
1 vote
1 answer
860 views

Restrict Menu Item Visibility by Permissions

I have a module-generated menu (using yaml file) with 5 menu items. My requirements don't allow me to restrict menu item visibility by role because roles can be dynamically added. So I have to do this ...
0 votes
1 answer
785 views

Fatal error while editing and deleting menu items

Facing one issue in deleting the menu items on my Drupal 8 Site. Steps to reproduce: Add a link to main menu. Create Child terms under one link. Delete the parent term. After deleting the parent link ...
0 votes
1 answer
510 views

Menu block makes parent menu item active when maximum levels not cover the linked node

In Drupal 7, a menu block can specify maximum levels. If the maximum levels is not enough to cover all menu items linked node, when in the not-covered menu items linked node, could menu be active at ...
0 votes
2 answers
1k 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
1 answer
555 views

How to set the link in a view slideshow?

Currently, I'm creating a xyz resort website. In my home page, I implemented a slideshow by using views. I want the slideshow to be clickable: When I click on to the resort image in slideshow it ...
1 vote
1 answer
1k views

Menu theme suggestion ignored when cache turned on

I have an alternative main menu that is used on specific node types. When turning on the cache the menu block is cached. The theme suggestion for the menu is then ignored. I tried to disable the menu ...
1 vote
1 answer
1k views

Render Custom Menu Block from Menu Tree Array of Links Programmatically

Here's what I have: A custom menu (side nav) that mimics the main/secondary menu tree which shows the entire subtree of the root menu item (Dine, Play, Stay) you're under. This sidenav can be ...
0 votes
1 answer
466 views

Displaying parts of main menu in separate blocks

I need to display my main menu in separate blocks: the first sub-menu in one block, and the following two sub-menus in another block. I'm using Drupal's native menu module and also the nice menus ...
2 votes
1 answer
695 views

Theme template.php functions after bootstrap

I'm trying to print a drupal menu outside drupal. In order to achieve this I ran the bootstrap as follows: drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); And I render my menu as follows: public static ...
0 votes
1 answer
1k views

How do I programmatically alter the links displayed in the main navigation menu?

The main navigation menu in the site I am currently working on has a lot of menus. I want to hide the disabled ones. I figured out that it is rendered via the menu_edit_form form. entity.menu....
3 votes
2 answers
746 views

Link tags in template file auto closing.

I’m having an issue wrapping a link around some output in a template file. I have the right template file; and I can put text like ‘start here’ and ‘end here’ and it prints out where I want the ‘a ...
1 vote
1 answer
677 views

Load disabled items in a menu

I load my main menu programmatically with the following code : $menuTree = \Drupal::menuTree(); $menuTreeParameters = $menuTree->getCurrentRouteMenuTreeParameters($name); $...
2 votes
1 answer
779 views

Accordion is not working in field group module

I have configured the Field group module for Drupal 8 to manage the display of my node into accordion. I added an accordion wrapper, and assigned an accordion item into it. Lastly, added the fields ...
0 votes
1 answer
608 views

Symbolic links and the file_scan_directory() warning

I wanted to use the following symbolic link in my root directory: $ ln -s /data1/public/cases/ DownloadData Such that when users go to www.example.com/~user/DownloadData/file they are rerouted to /...
1 vote
1 answer
1k views

Add menu links to custom generated menu

I am working on a custom Drupal 8 module which generates a menu. Refer Create a new Menu in Drupal 8 programmatically for details. I have the menu now, but when I try to add custom menu links to it, ...
10 votes
4 answers
17k views

Render menu in twig template

In admin/structure/menu I created a menu. Is it possible to render this menu (with machinename: my_menu) in a twig template? Somehow like: {{ my_menu }}
0 votes
1 answer
1k views

Add uid to existing menu link

I have a custom menu MyMenu and I have four menu items. What I want to do is to add the current uid as a parameter at the end of the link. In D7 I could use menu_tokens module which is not available ...

1
2 3 4 5
33