Questions tagged [routes]

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

Filter by
Sorted by
Tagged with
5
votes
6answers
12k views

How can I add relative path to a pdf file link in drupal menu

I have created menu link for a pdf file. I can use a full path like "http://website/sites/all/myfiles/file.pdf", but if I try to put a relative link such as "sites/all/myfiles/file.pdf" it does not ...
2
votes
2answers
332 views

How can I allow the current user to only see their own page?

I created a page in a custom module. I want only the current user to access this page on their behalf. For example, I am using it with ID 51. If I go to : /user/51/tasks I can see this page. If I go ...
2
votes
1answer
498 views

Want parent MENU_LOCAL_TASK tab to show when on a child page

I have a set of local task menu items defined in my module. This includes the following items: control => MENU_NORMAL_ITEM control/jobs => MENU_DEFAULT_LOCAL_TASK control/jobs/% => MENU_??? control/...
0
votes
2answers
20 views

How to determine the route for the add node page of a custom entity type?

I have a node type question that I want users to be able to create rapidly. So, after adding a question, I want them to be redirected to /node/add/question to immediately do it again. This is my code ...
1
vote
2answers
566 views

Print Main Menu inside a block

Very new to Drupal--trying to understand building a dynamic navigation menu for end users to handle. Is it possible to print the Main Menu inside a block I'm using for the header? e.g. <nav id="...
1
vote
1answer
973 views

How to have OutboundPathProcessorInterface change the URL of the loading page

I have a page my/topics. The page presents content based on the user's selection from another page. Having made the selection, it and other information is passed to the page via a query string: ...
0
votes
1answer
510 views

is it possible to have multiple access callback for a menu item

I am trying to add access callback to already existing access callback for a menu item. For eg, path = [node/nid/edit] with access callback 'AC1'. Now is it possible for us to add another access ...
0
votes
1answer
450 views

Displaying parts of main menu in separate blocks

I need to display my main menu in separate blocks: the first sub-menu in one block, and the following two sub-menus in another block. I'm using Drupal's native menu module and also the nice menus ...
0
votes
1answer
40 views

Why do I get an error related to a controller when I created a custom module?

I created custom module following the Creating a custom module on Drupal tutorial. The teacher of this tutorial demonstrated how you can create a custom module that displays on the page Hello world. ...
-1
votes
0answers
30 views

How do I resolve the “Route ”pruebas_module.content“ does not exist” error?

I am using Drupal 8, and I started to make an example module following an Internet article, but when I install the module I get the following error message. Uncaught PHP Exception Symfony\Component\...
2
votes
2answers
864 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-...
3
votes
1answer
650 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' ...
0
votes
0answers
45 views

What is the difference between access method in controller and custom access check

I am trying to create a module with custom access checks. I would like to know what additional features does implementing AccessInterface provide. For example I can check access within the ...
0
votes
2answers
582 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( ...
0
votes
2answers
40 views

I'm getting a page not found error when trying to visit my custom form

This is the form that I created using Drupal 8: namespace \Drupal\lookup\Form\lookupForm; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; class lookupform extends FormBase { ...
1
vote
2answers
38 views

How to hide Forums from anonymous users?

I installed Forum module. So, I have 'Forums' link in 'Tools' menu corresponding to the path /forum defined in forum.routing.yml in which access is defined by _permission: 'access content'. In my site,...
1
vote
1answer
486 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 ...
1
vote
0answers
178 views

Exclude tabs based on Tac Lite permissions

I'm currently using Tac Lite to grant editing permissions to individuals throughout the site. If a user has access to edit a particular node the edit tab appears, if they don't they won't see the tab. ...
0
votes
1answer
519 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
0answers
22 views

No route found for POST

I've been working on a custom rest module for Drupal. I wrote the following Resource class. <?php namespace Drupal\aker_platform\Plugin\rest\resource; /** * Provides a License GET Resource ...
1
vote
1answer
616 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
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 ...
1
vote
1answer
661 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 ...
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' ...
3
votes
2answers
622 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
899 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 ...
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 ...
3
votes
2answers
996 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 ...
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
46 views

Routing path with Entity Reference field

I'm working on a custom module (my_module) which provides some functionality to a specific paragraph type (my_paragraph) created from the user interface. In my routing file, I have the following ...
0
votes
1answer
19 views

“Route ”ctf.content“ does not exist” when installing custom module

I tried writing my own copy of the skeleton module from https://github.com/sidharrell/D8HWexample.git modules/custom/hello_world, but I thought I'd start by changing the module name and using "ctf" ...
0
votes
2answers
910 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 ...
0
votes
1answer
931 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
402 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
2answers
956 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 ...
2
votes
2answers
805 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
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 ...
0
votes
0answers
29 views

Callback function for module menu can't be called from another file

I have a module that uses the hook_menu to create an endpoint. It is set up like: my_api.module function my_api_menu() { $items = array(); $items['api/v1/users/test/create-test-users'] = array( ...
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). ...
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, ...
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 ...
0
votes
1answer
50 views

How to temporarily replace Drupal with static HTML pages?

I'm a JavaScript dev with no Drupal experience. I'm working with a church to redesign their Drupal site after their dev moved on without leaving any notes/documentation/etc. In the meantime, I'd like ...
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
471 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 | ...
1
vote
2answers
409 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 ...
5
votes
8answers
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 ...
1
vote
0answers
282 views

How to hide taxonomy menu items on specific pages?

My situation on D7: I have 6 different menus displayed on the left side region of a Omega theme using with Delta + Context. Each menu is a taxonomy vocabulary created using taxonomy_menu and ...
0
votes
1answer
58 views

Drupal PHP Coding Standards

I have declared two items in my hook menu. //Calls a function that enables inputting/updating data of a particular template. $items['user/%user/myid_inputting'] = array( 'title' => 'MyID ...
0
votes
1answer
419 views

Creating some views fields for a taxonomy menu with the active trail CSS classes?

I have a taxonomy vocabulary which I want to use to create some navigation on my site. Terms: Weather Clothes Calendar Sports I want to be able to pull these terms and put them in the navigation ...
1
vote
2answers
74 views

How to change Taxonomy admin page title?

I simply need to change the title on the (Drupal 8.8.4) administrative page which lists the existing vocabularies. As far as I know/read, the routing.yml should be modified, shouldn't it? (Is only ...

1
2 3 4 5
45