Questions tagged [navigation]
Use it for questions about navigation menus and links used in a site.
1,593
questions
0
votes
1
answer
727
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
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
1
answer
415
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 ...
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
375
views
How can i change RealName / User account link destination?
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 ...
1
vote
1
answer
581
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
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 ...
4
votes
4
answers
3k
views
Clearing local tasks cache
Using a deriver, I'm able to produce local tasks for each entity of my custom configuration entity type. So if I have two configuration entity labeled "Foo" and "Bar", I can have similarly labeled ...
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 ...
3
votes
1
answer
373
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
1
answer
667
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 ...
3
votes
1
answer
1k
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
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
479
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
1
answer
482
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
8
views
Menu from Views page display using contextual filter taxonomy term
Classified ads site here, Drupal 10.0.7
I have a View page display showing fields from nodes using Taxonomy Term Id as Contextual Filter.
So if the URL reads "[domain]/clasificados/8" it ...
0
votes
2
answers
516
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
1
answer
651
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 ...
1
vote
1
answer
978
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
vote
2
answers
387
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
1
answer
35
views
How do I add items from from the user module to a menu?
How do I add the core user module links such as My account and Log out to another menu?
1
vote
1
answer
585
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 ...
5
votes
2
answers
3k
views
create empty link
I am using the following code.
$url = Url::fromUri('javascript:', array('external' => true));
$link = Link::fromTextAndUrl(t("#action"), $url)->toString();
It causes the following error:
...
0
votes
1
answer
462
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
507
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
1
answer
419
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
2
answers
483
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
1
answer
667
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
399
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
532
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
1
answer
483
views
Add target="_blank" in menu items (main navigation)
I use Drupal 8.9.3 with custom theme. I need to do a menu item on the main navigation who go on an external link.
I would like to add target="_blank" on this link, but I don't see where I ...
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 ...
0
votes
2
answers
934
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
1
answer
694
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 ...
3
votes
2
answers
660
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 ...
0
votes
1
answer
459
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 ...
0
votes
1
answer
557
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....
1
vote
1
answer
997
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
599
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
579
views
Load disabled items in a menu
I load my main menu programmatically with the following code :
$menuTree = \Drupal::menuTree();
$menuTreeParameters = $menuTree->getCurrentRouteMenuTreeParameters($name);
$...
3
votes
2
answers
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 ...
4
votes
4
answers
3k
views
Get title from Route
I am trying to print out a few links on a custom page template. I would like to use the title and url from each route.
I am trying to print out the title from the route.
I know I can get the url ...
3
votes
3
answers
3k
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
1
answer
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
...
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, ...
0
votes
0
answers
37
views
New pages not included in main navigation but display in sidebar
I have recently inherited this website and was made aware of an issue where new pages that are added to the main navigation are only displaying in the sidebar. I have followed the steps for adding ...
1
vote
3
answers
1k
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 ...
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
vote
1
answer
1k
views
Is the front page 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'...
0
votes
2
answers
808
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 ...