Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [routes]

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

2
votes
2answers
785 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). ...
1
vote
1answer
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 ...
2
votes
2answers
742 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 ...
0
votes
0answers
22 views

content type, local tasks and routing

So I have two content types, organisation and room. I'm using pathauto on room so the path for a room is /meet/[organisation]/[room] (based on a field in the room content type linking to the ...
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 ...
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, ...
1
vote
0answers
41 views

Add routing config via admin UI

I have a Drupal site with a specialised search query page that accepts about a dozen arguments as URL query parameters, most of which are optional. Simplified routing YML file looks like this: ...
2
votes
1answer
3k views

Access denied on hello world custom module

Drupal 8 installed in Debian VPS server. Some installed themes do not work, some do. When tried to creat a simple 'Hello World' module,as described in a beginners book for drupal, installing of the ...
0
votes
0answers
36 views

Create route with default param

I've a custom route and form, form input field(s) slightly changes based on arguments passed to it. There are only 2 possible arguments can be passed in URL. I'm using current latest version of Drupal ...
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 ...
2
votes
1answer
342 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 ...
5
votes
2answers
2k 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: ...
1
vote
1answer
2k views

How to force a menu parent link to be non-clickable?

I want the parent link in the menu to not be clickable. As a path is mandatory, I have created a blank node, and in my module I substitute the link by a "#" char. I used custom code in module because ...
-1
votes
0answers
38 views

Menu Link Routes via Menu UI

One of my favorite things about symfony was the routing system. Which is now in drupal. I don't have to create a hard coded link to '/contact-us.' I can just create one to the route name {{ path('...
13
votes
3answers
10k views

How do I alter the route defined by another module?

In other words, what is the Drupl 8 equivalent of hook_menu_alter()? Drupal 8 still uses hook_menu(), but for what I can see, the information returned by the hook is different from what the hook ...
0
votes
0answers
10 views

Local task in user page to add content of specific type

i've a content type called job, i want to show a local task as a tab on user page to simply let him adding a content from there. I've created the MYMODULE.links.task.yml file in my module with this ...
8
votes
3answers
6k views

If you update a routes file in Drupal 8 how do you clear the cache?

Having worked with Drupal 7 since its launch, I'm learning Drupal 8. At the moment I'm finding that whenever I change anything I have to do drush cache-rebuild to get things working again. On my VPS ...
8
votes
2answers
2k 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
357 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 ...
0
votes
2answers
16 views

Getting 443 Forbidden Error on my custom module

I am learning drupal 8 and creating my own custom module. I have a clean localhost installation and was following some tutorials online to create a very basic "hello" for my first attempt. The issue ...
0
votes
1answer
36 views

Route Parameter Validation Problem

I have limited experience with D8 and custom routes. Current mobile video system for client takes a scheme-less url for the video like so https://example.com/mobile-video/some-video-desktop....
0
votes
2answers
2k views

Unable to create an admin menu link

I am trying to create a menu link in Drupal 8. I am following this document: https://api.drupal.org/api/drupal/core!includes!menu.inc/group/menu/8 My module name is twitter_pull and I was able to ...
2
votes
2answers
367 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 ...
0
votes
1answer
361 views

Making menu wrapped in nav tag

I've got problem with making main-menu wrapped in element. I've tried: Using hooks in template.php like: function koko_menu_link_main_menu($variables) { /* For block override */ $output = '<nav&...
23
votes
1answer
26k views

Get the route name of the current page

The route name of the current page is available in page.html.twig? The page is generated by the default feedback form.
0
votes
0answers
14 views

How can I use full URLs for aggregated assets on a specific route?

My organization is using an external search application. The results are intended to be wrapped in a header and footer to mimic the appearance of the main website. I've created a couple of custom ...
0
votes
2answers
450 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
vote
1answer
400 views

How to change autocomplete_route_parameters value on change of select option?

How to change autocomplete_route_parameters value on change of select option? I have a form element and inside autocomplete_route_parameters, I want to change $langcode value when I select any ...
0
votes
2answers
382 views

User specific permission to add links to a menu

When I create a content type, e.g. 'Basic Page' and I want to add a link to a menu I do usually the following: Menu settings -> Provide a menu link -> choose a menu and its position of the link there ...
0
votes
2answers
385 views

How to avoid url conflict when defining menu items, and make sure path without wildcards will be used in favor of path with %?

In hook_menu, I have $path = "events" $items[$path] = array( 'title' => t('Events'), 'page callback' => 'my_events_page', 'access arguments' => array('view my events'), 'type' => ...
0
votes
0answers
20 views

Create Custom Views Link with arg

its about Drupal 8, i created views with link "/admin/x" ... i want create menu in mymodule.links.menu.yml to open "/admin/x/city" i'm using in mymodule.links.menu.yml: imapping....
0
votes
1answer
394 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 | ...
0
votes
0answers
24 views

Trying to send data from client (JS) to server (D8) using jQuery.ajax [duplicate]

I'm new to D8 but have some D7 experience. I'm trying to receive some JSON data from the client and process it in my module. I have successfully received (I can break on it in my debugger) the ajax ...
0
votes
0answers
13 views

Hide “empty” menu parents

I have the following scenario: I have a sidebar that contains my mainmenu. Menuparents are linked to route:<nolink>. Those parents can be expanded using superfish (accordion). When a user has ...
0
votes
2answers
3k views

How do I call a controller method from a twig template and passing arguments to it?

I know I can pass variables to templates using render arrays. $theme = 'block-AcademicDisplay'; return array( '#theme' => $theme, '#content' => $content, '#url' => urlencode($url), ...
2
votes
2answers
3k views

how to create a route with 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: '\Drupal\...
0
votes
1answer
381 views

Multilingual Views and fixed-language menus

I'm having difficulties setting up a multilingual site. The main difficulty being the menus. Until now, I have had one Main Menu, where I was placing all links. There was a problem though with active ...
1
vote
1answer
397 views

How to add subtitle for menu items in Nice menu in Drupal 7

I'm using nice menu in my durpal-7 site.I need to show a subtitle for each menu item.How can this be done ? I'm new to drupal so it would be great if you could help me.
0
votes
1answer
14 views

Pass argument when overriding controller in RouteSubscriber

I am having the issue of overriding the default taxonomy controller /taxonomy/term/{tid}. I have created my own controller which takes {tid} as a parameter and I want to use it instead, so I overrode ...
0
votes
2answers
402 views

Titles not showing for tabs pages

Below is the array in my hook_menu The only issue that I have with it is that the titles are not displaying for tabs pages (the last three array collections). They are showing the title for the ...
2
votes
2answers
1k views
1
vote
1answer
411 views

Drop Down Menu in Alphabetic Order

I have a Drupal Website and a few Drop Down Menus in there which comprise of a list of products. However , the list of products does not appear in alphabetic order. I tired "reset to alphabetical" for ...
0
votes
2answers
405 views

Altering the type of a menu item to local task (tab)

I've searched for hours but I can't find a good answer on how to alter the type of a menu item to local task (tab). The private messages 7.x module (when aided by privatemsg_filter) exposes the ...
3
votes
1answer
408 views

Limit menu items available as possible parents on node creation

As I create a node I want to assign i to a menu item parent. I know that I can limit it to what menu(s) are available on: /admin/structure/types/manage/my_type But it would narrow it down to "only ...
2
votes
1answer
413 views

Hiding Menu Links Based on URL

Is there a way to hide menu links on the main menu based on the URL? For instance, if my URL is 'example.com/undergraduate', the main menu links would be different than if I were to go to 'example....
0
votes
1answer
415 views

Entity reference of a menu link gives Restricted access instead of the real data

I am trying to create an entity reference of a "menu link", but instead of having the menu link name I got "- Restricted access -". It seems to be the same problem with wysiwyg profile. I'm using the ...
0
votes
1answer
20 views

Template suggestion don't work with a custom menu link (custom route)

In a module I have created a custom link by creating a custom route inside the mymodule.routing.file.yml and the mymodule.links.menu.yml file. In my theme.theme file I have defined a hook_page_alter ...
0
votes
1answer
432 views

Secondary Tabs and views

I am trying to get Secondary Tabs to work. I want to create a local tab with sub tabs. View | Edit | Reg Report Reg Report     Reg Report | Pre-Registration | Post-Registartion (...
0
votes
1answer
500 views

Create menu link for authenticated user programatically

So here is what I've tried in custom module dir I've created module.links.menu.yml file here is code. I want to just for authenticated user beside Content link have my custom link to access Webform. ...
3
votes
2answers
104 views

How to hide a menu from <front> page?

The main menu comes with 5 items. How can I hide one items from the < front > page, i.e. 4 items are shown on front page, 5 items are shown on other pages?