New answers tagged

0 votes

Change '/user(/*)' URLs to 'profile(/*)'

If you aren't a coder, the Rename Admin Paths module can do this. It allows you to rename /user routes and /admin routes in Drupal 7, 8, and 9. Install the module, go to the config, and choose the new ...
user avatar
2 votes
Accepted

Redirection from user login to another page for logged in users

I don't understand how the latter works, I looked at UserLoginForm.php in addition to user.login.form, but I found no clue. What is involved here? In core there is an exception event subscriber ...
user avatar
  • 89.3k
0 votes

How do I build Breadcrumbs for a certain node?

Build Breadcrumbs for a certain node in Drupal-9. Code is running with Drupal-9: $entity = \Drupal::entityTypeManager()->getStorage('node')->load($nid); $routeName = $entity->toUrl()->...
user avatar
1 vote

Take over display of a content type node route

Here is the other answer that was here but for some reason was deleted today. The answer provided by Shawn works great, but if you would prefer to have separate controllers per content type eg. ...
user avatar
  • 269
2 votes
Accepted

Authentication from a dynamically generated form

Roles are config, whereas routes are code. As such, it's generally better to set a route to a permission, which is code based, rather than a role, so that both the route and permission are controlled ...
user avatar
  • 15.1k
0 votes

Not receiving dropdown of custom autocomplete textfield

Solution For anyone who comes across a similar error; the problem lay within the controller. So the results I was generating as $input was an array in which I was embedding into another array of $...
user avatar
1 vote

Authentication from a dynamically generated form

Try adding _csrf_token: "TRUE" in the routing requirements, like so, requirements: _csrf_token: 'TRUE' You will also be required to auto generate the token from Drupal and use it in the ...
user avatar
0 votes

Menu item still visible even though alterRoutes denies access to it

Sorry, I just discovered that the "Edit user" link is provided by the module "User current paths", so the solution was to use the route "user_current_paths.edit_redirect"....
user avatar
  • 91

Top 50 recent answers are included