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
4
votes
1answer
218 views

load node author uid to be used as contextual link inside template.php D7

I need to load node author uid to be used as part of a href link inside template.php, I managed to add a contextual link according to this post, and call it from node.tpl.php but I can't access node ...
4
votes
2answers
1k views

How to translate the menu title?

Currently I am working on a multilingual website and have already a multilingual set-up. Now I have translated menu items and it is working great, however I also want the menu title to be translated. ...
4
votes
3answers
6k views

Disable the navbar in a Bootstrap sub-theme

I've noticed that the Bootstrap Navbar, while behaving like the 'Main menu' is not available to be enabled and disabled from the blocks admin page, furthermore at the admin menu admin/appearance/my-...
4
votes
2answers
2k views

How to change all hyperlinks in the content

Hi i am new to the drupal and i got problem in my site in the hyperlinks. I have book copy module by which i have created one copy of the book. After creating the book i set aliases to content/newbook ...
4
votes
1answer
3k views

How to jump to a specific page in a multipage Webform?

I have a multipage Webform, and I'm using Webform Bonus Pack to display a summary at the end before the user finally submits the form. What I'd like to do is provide "edit" links alongside the ...
4
votes
2answers
124 views

Show new navigation once user log in?

I'm building a site using Drupal 7 and have a question regarding navigation and roles. My site requires that a lot of content be accessible only to members. I'm wondering how I can show a secondary ...
4
votes
1answer
606 views

Globally providing title attribute to links

Recently I've been asked by a SEO-managing person to copy the text of all links within main menu into their title attribute. As my menu is run by OM Maximenu and contains mostly Views, it was ...
4
votes
1answer
1k views

Does request_uri() have to be filtered or escaped?

Mind my ignorance, but I'm trying to understand whether or not calling request_uri(), and then echoing output from it into a link is safe. What I'm doing is getting arguments from the URL, for ...
4
votes
3answers
1k views

menu block or view that shows only siblings and parents

It seems like this function was removed in drupal 8 so I am trying to find a solution that doesn't involve created a large amount of blocks or hard coding something. (Best would be a block or a view) ...
4
votes
1answer
641 views

Linkit not working with CkEditor

I have installed the Linkit module to a test site. I have created a profile, set Matchers and created attributes. I have gone into the CKEditor configuration and chosen my Linkit profile, added the ...
4
votes
2answers
1k views

Use wget to mirror a site to a static site

I'm trying to use the following command to mirror a Drupal 6 site which needs to be archived as a static site. Unfortunately, I've only been able to find a static generator for Drupal 7, not 6. I'm ...
4
votes
1answer
288 views

How to update block with step links based on AJAXified multipage entity form state?

Brief I'm using Entityform with Field group configured as Multipage with AJAX enabled for multipage groups provided by Field Group Ajaxified Multipage. So there are multiple steps and user can access ...
4
votes
1answer
2k views

How to implement a Views 3 exposed filter in block as a list of links, and update the view via ajax?

I need to create a views exposed filter that is displayed as a list of links, and updates the view via Ajax. I've tried using Better Exposed Filters and it will display the filter as links, but ...
4
votes
2answers
191 views

List pages on frontpage with views?

So, I'm relatively new to Drupal, and I'd like to make a Drupal site with a front page with a grid of links to other commonly used pages on the site. This site is intended as a sort of community page ...
3
votes
4answers
4k views

How to remove bullets from drupal menu?

I have created a drupal menu and added a couple of links. Unfortunately, when displayed, these come with bullets. How can I remove these? I am using the Precise theme, but it does not seem to be added ...
3
votes
1answer
2k views

Determine which region a menu block is rendered in

I need to re-use the same menu in two different regions, with slightly different markup. My thought was to simply check which region the block was being rendered in, and use if statements to modify ...
3
votes
3answers
5k views

Finding menu item ID

How to find a menu item pointing to the specific node? On node creation I want to create a main_menu link for the node. With menu_rules it is relatively easy. The problem arises when the parent ...
3
votes
3answers
4k views

Alter the access of menu links before rendering

I need to alter the access of menu links before being rendered. In Drupal 7, we used hook_translated_menu_link_alter() for it. Drupal 8 change records show that there are no direct replacement for ...
3
votes
3answers
4k views

Drupal 8 register link?

I have a clean Drupal 8 install with bootstrap theme. I just want to add a simple link to the registration form in the user account menu and to it only be visible if you are not logged in. The login ...
3
votes
1answer
2k views

Programatically linking an image to content (Drupal 7)

When I create a block through views I can easily link it to the content page by setting link image to in the field's settings. But I also have some blocks that are created programmatically and I ...
3
votes
2answers
2k views

How do I create a local menu action to node/add/page?

Here is the code in mymodule.links.action.yml to add a local action in a custom page (generated by the Views module). amidori_utils.add_content: route_name: 'node.add_page' title: 'Add Content' ...
3
votes
3answers
4k views

How to add custom class on the menu block using twig?

I'm new in Drupal 8 and i'm trying to display my primary menu block using twig as below {% if page.primary_menu %} {{ page.primary_menu }} {% endif %} which gives me like this <ul class="...
3
votes
2answers
2k views

Restrict the node local tabs access to specific content types

I have a module_name.links.tasks.yml file for Drupal 8, whose content is the following one. entity.node.module_admin: route_name: module_name.admin base_route: entity.node.canonical title: ...
3
votes
2answers
5k views

How to pass variables into link path within l() function?

I am wondering how to pass variables into a the path argument for a link created with l(). The path looks like registration-history/listing/$node->nid/$sku/$node->created/$start_date And the ...
3
votes
2answers
2k views

How can I add a span tag inside my menu link?

My twig file contains the following: <li{{ item.attributes.addClass(classes) }}> {{ link(item.title, item.url) }} </li> Which outputs: <li class="menu-item item--search"> &...
3
votes
1answer
8k views

Get menu link item from MenuLinkTreeElement

Hey I am loading a drupal 8 menu in the following way: if ($menu != NULL) { $tree = \Drupal::menuTree() ->load("my_menu", new MenuTreeParameters()); This returns MenuLinkTreeElement ...
3
votes
2answers
2k views

How can I add HTML tags into menu title?

How can I add HTML tags into menu title? I'm also tryed the following code. function adminimal_theme_preprocess_menu(&$vars) { if ($vars['menu_name'] === 'main') { $vars['items']['...
3
votes
3answers
6k views

How to change HTML output of main menu

When I output the main menu this is the html that gets generated: <ul id="main-menu" class="links inline clearfix"> <li class="menu-218 first active"><a href="/drupal/" class="...
3
votes
2answers
955 views

Dynamic local tasks - caching problems

I try to create some local second level tasks depending on some settings for a custom entity. But unfortunately sometimes these local tasks do not appear - they appear again when rebuilding caching ...
3
votes
2answers
1k views

Is it possible to use tokens in a menu link in Drupal8?

I need to add an option to "User account Menu" that shows the current user name. It is possible to do this using tokens or some other method? Thanks!
3
votes
1answer
1k views

How get a programmatically menu fields into template?

i add to my main menu an image field programmatically for build a megaMenu : /** * Implements hook_entity_base_field_info(). */ function hook_entity_base_field_info(EntityTypeInterface $entity_type)...
3
votes
1answer
3k views

creating links containing anchors

In relation to Drupal 8 ... if a user wanted to create a link such as the following: <a href='#' onClick='testfunction ();'>link</a> How could such a link be created, normally creating a ...
3
votes
2answers
2k views

Adding the contextual link render element

I have render array like this. $array = [ '#theme' => 'theme_wrap', '#content' => $data, '#contextual_links' => [ 'my_module' => [ 'my_module.router.name', $pid ] ] ...
3
votes
2answers
1k views

Show only “Read more” link

How can show only "read more" link in node's teaser, and remove or unset other links like "add new comments" or "2 Comments" at the end of a node teaser?
3
votes
1answer
127 views

How to select by default nodes of a content type in admin/content through a link?

I'd like to make a link to admin/content/, but when the page was displayed I'd like to have it filtered by a certain content type. The link can be like this admin/content/house so when I click it, ...
3
votes
5answers
4k views

How can I replace all my internal links automatically?

I have changed the domain of my website from www.mysite.com to mysite.net. I upload the site to the new domain and all is fine, but I have more than one thousand nodes, and in almost all the nodes I ...
3
votes
2answers
5k views

render array with images

I have this array in PHP $link = array( '#type' => 'link', '#title' => 'link1', '#href' => 'http://www.link1.example', '#suffix' => '<br />', ); when i ...
3
votes
2answers
4k views

Views field: how to add html 'title' attribute to link

In views fields like [Content: Title] and [Content: Taxonomy] there is the possibility to have the content displayed as link. Is it also possible to equip these link with a html 'title' attribute? ...
3
votes
1answer
983 views

Output view field as link

I need to output a field in a view as a field, how can I make part of the path the value of a CCK field? For example if for a given item, my CCK value = '19' how can I make my path automatically be ...
3
votes
1answer
234 views

Navigate to next page / previous page based on entity reference field instead of Book module

I am trying to create next/previous page links like the Book module. I have two content types, Chapter and Page. The Chapter content type contains an entity reference field (unlimited) for pages. ...
3
votes
1answer
807 views

How to replace authentication links with custom routes?

I am working on a custom Drupal 8 module that has its own authentication form. For this, I created a Drupal page with the custom authentication form, i.e. I have a route at drupalsite.com/custom-...
3
votes
2answers
4k views

Theming link fields, getting URL value

From a field template level, how can I get the link field URL value so I can theme this thing? Here is my overridden field template for this field: {% for item in items %} {% set classes = [...
3
votes
2answers
269 views

Overwrite menu.twig only for specific node types

I've worked with twig and have overriden most of elements in my application. However, I it is not clear to me how I can overwrite the menu template for specific node-types. The suggestions I get from ...
3
votes
2answers
176 views

Adding a jQuery interaction with Views Accordion [closed]

I have a Views Accordion displaying some books under their categories. I want to add some jQuery interaction, so when the user clicks the triangle of each category, the content will be loaded via ...
3
votes
2answers
468 views

Edit log out link

I have a Log out link in a menu which is pointed to user/logout. I'm trying to edit the name "Log out" to something else like "Sign out". How can I do that?
3
votes
1answer
3k views

Bootstrap Accordion Adapting

I'm adapting my bootstrap html theme to Drupal 7 and want to use some of the features of Bootstrap 3 theme. In Bootstrap theme, there is a code for accordion menu like this: /** * Implements ...
3
votes
3answers
370 views

How to add block to only user/uid and not user/uid/edit

In my site the www.example/user/uid path contains the view and edit tabs. I want to add some blocks to only the view page and not edit page. Using "user/* (Only the listed pages)" under the ...
3
votes
1answer
53 views

How to replace internal links with a view (similar like the Open Graph feature)?

I would like to have the feature, that if users on my site post internal links within a text, this links are replaced by a thumbnail, node title etc. For choosing what to show instead of the link I ...
3
votes
2answers
3k views

Drupal 7 drop down menu not showing on other pages

I have the main menu with 4 links (home, services, portfolio, contact) under "services" I created a sub-menu, (service1, service2, service3) The problem is that the little arrow that drops down the ...
3
votes
2answers
366 views

How can I add a caption to my navigation menu?

How can I add a caption to a navigation menu in Drupal 6? I am trying to achieve this effect:

1 2
3
4 5
32