The node.routing.yml file does not include routes for the 'manage fields', 'manage form display' and 'manage display' tabs of the node type page. Currently we only have a route to the first tab 'Edit'.
node-type tabs
To assist with the configuration of Scheduler module I want to give a link directly to the form-display page (tabs), using Url::fromRoute() to derive the actual url /admin/structure/types/manage/{node_type}/form-display, therefore the routes need to exist. Although I could add them into Scheduler's routing.yml the correct place for them is in the core node.routing.yml file.

Patch to follow.

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new911 bytes

Patch creates three routes (even though I only need one of them, it is compete to make all three)

larowlan’s picture

Status: Needs review » Closed (works as designed)

They are provided by the field ui module

jonathan1055’s picture

Status: Closed (works as designed) » Needs review

Thanks for the reply. However, I cannot see those routes in core/modules/field_ui/field_ui.routing.yml. That file does not have any routes starting with /admin/structure/types/manage. I have searched the whole codebase of core and can only find /admin/structure/types/manage/{node_type} and /admin/structure/types/manage/{node_type}/delete and they are both in node.routing.yml

Maybe there is another place where routes are defined? Or somehow the string '/admin/structure/types/manage' is not present but parameters used instead, such that my searching fails. I'm sorry to reopen this issue, but I need to see what route resolves to /admin/structure/types/manage/{node_type}/form-display and if core does not provide one then my patch above will be useful.

Thanks
Jonathan

jonathan1055’s picture

Status: Needs review » Closed (works as designed)
StatusFileSize
new239.74 KB

OK, I have now, via the Devel module route info, found the routes. See attached.

But how they are created if they do not appear in any .routing.yml file? There must be a dynamic way these routes are derived.

larowlan’s picture

Yep, they are added dynamically based on all the fieldable entity-type definitions - see \Drupal\field_ui\Routing\RouteSubscriber::alterRoutes

As the fieldable entity types cannot be known in advance, the routes cannot be declared via YAML.

jonathan1055’s picture

Thank you very much larowlan for taking the time to explain. Yes, it makes sense that there had to be some way to define dynamic routes, I am learning new things about Drupal8 all the time. Having felt reasonably skilled at D7 it's now a whole new set of things to get my head around with 8.x.