Questions tagged [navigation]
Use it for questions about navigation menus and links used in a site.
513
questions with no upvoted or accepted answers
2
votes
1
answer
640
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 ...
2
votes
0
answers
41
views
Drupal Navigation Title "Reset" to Use Page Title
Does anyone know if there is a way to "reset" a navigation title so that it falls back in-sync with a page's title?
Please find below scenario. Created a page with a title of "Page About Stuff." ...
2
votes
1
answer
56
views
Display external link using theme settings
I'm using theme-settings.php to store links to external pages (like Facebook, Twitter, etc.) and the links aren't storing correctly. In theme-settings.php, I have:
function ...
2
votes
2
answers
165
views
Modifying a single menu link title
I'd like to replace the link title on the top link of my secondary navbar (called "explorer", links to "mysite.net/explorer", but actually just triggers a dropdown-menu) with a glyphicon and the ...
2
votes
0
answers
314
views
How to render a Drupal 7 menu structure with divs instead of lists
I want to change the output of the Drupal 7 menu structure which is like:
<?php print render($primary_nav); ?>
outputs:
<ul class="menu nav navbar-nav">
<li class="first expanded"&...
2
votes
1
answer
183
views
Add labels to superfish sub-menu <ul>s
Long story short, I'm building a Superfish menu structure that looks like the following:
https://i.stack.imgur.com/hXdaz.png1
I'm using superfish & have everything in order except the labels on ...
2
votes
0
answers
194
views
Superfish Menu - Submenus (Child Menus) first link is always ParentMenu link. How to remove this?
In my superfish menus, sub-menus (child-menus) show parent menu link as 1st option. Always. How do I remove this? See the photo for example:
2
votes
0
answers
329
views
Navigation not displaying in Omega 4 subtheme
I have made an Omega 4 subtheme cloned from the omega default starterkit using drush. I made a layout template based on /sites/all/themes/omega/omega/templates/system/page.tpl.php, and selected it.
...
2
votes
0
answers
145
views
How to reorder Book module menu through Database?
How to re-order Book menu faster, optionally through Database?
I have a big problem to reorder menu/ navigation for Book module....
It is supposed by drag-and-drop - I have 318 items in list , some ...
2
votes
4
answers
4k
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 ...
2
votes
1
answer
26
views
filter navigation, site content, etc
I am really new to Drupal, so this is a beginners question.
I need to create a website with a dropdown within the header, where visitors can choose a region (not a language, just a region, like "...
2
votes
1
answer
40
views
Sub menu creation
I need to create page level menus. User goes to a page off of the main menu and is presented with a sub menu. The menu items need to display / not display based on user roles - similar to the main ...
2
votes
0
answers
42
views
What to do for correct book navigation for 2 languages (always both book pages are shown)
We are using in productive system D6 (here it works!) and now we upgrade to 7.25 (it doesn't work). I have a problem to get the book navigation working in the right way. It shows always both languages ...
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 ...
2
votes
1
answer
175
views
What is the hook to alter links in the Book Outline tree?
What is the theme hook to alter links in the book outline like theme_menu_link__menu does for menus? Or is there a way to make theme_menu_link__menu apply changes to a tree view of the Books? Not ...
2
votes
0
answers
46
views
Changing the link in a Feature box to an external link
I am a Drupal beginner working with an already created site.
That said, I have been trying for days to change the text within the feature box to an external link. Currently, all of the text in the ...
2
votes
0
answers
95
views
Changing default overlay behaviour to not return to the top of the screen
I have a custom module which displays a page as an overlay, however when you click on the link it displays the overlay but the background page now returns to the top.
This behaviour can be seen when ...
2
votes
1
answer
345
views
Links in view - wrong language selection
Ok, I'm not sure where should I go with this problem, so forgive me if this is not the exactly best place for it.
I've created multilanguage site, of course, got many problems, but solved them all - ...
2
votes
0
answers
302
views
Nice menus error when implement in zen themes
I copied the following code:
<div id="navigation">
<?php if (module_exists('nice_menus')): ?>
<nav id="main-menu" role="navigation">
<?php
print theme('...
2
votes
0
answers
218
views
global link in views is displaying %3f etc
I have made a global text variable inside a view which I set as a link. This link contained parameters of the other fields found in the view. This is the link I set it for:
subscription_status?...
2
votes
0
answers
134
views
drupal webform url to edit existing response to question
I have a webform in Drupal, with 3 questions Q1, Q2 and Q3.
The users have permission to edit the responses to the webform, and view their own answers.
Hitting on EDIT link now takes the user to the ...
2
votes
0
answers
736
views
How to make submenu for tabs in Zen subtheme?
I'm working on my first subtheme for Zen and ran into a problem. The main menu is being display via tabs. Everything shows up fine, but I have no clue how to allow submenus (or dropdowns, whatever you ...
2
votes
0
answers
298
views
The Link Field module is not creating outbound links
The Link module is not creating external links. I put 'myurl.com' into the node field and the rendered a href is mysite/myurl.com. The title is being rendered correctly, but the links are relative.
...
2
votes
1
answer
276
views
Zen header 'site name' + links issue
I'm using a Zen sub theme, and I've placed the main menu block into the header.
I would like to place the links to the right of the site name, but they only sit underneath. I've tried playing with ...
1
vote
0
answers
83
views
Disable custom module Block Caching or force correct caching
I have build a custom module that builds out a list of child page links based on 'this' page's id.
Logged in it works as expected. But an anon user has problems which range from the block not showing ...
1
vote
1
answer
85
views
Custom Menu Template not Rendering Menu Links
I'm building a custom module that modifies the main theme (barrio bootstrap in this case) to establish a landing page. In that process, it hides blocks in some regions and takes over rendering the ...
1
vote
1
answer
271
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 ...
1
vote
0
answers
33
views
How to disable menus from list of menus per role
I'd like to enable visibility per role of menus placed in /admin/structure/menu .
What I want is to allow, for each menu (Administration, development, Footer etc + custom menus), the possibility for a ...
1
vote
1
answer
355
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 ...
1
vote
0
answers
26
views
How can I delete bogus links under /admin/structure?
I am running Drupal 9.3.4. I see four bogus links under /admin/structure. See the screen shot below. These were paths used by the Context module that were deleted. They are no longer listed under /...
1
vote
1
answer
524
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 ...
1
vote
0
answers
51
views
Front menu not showing subitems
I've generated my menu based on the menu template from the stable theme
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}...
1
vote
1
answer
733
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 ...
1
vote
1
answer
86
views
Set local actions - disabled/inactive
I am currently searching for a possibility to set an action to "inactive" depending on something.
I have found the hook_menu_local_actions_alter(&$local_actions), but do not know how I ...
1
vote
0
answers
56
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 ...
1
vote
1
answer
21
views
Some pages hide content unless "Read more" is clicked
If I have multiple pages on Drupal, some show the full page, and others say "Read more" and will only show the whole page when it is clicked. It doesn't seem to have anything to do with the ...
1
vote
0
answers
72
views
Different node parent menu for per language
My struggle with Drupal 8 continues as I moved onto i18n settings. I've enabled and configured content translation and now I'm facing issue of menu displaying untranslated pages. Popular suggestions ...
1
vote
0
answers
25
views
Local action on node but path a child of node?
I have created two local actions which I want to display on my nodes, General Configuration and Advanced Configuration.
General Configuration will show at node/%node, but Advanced Configuration is ...
1
vote
1
answer
432
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 ...
1
vote
0
answers
124
views
How do you update node menu links?
I am creating Drupal 8 node using code and same time I am assigning a menu link as well its working fine. I am creating a menu using this code.
MenuLinkContent::create([
'title' => $item['...
1
vote
0
answers
505
views
Divide menu tree parents and children links into columns
I have the following menu tree for my main navigation:
Parent 1 (= level 0)
SubParent 1 (= level 1)
SubChild 1.1 (= level 1)
SubChild 1.2 (= level 1)
SubChild 1.3 (= level 1)
SubSubParent 1 (= ...
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'...
1
vote
0
answers
122
views
Caching of sub site menus
Preamble
We currently have a Drupal 8 site that has subsites (accessed via subdomains).
On the main site (non-subdomain) we have a main navigation menu defined (this is presenting correctly on the ...
1
vote
1
answer
99
views
Unclickable Menu link keeps refreshing my page
Hello and sorry for my bad English. I am using Drupal 8 and i want to make a menu with categories. The menu title has to be CATEGORIES and when someone click on it, the menu has to show the categories ...
1
vote
1
answer
42
views
Alter menu link if logged in
I have a regular node in my main menu that:
if an anonymous user clicks on it, the node should be shown regularly
if a logged in user clicks on it, there should be a redirect to an external website
...
1
vote
1
answer
47
views
Leaving first-level tab selected when clicking on a subtab
I have a menu like the following defined in mymodule.links.menu.yml:
mymodule.page_memos:
title: 'List of memos'
description: 'View list of memos'
route_name: view.document_list.page_1
...
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 ...
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
0
answers
59
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.
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, ...