function hook_admin_content_form_routes

Same name and namespace in other branches
  1. main core/themes/admin/admin.api.php \hook_admin_content_form_routes()

Register routes to apply admin’s content edit form layout.

Leverage this hook to achieve a consistent user interface layout on administrative edit forms, similar to the node edit forms. Any module providing a custom entity type or form mode may wish to implement this hook for their form routes. Note that not every content entity form route should enable the admin edit form layout, for example the delete entity form does not need it.

Return value

array An array of route names.

See also

Helper::isContentForm()

hook_admin_content_form_routes_alter()

Related topics

1 invocation of hook_admin_content_form_routes()
Helper::isContentForm in core/themes/admin/src/Helper.php
Check if we´re on a content edit form.

File

core/themes/admin/admin.api.php, line 29

Code

function hook_admin_content_form_routes() : array {
  return [
    // Layout a custom node form.
'entity.node.my_custom_form',
    // Layout a custom entity type edit form.
'entity.my_type.edit_form',
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.