Questions tagged [navigation]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
884 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 ...
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
0answers
40 views

How to replace the default page and tab of profiles in the user account?

I installed the "Profile" module on my "Drupal 9" website. When I create a profile type, the module automatically creates a tab in the user account for each profile type. For my ...
3
votes
1answer
802 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' ...
0
votes
2answers
46 views

Drupal Tokens in Menu Link and Title

menu_token module is working fine to achieve the purpose. Does the module token_filter has this functionality? I can use tokens in wysiwyg using token_filter but cannot make it working for menu title ...
-1
votes
1answer
29 views

How can I re-organize the user account tabs?

I have a Drupal 9 site. I can't find how to rearrange or rename the user account tabs. How can I re-organize the user account tabs?
2
votes
1answer
322 views

I cannot add node links to primary links

I have a problem that is driving me crazy. I've been trying to solve it for a week now without luck. The problem is, I can't add any internal (node/xxx) links to primary-links. After I add one, it ...
0
votes
1answer
13 views

Translating Menu Item Programmatically?

I have been trying to translate menu items programmatically but upon saving it just adds the english field value to all my translations. Below is the code I am trying to execute: if ($entity->...
0
votes
1answer
993 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 ...
0
votes
1answer
404 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
1answer
1k views

How to add a tabbed menu on group main page (panel)?

I managed to get panels working with og 7.x-2.1 following: - http://modulesunraveled.com/organic-groups/part-3-organic-groups-layout - http://www.initsix.co.uk/organic-groups-panels-and-views-drupal-7 ...
5
votes
2answers
600 views

Adding Contextual Links to Ctools Custom Content Type Plugin

Ctools custom content type called Custom Panes shows contextual links when you have access permission and you hover over the pane (much like a block shows the contextual links) which allows you to ...
2
votes
1answer
602 views

Add class in sub menu

I am trying to convert html to Drupal 7 theme. function theme_menu_tree($variables){ return '<ul class="my-class-1">' . $variables['tree'] . '</ul>'; } simply returns the entire menu ...
0
votes
2answers
716 views

JQuery Accordion closes unintended when ajax-link from inside gets response

I'm working on a page where a user can click on ajaxified links inside a JQuery-Accordion-Widget. Currently every time a link is clicked and the response is loaded, the accordion gets closed and it ...
3
votes
3answers
2k views

How to add onclick event to a link?

I need to create a link, which when clicked should be able to set a session variable. I have used l() function to create the link and tried this but this is not working. 'name' => l(t($n['name']),...
1
vote
1answer
3k views

Create a primary link for the user edit page [closed]

What is the proper way to create a link under Primary Links that will take the logged in user to their own user edit page?
2
votes
3answers
4k views

Adding more variables to menu for use in menu.html.twig

I'm attempting to give menus more variables to work with besides the default menu_name,items, and attributes. This is because making a variable in the preprocess menu hook does not allow it to be ...
1
vote
1answer
896 views

Possible parent values for parent of links

I am trying to create links in my Drupal 8 module, following this tutorial. So far, I have a link as follows in my module.links.menu.yml file: module.admin_settings: route_name: module.adminForm ...
0
votes
1answer
378 views

Making menu wrapped in nav tag

I've got problem with making main-menu wrapped in element. I've tried: Using hooks in template.php like: function koko_menu_link_main_menu($variables) { /* For block override */ $output = '<nav&...
2
votes
4answers
3k views

use-ajax class for ajax link not working in dynamic content load

use-ajax class link not working when i load new content using custom ajax code, which has the use-ajax class links. I use normal jquery ajax to load the content because, i have drag and drop ...
0
votes
1answer
540 views

Hide block on specific page through custom contextual link

We usually require to hide some blocks on specific pages for which we need to goto configure block page and add the URL of the page where we do not want to display a block. Instead of going to ...
3
votes
1answer
1k views

How can I modify the Quick Edit Module to have a better UX for end-users?

For a current project I'm working on we're trying to leverage the "In Place Editor" functionality provided by the Quick Edit module. Our main goals are to: Have a module that allows us to perform ...
3
votes
2answers
1k views

Show menu link descriptions for a custom navigation menu

I have the following navigation, displayed in page.tpl.php: theme('links', array('links' => menu_navigation_links('menu-site-navigation'))); There are four navigation elements that show up. I ...
2
votes
2answers
2k views

Defining module.links.action.yml with route parameters

How can I pass dynamically route parameters to module.links.action.yml? My code of module.links.action.yml: module.group_apply: route_name: module.group_apply title: 'Subscribe to group' ...
0
votes
1answer
399 views

How to make Adaptivetheme dropdown menu show on start page?

I'm using Drupal 8 with an Adaptivetheme subtheme. The horizontal navigation menu resides in the leader board region. Some menu entries have submenus, but they do not show on the start page. One has ...
3
votes
1answer
490 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
3answers
735 views

Get URLs of taxonomies terms in Link field

I am having a link field in drupal 8. It can accept both internal and external links with autocomplete feature. But it works only with nodes means with content but i want to use it with taxonomy terms ...
1
vote
2answers
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
1answer
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 ...
0
votes
2answers
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 ...
1
vote
1answer
472 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'...
5
votes
2answers
7k views

How do I get the absolute URL when using l()?

I want to get <a href="http://site.ru/node/123">New product</a> from l(), and I call it as l('New product', 'node/123'), but this function generates a URL that is not absolute. How can I ...
3
votes
1answer
864 views

Taxomony menu - show all, vocabulary link are disabled

I have a custom vocabulary which looks something like this: Shops (vocabulary name) Sporting Goods Auto Parts Computers Etc. (15 items in total, 1 level) My goal is to create a menu link to Shops ...
0
votes
0answers
35 views

Create multiple Menu blocks from the same menu

In Drupal 7, the Blocks page contained a link for 'Add menu block', from where you could create multiple menu blocks of the same menu. In Drupal 8, menu blocks seem to be generated automatically, ...
0
votes
0answers
17 views

Recreate the Management menu during migration

I've just done the upgrade from Drupal 7 to 8 (on a site that was updated from Drupal 5 to 6, 6 to 7...) and the management menu seems to be a bit of a mess. An attempt at trying to fix it up left it ...
1
vote
2answers
184 views

How to increase book weight range for a same-level chapters

I have a book of 33 chapters. These chapters are numbered with roman numbers: Chapter I, chapter II and so on.I'm a blind user, so I can't use drag & drop reorder. In Drupal 7, weight range is -15 ...
0
votes
2answers
83 views

How do I add an external link in a module?

I'm attempting develop a module in drupal-8 that provides a link to an external password reset system. Specifically on the login page I'd like a reset my password link that points to a link such as ...
1
vote
1answer
568 views

Missing bottom level item when a node is linked to two menu objects

I have been trying to create a custom menu block which shows a number of menu items with images on the current level. I am having an issue where the active trail array doesn't return an menu item for ...
1
vote
1answer
489 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. ...
3
votes
1answer
2k 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
1answer
4k views

How to add image field to main navigation menu item

I am having a problem using MYTHEME.theme file to add image field in the menu item object. I need to be able to specify an image for each menu link/item! function HOOK_entity_base_field_info(...
3
votes
1answer
234 views

How can I remove all contextual links?

When using the layout builder module, the contextual links module is a hard dependency. This works quite well in the context of the layout builder. But I don't want those links anywhere else, because ...
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 ...
0
votes
1answer
572 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
0answers
25 views

Menu link Converting full URL to local

When I save a menu link pointing to a node (nid 5, alias /woohoo/magic/test, it's value in the database is: entity:node/5 I'm trying to convert fully formed user inputs such as "http://127.0.0.1:...
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 ...
49
votes
12answers
84k views

How to get the valid URL of a Link field from within a Twig template?

I have a Link field named field_my_link (machine name). Within a Twig template I can get the link's URL value with this: {{ node.field_my_link.uri }} If inside the Link's URL there is an external ...
0
votes
1answer
453 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 ...
0
votes
0answers
14 views

Large menu management options

I have a site with about 800 pages in the main menu. When creating or editing a node, managing the menu item parent can be challenging with a select list containing so many options! I am using Big ...
1
vote
1answer
785 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 ...

1
2 3 4 5
32