Routing alter

Categories

Component ID

2349595

Component name

Routing alter

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Allows developers to alter routes from yaml files.

To alter an existing route a new yaml file should be created in the module's
directory.

Example

If you want to alter the route for the node add page, to change the page title and the permission.

  1. Create a new file mymodule.routing.alter.yml
  2. Add the modified properties in the route.
     node.add_page:
        defaults:
          _title: 'Add content - title modified'
        requirements:
          _permission: 'content contributor'

The other properties of the route will remain untouched.
IF two modules are altering the same route, they will be applied regarding to the module's weight.