Questions tagged [routes]

Using a term introduced in Drupal 8, routes are the paths to which modules respond.

Filter by
Sorted by
Tagged with
0
votes
0answers
34 views

How to create local task links for referenced entities on a node? [duplicate]

I have a content type, which has three reference fields to three different content types. I want to create secondary task links to those referenced entities. Let's say that I have a Product content ...
1
vote
1answer
610 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
0answers
48 views

Change system.404 path dynamically based on context

I have a site that makes use of the groups module to denote various locations all with their own content. I'd like to give the ability to programmatically alter the system.404 path depending on the ...
1
vote
2answers
31 views

How to add /admin/people as a tab to a custom menu?

In a custom module (association), I ceated views that are accessible thru tabs: The paths are defined in the views; Adhérents et personnes -> /association (this one is also defined as a menu item) ...
1
vote
1answer
614 views

Menu Block won't display when a page has a View Block on it

I have Menu Block installed to provide some contextual menus for certain areas of a site. These generally work great. But I have a few pages where I'm adding a Views generated block to the bottom of ...
0
votes
1answer
38 views

Alter Existing Route - Bypass/override entity permission

I added a custom access check to a JSON API endpoint so that only users who provide a token can POST/PATCH updates on a media endpoint. I followed this documentation in order to alter an existing ...
1
vote
1answer
76 views

How can I change Menus depending upon domains (url name)?

I want to change main menu items depending upon domain and sub domains url in a single site. I could have done it easily with roles, but issue w.r.t anonymous users. How would I show or not certain ...
0
votes
1answer
877 views

How do I dynamically change the title of a menu link?

I made a menu in administration, structures, menu. I want to change the title, as it appears on the menu, of one of the links based on the gender of the currently logged in user. I have found several ...
3
votes
2answers
986 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
1answer
1k 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' ...
1
vote
1answer
5k views

Create a form programmatically and display result on template

I'm trying to create a simple page with a form. With the different filled fields I want to execute different EntityFieldQuery in the HOOK_form_submit. To finish I want to display the result of ...
0
votes
2answers
908 views

Creating Primary Sub menu's programmatically

I want to display the latest 10 nodes of node type 'ABC' as a sub menu link under my primary menu. Are there any modules for Drupal 6 to help me achieve it. I have created a view which gives me a ...
7
votes
6answers
27k views

Customizing menu link output

In Drupal 7, how I can intercept menu rendering in template.php and add pipes after menu links? I tried using template_preprocess_menu_tree but I don't think that is what I am looking for. I want to ...
6
votes
3answers
9k views

Showing a node edit page with drupal_get_form() and hook_menu()

I am using drupal 7 and am stuck at a very basic problem. I would like to simply show the edit page to a known node id. I know there are similar posts but they either didn't work or I didn't ...
2
votes
1answer
347 views

Jump Menu Style Dropdown To External Links

I'm attempting to create a jump menu of links to external websites, and I would like to be able to order the links within this menu differently depending on the organic group of the current user ...
2
votes
1answer
680 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 ...
1
vote
1answer
58 views

How to run alterRoutes on particular condition ? Does it run on cache clear and not on normal Request?

I am trying to implement a feature where I need to run different flow than default flow while the registering user on the site. I am trying to alter the route of "user password reset" for the for the ...
0
votes
2answers
948 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
1answer
914 views

How to organize categories and subcategories of products in menus?

I have product content type that I want to display in a menu. Every product belongs to subcategory that belongs to main category, for example: Computers: PC: - product 1 - product 2 ...
2
votes
2answers
398 views

How can I disable a path from a view?

I have some views I want to keep, and maybe use in the future. currently I am not using them and want to disable the path, or leave it as "No path is set". but all the I'm I am getting the following ...
2
votes
2answers
788 views

form_set_error() redirects to raw ajax response page

I have a page with a simple view. Above the view there is a menu link that when clicked loads a node form with a required file field. The form is fetched and loaded using ajax_commands into a div on ...
2
votes
2answers
880 views

Remove links from the menu tabs

How can I remove the some links from the Tab, when we are login as a particular user. Please see the below picture. I want to remove the tab Items maked in red rectangle (deny access to this link). ...
0
votes
1answer
2k views

Trying to get fullPage.js implemented, but how to add data-attributes?

This is such a great script called fullPage.js I managed to load the js file and css file and even with the Void Menu Module, managed to call anchor links, but I'm struggling with the data ...
7
votes
3answers
1k views

How to use URL parameter and page callbacks for tab menus correctly?

I'm using Drupal 6 and I'm trying to display two tab (menus) on a page that has the URL /vehicle_info. Both pages that the tabs link to should take a node's nid as parameter. My current code looks as ...
3
votes
2answers
1k views

Cannot access Administration > People page

I cannot access the People page. There is no error message. If I click on People in the menu bar, the Administration home page is shown. The other Administration pages are accessible. Similarly, ...
6
votes
3answers
4k views

How do I create a route with a query string?

I have tried a few things and I cannot manage to make this working. My route is the following. amu_hal.publicationsPerYear: path: '/publications/{year}' defaults: _controller:...
4
votes
1answer
346 views

Add '?' and '=' characters to query string [duplicate]

I'm trying to pass '?' and '=' symbols to a page using routing.yml company.calc: path: '/form?company={nid}' defaults: _controller: FrameworkBundle:Redirect:redirect _title: 'Calc' ...
0
votes
0answers
18 views

How to replace an unhandled exception page with a custom landing page?

The Drupal website uses the simpleSAMLphp Authentication module, which allows single sign on functionality. When the user is not able to sign in automatically, they are returned to an unhandled ...
8
votes
2answers
3k views

What is the equivalent of hook_translated_menu_link_alter() to Alter a menu link?

I want to alter the menu link in Drupal 8. In Drupal 7 we can achieve this using hook_translated_menu_link_alter function module_translated_menu_link_alter(&$item, $map) { global $user; if (!...
1
vote
2answers
62 views

How can I retrieve the current node ID on a custom route?

I have a new route and the yml file looks like this: rsvplist.form: path: '/rsvplist' defaults: _form: '\Drupal\rsvplist\Form\RSVPForm' _title: 'RSVP to this Event' requirements: ...
6
votes
2answers
3k views

How to set required POST parameters for routes

With GET method we can do something like this example.user path: 'example/{user}' defaults: _controller: '\Drupal\example\Controller\ExampleController::content' requirements: ...
0
votes
1answer
32 views

How to define frontend theme (non-admin) for a given node tab route?

In my custom module I want to define a new tab associated with nodes. I have my own custom route file with the required definitions and a Links file to make sure the new route will be displayed as a ...
1
vote
2answers
399 views

How can I include a dropdown in menu_local_tasks tabs?

I am trying to include a Bootstrap style dropdown in the local_tasks tabs on a section of my website. I thought I might be able to accomplish this with the 'theme callback' option of 'HOOK_MENU', but ...
1
vote
2answers
875 views

How to create a link that uses a route?

I am trying to add a link to a taxonomy landing page, like this $breadcrumbs->addLink(Link::createFromRoute($term_name,"/taxonomy/term/$tid")); but I get the following error : Symfony\Component\...
0
votes
0answers
146 views

How do I redirect to an external URL in new tab by using RedirectResponse or TrustedRedirectResponse?

I need to use TrustedRedirectResponse on my site and open the external url in new tab?How can it possible in drupal 8
0
votes
2answers
493 views

Tab Tamer - Hiding tabs based on Roles

Tab Tamer Module only does but so much. I want to hide a tab for anonymous users and have it active for other admin users. This just turns it off completely. Any ideas?
0
votes
1answer
460 views

How can I reorder active menu items programmatically?

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 | ...
5
votes
1answer
78 views

Is there a way to partially rebuild the router or invalidate a route cache?

I'm using the Groups module (http://dgo.to/group) to set up groups on a SaaS project I'm working on. I've set up a domain field on the groups, allowing groups to have vanity domain. As such, groups ...
2
votes
1answer
180 views

Adding multiple menus entries to a view

We have a view with a page attached to it. By default the settings screen pictured below lets you add only a single menu entry for the view. Is it possible to have this featured in two or more menus ...
1
vote
1answer
64 views

How to store temporary metadata for the remainder of a request?

I am looking for a way to store some additional metadata for the remainder of a request, that should be removed after the request has finished. Sessions or SharedTempStore store persistent data across ...
2
votes
2answers
4k views

menu access callback per role

I'm trying to implement an access callback per role for a specific menu item, but other roles can view that menu item also. Any tip is welcome. /** * Implements hook_menu(); */ function ...
2
votes
0answers
47 views

How to get module name from a given route object?

In a runtime context, given I have a route object, e.g. from route name user.register, how do I find the path or routing.yml or other definer of the route? Does Drupal or Symfony provide for this? ...
0
votes
3answers
355 views

specify context on hook_menu drupal

I would like to check if particular node instance exists then load that node. if the instance does not exist, then display message. So far: function MODULE_menu() { $items['ds-some'] = array( ...
4
votes
5answers
3k views

How do I filter a menu to only show menu items translated into current language?

In my Drupal 8 project I have a menu containing menu items in english. Some of the items have a german translation. How do I filter the menu to only show the german items when viewing the site in ...
0
votes
3answers
46 views

Can I create a form with a route like this /rooms/{node.alias}/booking?

I'm working on a booking project and I have to create a form for reservations. I have created the accommodation content type and the url_alias for this is: /rooms/[node:title] Example: /node/1 = /...
1
vote
0answers
214 views

Custom module route to config form deleted, now the site is down

So I have a custom module Domaincheck which had an admin configuration form. Since that one is not needed at all, I decided to clean up and delete the form and route. That resulted in a Symfony\...
3
votes
2answers
2k views

How can I create menu links to external URLs?

With my module MYMODULE I would like to create external link and place it into main menu. Is it possible to do that in MYMODULE.links.menu.yml file or MYMODULE.routing.yml? Something like this??? ...
3
votes
1answer
25 views

404 Not Shown For Custom Module - Drupal 7

In a hook_menu() implementation, I am defining a route for login. function my_account_menu() { $items['login'] = array( 'title' => 'Customer Login', 'page callback' => '...
5
votes
7answers
14k views

How to add / remove tabs from user profile?

By clicking on the "My account" link that on the secondary menu on the site, the user is redirecting to the user's profile page. In this page there are many tabs. Some tabs are there originally, and ...
2
votes
0answers
75 views

How is a response generated?

A generic basic PHP Application using Symfony uses code similar to the following one. $request = Request::createFromGlobals(); $context = new RequestContext(); $context->fromRequest($request); $...

1
2
3 4 5
45