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

How hide from menu content type Basic Page and Landing page

In Drupal 8, I tried to remove default Basic page and Landing page content types, but it have content related to them. So, my quick fix will to only hide those one from some user. I tried with ...
1
vote
1answer
109 views

Custom submit handler on form loaded via entity.form_builder

Using Drupal 8.5.3. Currently working within a custom controller to load and alter a form for menu links. To load the form I am using the following: // Load the menu link field. $menu_link_content =...
2
votes
1answer
367 views

How to make menu items of restricted pages visible to all user roles?

On a website I'm working on, logged in users can post their feedback about some functionalities which the website provides. While only logged in users should have access to fill the form, invisibility ...
0
votes
1answer
351 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 ...
-2
votes
1answer
363 views

How to alter a main menu link path programatically drupal 7?

In my case, My site URL is www.example.co.uk and also have a content page www.example.co.uk/bbc. There is a menu link called BBC with https://www.bbc.co.uk under my menu menu menu link list. I can ...
0
votes
2answers
85 views

Context condition per menu (not menu item)

I'm using Context module on Drupal 7 to show menu block on pages that's listed in that menu only. Everything's good, I set 'Menu' condition and reaction is to show the block in some region, but the ...
5
votes
2answers
2k views

How can I load a menu programmatically with an active trail set by a provided URL?

Working on a headless Drupal site, and have come across an issue. We have a REST resource that returns arbitrary menus by menu-id, however they always have "active-trail" set to false on every menu ...
0
votes
1answer
54 views

Is Drupal doing something to JQuery delegate or click() that causes the binding to fail?

I am trying to implement a simple mobile menu, but using Nice Menus as my base. So to get things the way the snippet's CSS is set up, I'm using JQuery to dynamically add a <button> element that ...
0
votes
1answer
292 views

Clearing contextual links'cache

I'm listing nodes in a block view which is located in a panel managed by page_manager. I need for these nodes somes custom opérations in contextual links, so i implmented hook_contextual_links_alter(...
-1
votes
1answer
822 views

Alter Links/Menu to show a modal dialog

I have two type of roles 'base' and 'full'. For the base role I would like to alter some menu links to open a modal dialog instead of the original destination url. I would like to replace the link. I ...
0
votes
0answers
29 views

Dynamically update main navigation URLs with prefix [duplicate]

This is some code from my theme_menu_link in Drupal 7. function mytheme_menu_link($variables) { $element = $variables['element']; if(arg(0) === 'x') { if($element['#href'] === '<front>')...
0
votes
1answer
54 views

Sticky Navigation 8.x-1.1. Funny padding-top

In in Drupal 8.5 Theme Bartik and using the Sticky Navigation 8.x-1.1. When by any chance I reload a page of my site and at that moment I’m positioned in the middle of that page and the menu is “...
0
votes
3answers
51 views

sitemap for users not search engines

I used simple XML sitemap module to create a sitemap for search engines but now I need one sitemap for visitors. Can I create this manually instead of using a module because the site already has too ...
0
votes
1answer
32 views

Drupal Search - Not searching for menu items

The default search module inside Drupal works perfect my project but the client wants to search for menu items too. The search module won't find menu items and I can't find a normal description or ...
1
vote
1answer
821 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
1answer
328 views

Menu translation tab how-to?

I have a menu in the original language English. Spanish is active in admin/config/regional/language . Custom menu link is active in admin/config/regional/content-language . I now have a Translation ...
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'; ...
-1
votes
1answer
202 views

how to link a created icon in a body field to another field?

With the fontawesome module I can easly create in CKEditor fontawesome icons in a body field. I want to link this icon to a telephone field (field_call_me) A more specific example: If I created a ...
1
vote
1answer
220 views

Visibilities permissions of children links in the Toolbar

In a project started with the Thunder distribution, I'm currently managing the permission of the "editor" group. By default, it only have access to the content menu, and it's a good thing. But what ...
0
votes
2answers
1k views

Links on site adding index.php in URL

I have a Drupal 8 site and am encountering an issue. When I visit the site as an anonymous user and click a link on the menu, it adds /index.php to the url. Then if I navigate to that page and click ...
0
votes
2answers
171 views

Local tasks not correctly limited to base_route

I want to create a customized media library for my editors, with a tab navigation similar to the tabs on core's admin/content view. It basically works, but I also want to add a tab leading to a ...
1
vote
2answers
276 views

How to use HTML entities in links in Drupal 8?

I have a client who prefers some links to have the » symbol at the end. This is typically produced with the » HTML character entity. In Drupal 7, you would do something like this: l('Go there &...
0
votes
1answer
228 views

How to add link module in Bootstrap Paragraphs?

I experiment with the xeno_hero module and Bootstrap Paragraphs module in order to create a call to action block. I want to create an image background with a centered linked textfield. I tried a lot ...
0
votes
1answer
18 views

How do I display category items in a view content pane?

I created an Events content type. I created a vocabulary that has two category terms, Events and Plays. I have a view that contains a list of all content of type Events. Each Events listing displays ...
0
votes
2answers
53 views

How do I display a view pane with all items of a category?

I created an Events content type. I created a vocabulary that has two category terms, Events and Plays. I have a view that contains a list of all content of type Events. Each Events listing displays ...
0
votes
1answer
79 views

Create hook menu with custom module (child/%)

In my custom module I want to create menu with the name "child/%" is it possible. When I create menu "child/test", whenever I load the page http://localhost/project/child/test it gives error page ...
1
vote
1answer
321 views

How to add a "?destination=URL" to the node links

I am trying to override node links by using hook_node_view_alter(), so my code looks like: $cancel_link = 'admin/some_path/'.$found_id.'cancel'; $build['links']['node']['#links']['cancel'] = array( ...
0
votes
1answer
221 views

Create relationship between node and menu link

I would like to create a node with a menu link programmatically. When the operation is complete, I would like the user to see the relationship between the node and the menu link under "Menu Settings" ...
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
1answer
3k views

How to deal with 'internal:' in your link->uri?

I have a link field, which I can populate with both internal and external links: /node/123 I'm building an API that parses the node and returns the URL from the link field: $node->my_field->...
0
votes
1answer
35 views

Adding markup inside first list item of main-menu

I need to add some custom markup inside the first list-item of the main-menu as you can see here: <div id="block-system-main-menu"> <div class="block-inner clearfix"> <div ...
0
votes
1answer
168 views

l() Link function adding Icon before Link Text

Is there a way to pass in an icon inside the tag of the link built by using the link (l()) function? <a href="#"><icon> Link Text</a> I use it like so currently: l('text','...
0
votes
1answer
38 views

I need to display a different link for anonymous users and register users for same content

I have a webform containing a link. I want to change the link depending on the users accessing the webform. For anonymous users, the link should point to user/register?destination=[current page]; for ...
0
votes
1answer
819 views

How to add a menu item to main menu: hook_menu() or menu_link_save()?

I just want to programmatically add some menu items to the main menu, but none of the answers I found worked. Some answers suggest using hook_menu(), others suggest using menu_link_save(). I followed ...
0
votes
0answers
522 views

Replace menu item with fontawesome icon without an extra module

I know there are several possibilities to use icons in menus with modules. Is there also a way to replace a menu item link with a fontawesome icon without installing a module? I only need to replace ...
3
votes
1answer
769 views

How to add a contextual action link to a View?

I want to replace the default EntityListBuilder from a custom entity with a View, as it is much quicker to build that list interface with it. However I want to retain the action button from the ...
3
votes
1answer
306 views

How to alter standard.front_page in module links YML file?

I have a menu with a "Home" link which was "provided by the Standard module. The title and path cannot be edited." I am trying to alter the text/link using my module's links.yml file like so: ...
4
votes
3answers
3k views

Render image that is linked

I am loading an unmananged image file and would like to render it in a block, but it should be linked. I have an uri (public://...) and I am able to render the image using $build['my_image'] = [ ...
1
vote
1answer
383 views

Breadcrumbs disappear on cache clear, come back with subsequent cache clear

I have a site where the breadcrumb is in different locations depending on what node type or page is being viewed. In some places, it is interspersed with node content, so the only solution was for my ...
0
votes
2answers
458 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
2answers
3k views

Add Unique ID to Menu Item

Is it possible to add a unique id or class to each li element in a menu, perhaps using a preprocess function? I want to be able to target each menu item individually with CSS. I could probably use ...
0
votes
1answer
415 views

How do I manage a mix of menu and custom breadcrumbs?

I have a site where I need breadcrumbs to be generated in a couple of different ways: Based on the menu path (Menu Breadcrumb) Based on custom rules (was thinking Custom Breadcrumb but it doesnt ...
1
vote
1answer
1k views

Link by internal path in *.links.menu.yml not visible in admin menu

Based on the official documentation to create menu links I've tried to use an internal link on the administration menu. But the internal link is only visible for users with administrator rights. In ...
1
vote
0answers
50 views

In Responsive Bartik, add collapsible menu toggle to wide screen?

Does anyone know how to enable the collapsible menu/menu toggle functionality that is part of Responsive Bartik on small screens to large screens? It doesn't seem to be done solely by media queries.
0
votes
2answers
1k views

Difficulty adding a parent menu link

I'm creating a custom module in Drupal 8.4.4. I put several menu links under the Development menu. scrape.scrape_form: title: 'Scrape' parent: system.admin_config_development route_name: scrape....
0
votes
1answer
446 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 "...
0
votes
2answers
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 ...
-3
votes
2answers
842 views

How to know the menu ID

Like a function to debug a page or something. Want to add a link via links.yml but can't get the menu 'parent' name
-1
votes
1answer
33 views

get menulink id from enitity id?

Id like to be able to get a link content ID from an entity id. Not sure how to best do this? I'm trying to render a menu tree and use a specific taxonomy term as the menu tree root. I have access to ...
0
votes
2answers
360 views

How to change menu item URL in menus for Drupal 7 multiiste

I am using drupal 7 multisite (sharing the same database, same code base) i.e 1) one.example.com 2) two.example.com Everything is working correctly and my site using the same menus for all the ...

1
3 4
5
6 7
32