People who code: we want your input. Take the Survey

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

Create a View Block that shows a taxonomy vocabulary applied to the current node

I have a news section of a Drupal 8 website that contains an ever-growing list of nodes. To avoid a messy menu in the long term, they do not have a menu position assigned but instead are shown via ...
0
votes
0answers
27 views

Using TB Megamenu, how to close one submenu when I open another submenu?

I'm building a couple of (Drupal 8.9.13 and Drupal 9 based) sites where I use TB Megamenu megamenu module (https://www.drupal.org/project/tb_megamenu) to create the menu. All is working fine on ...
3
votes
1answer
367 views

How to pull pictures and summary information from external web pages when posting links?

When posting a link (external web page) to my Drupal blog, is there a way to have Drupal automatically pull the picture and summary information from that link and include it in the post on my Drupal ...
0
votes
2answers
439 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
1answer
582 views

How to get Tb Mega Menu working in Chrome?

I have a website and integrated Tb Mega Menu for the navigation. But the problem is my dropdown is not working in Google Chrome, though it is perfectly working in Internet Explore, Mozilla. My version ...
1
vote
1answer
546 views

Group by taxonomy headers

Not sure why I can't do this as it sounds simple, I have: A content type called 'RSS FEEDS' A vocabulary called 'Publications' within this I have 3 terms which are 1) NY Times 2) BBC 3) National ...
1
vote
2answers
371 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 ...
0
votes
1answer
606 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 ...
0
votes
0answers
15 views

Add Image to parent item smartmenus

I have created a dropdown menu using smartmenus module, now I've got a design request asking me to add an image to each parent item. Here's the idea: My first approach was to try with Menu Items ...
1
vote
1answer
404 views

How to add subtitle for menu items in Nice menu in Drupal 7

I'm using nice menu in my durpal-7 site.I need to show a subtitle for each menu item.How can this be done ? I'm new to drupal so it would be great if you could help me.
0
votes
1answer
537 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
1answer
380 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 ...
2
votes
1answer
44 views

How to properly check the menu for emptiness in twig?

I use Simplify Menu to display the necessary menu markup. How do I make sure that the menu is not empty (there are items there) and if there are menu items, they are enabled? {% set items = ...
0
votes
1answer
342 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
1answer
502 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 ...
0
votes
1answer
455 views

Accordion display for views inside panel

I have a panel page which contains 2 views. I only want 1 view to display as an accordion. My problems are - If I set the style setting of the view to accordion - nothing happens. If I set the style ...
0
votes
1answer
10 views

Sub Menu items not showing

I am trying to create a navigation with a sub-menu in Drupal 9. I added the top level nav item with and used # as the value for the link, and checked "Show as expanded" Then I created a new ...
6
votes
4answers
9k views

How do I programmatically update or delete menu items?

I have seen the post on how to create menu items programmatically in Drupal 8, but how do I update or delete menu items in D8? Clarification: by programmatically I mean dynamically so yaml config ...
0
votes
1answer
469 views

Views : Output the field as link - not showing the field properties properly

I want to output an image field as a link in views. 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 ...
2
votes
1answer
1k views

Add classes to the menu item <li>?

In hook_preprocess_menu(), I want to add custom classes to the <li> tag. I tried the following lines of code, one at a time. $item['attributes']->addClass('section'); $item['attributes']->...
0
votes
0answers
19 views

Inject a custom menu to the Administration menu

In Drupal 8 I would like to inject a menu at the first position of the Administration menu So that an editor can create a navigational structure for all users. So I would create a "Custom Admin ...
1
vote
1answer
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 ...
0
votes
0answers
33 views

How would I create and render, but not save, an entire menu tree programmatically?

I'm trying to pull a number of links from several services, and combine them into a renderable menu tree: Source one: pull links A, B and C Source two: pull links D and E Source three: pull links F, G,...
0
votes
1answer
452 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
0answers
22 views

At creation time, why are shortcut titles translated, but menu link titles are not?

The idiom that the community points to for creating menu links usually looks like this (from \Drupal\Tests\language\Functional\LanguageSwitchingTest::testLanguageSessionSwitchLinks()): // Add a link ...
2
votes
1answer
684 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
1answer
574 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
0answers
18 views

systemAdminMenuBlockPage callback not respecting menu link permissions

I added a custom permission on "admin/commerce/config" to disable access for certain user roles. class RouteSubscriber extends RouteSubscriberBase { /** * {@inheritdoc} */ public ...
0
votes
2answers
612 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/...
2
votes
0answers
31 views

Menu link tree only loads enabled elements in subtree regardless of parameters

When loading a menu tree without any custom parameters: $tree = \Drupal::menuTree()->load('my-menu-name', new MenuTreeParameters()); The returned tree \Drupal\Core\Menu\MenuLinkTreeElement[] ...
0
votes
0answers
16 views

how to get the expanded menu tree of a menu link?

I have the following menu items - Menu item 1 -- Menu item 1 child - Menu item 2 - Menu item 3 -- Menu item 3 child - Menu item 4 I have the id of the Menu item 3 like menu_link_content:bda6f3cc-...
3
votes
2answers
1k views

How can I bulk delete Menu Itemes in Drupal 8

is it possible to bulk delete and bulk edit menu items in Drupal 8? Question for Drupal 7: Any way to bulk delete menu items?
0
votes
1answer
75 views

How to create a block of links shared by a user?

I am using oembed to convert url to embedded content. I have enabled the oembed input filter in a text format. Now I want to create a block using views to only show the posts which have these links. ...
1
vote
1answer
365 views

Load disabled items in a menu

I load my main menu programmatically with the following code : $menuTree = \Drupal::menuTree(); $menuTreeParameters = $menuTree->getCurrentRouteMenuTreeParameters($name); $...
1
vote
1answer
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, ...
0
votes
1answer
23 views

Put menus into separate file for better handling caching with expires

I am trying to clear the page cache of drupal as micro invasive as possible by using Cache Expires and custom logic. On each page, the menu is shown down to Level 2 in a footer and a hover area. ...
3
votes
1answer
800 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' ...
1
vote
1answer
883 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 ...
31
votes
10answers
73k views

How do I create a link?

Say I am extending The blockBase class to create a custom block, and I am implementing the blockBuild method to create some markup for my block. Something like this: class YourModuleBlock extends ...
0
votes
0answers
26 views

How to make simple dynamic menu item?

I would like to move edit, delete, revisions etc. functionality of the current node from tabs above the node to the Tools menu. Is it possible to create menu link in form [current node]/edit, [current ...
4
votes
2answers
2k views

How can I have links to anchors in menus?

How can I add a menu link as /test#anchor and link to #anchor section on the test page? I need to add a menu item that links to specific section on the target page. Drupal 7 had menu tokens to ...
0
votes
0answers
17 views

How to create a primary tab that links to the first accessible seconday tab?

In D8, for primary tabs that are local tasks an explicit route is defined. If the route is not accessible to the current user, the primary tab is hidden. Typically the same route is used again in a ...
1
vote
2answers
50 views

How do I programmatically fix local menus to be shown only for a content type?

I am using the following lines in a links.task.yml file. x.nodename_updates: route_name: view.great_view_name1.page_1 base_route: entity.node.canonical title: 'Updates' weight: 50 x....
0
votes
1answer
363 views

How can change RealName / User account link destination in D7

I'm using RealName module in D7 to show real names on nodes and in comments and would like to link the real name [user:first-name] [user:last-name] to a custom content type (a 'profile' page), instead ...
7
votes
3answers
12k views

add a link to admin menu bar

I want to add the link to tags i.e. /admin/structure/taxonomy/tags directly to admin menu so that it appears next to "Content" link present on admin menu. How to do it?
0
votes
0answers
18 views

How to display the child menu items in a select list?

I want to display the menu items in a select list. $items = \Drupal::service('menu.parent_form_selector')->getParentSelectOptions('main:', ['main' => 'Main']); It gives the following select ...
4
votes
4answers
3k views

Migrating link fields to Drupal 8

I am trying to migrate a link field field_url from a Drupal 7 site to my Drupal 8 one. The link field is compound, it has a title and a url value. In my process plugin I am selecting the right values (...
0
votes
1answer
68 views

Replace UID in view tab with name on user profile page

I'm working on a Drupal 8 site. I made a custom page view displaying special content created by the user. The menu tab shows on the user profile correctly by using Pathauto to show the correct address ...
11
votes
7answers
14k views

How to add fields to menu items

I need to build a main menu that is a subset of the regular menu. The design team thinks it would be better for user to have only the most important links in the main menu and not have everything. ...
0
votes
0answers
11 views

Menu Link to views with % in URL

i have the following construct that i have the following URL: /node/nodeid/fooobar Foobar is a view that uses CONTEXTUAL FILTERS to draw the node id and then render the view. This works really well so ...

1
2
3 4 5
32