Questions tagged [routes]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
608 views

RouteNotFoundException when trying to delete a custom entity

I am building a custom component in Drupal 8 that has an entity with child entities i.e., TeamEntity has one or more MeetEntity objects. When I navigate to the "Delete" link for a given MeetEntity, I ...
0
votes
1answer
549 views

Adding class to nested UL in Drupal 7 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 ...
2
votes
2answers
772 views

Overriding an entity add/edit form through alterroute

I want to create my own version of the add/edit form for an entity defined in contrib module (drupal_commerce). I assumed i'd be able to adapt the example here http://www.foreach.be/blog/how-...
0
votes
2answers
570 views

How to create parent child menu programatically?

I have an array like this : Array( [0] => Array( [link_title] => Level == bod [link_path] => link1 [menu_name] => parrent-child-menu [weight] => 1 [expanded] => 1 ) ) Array( ...
3
votes
1answer
601 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' ...
1
vote
1answer
485 views

Override theme function for menu callback

What I am looking for: I have a custom node link which, when clicked, displays a custom HTML content (option selections) in a lightbox. I need to pass an argument to the HTML content to generate the ...
0
votes
1answer
14 views

Explicitly passing argument to local action for access check

I'm using the group module, and in a custom module I'm trying to create a local task that will bring you directly to the create page for a particular group content type. My goal is to skip the create ...
0
votes
1answer
33 views

Disable cache on base url for redirecting unauthenticated users

I am trying to redirect unauthenticated users. So anytime an unauthenticated user tries to get to the base url, redirect them to an external url. Currently works, but continues to redirect to the ...
2
votes
1answer
493 views

Problems with active-trails

I have played with Menu Trail by Path and Menu Position, but none worked well with a Views-generated listing acting as a navigation menu. Imagine the following scenario: On the left side there is ...
0
votes
1answer
512 views

Permission for translating menu items via the menu config screen

I have a multi language Drupal site, Using i18n and the entity translation approach. Translating menu items from an node works well, but not all the menu items are driven by the nodes. Now as user/1, ...
0
votes
1answer
42 views

How to route dynamic routes to a single node while keeping the urls?

I have a node node/1 with the path alias /path. What I want is for /path/* to always behave like you went to /path, but not change the url. So going to /path/test?something=1 should behave identically ...
3
votes
2answers
605 views

hook_menu create a URL/Menu Item

I'm trying to create a page through hook_menu so I can add my custom block with context instead. function my_module_menu() { $items['my_page'] = array( 'title' => 'my_page', '...
0
votes
1answer
545 views

Displaying titles of collapsed menus

I'm currently converting a mock-up and I need to display four menus in a list, the first two are expanded, and I need to display both the titles and menu items, and the next two are collapsed, so I ...
2
votes
2answers
242 views

Write complex access control in a reusable way

We deal with nodes representing humans with two important properties: mother and father. Your parents as well as your aunts and uncles should get extra permissions, like to see you in a certain view ...
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
564 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
34 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
861 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
985 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
906 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
345 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
51 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
941 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
909 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
396 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
779 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
329 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
17 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
57 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
27 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
393 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
846 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
125 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
485 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?

1 2 3 4 5 45