Change record status: 
Project: 
Introduced in branch: 
8.2.x
Description: 

Custom entity types will be automatically provided with a collection route given the following circumstances:

  1. They provide a collection link
  2. They provide a list builder
  3. They provide an administrative permission
  4. They use or extend core's DefaultHtmlRouteProvider as a route provider

The following excerpt of an example entity type annotation satisfies all the conditions, for example:

/**
 * @ContentEntityType(
 *   ...
 *   label = @Translation("Awesome thingy"),
 *   handlers = {
 *     "list_builder" = "Drupal\Core\Entity\EntityListBuilder",
 *     "route_provider" = {
 *       "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
 *     },
 *   },
 *   admin_permission = "administer my awesome entities",
 *   links = {
 *     "collection" = "/admin/structure/awesomesauce",
 *     ...
 *   },
 * )
 */

Note that routes with route names of the form entity.$entity_type_id.collection will not be overridden if they are provided in a *.routing.yml file, for example, even if all of the conditions above are met.

Impacts: 
Module developers