function OverridesSectionStorage::buildLocalTasks
Provides the local tasks dynamically for Layout Builder plugins.
Parameters
mixed $base_plugin_definition: The definition of the base plugin.
Return value
array An array of full derivative definitions keyed on derivative ID.
Overrides SectionStorageLocalTaskProviderInterface::buildLocalTasks
File
- 
              core/
modules/ layout_builder/ src/ Plugin/ SectionStorage/ OverridesSectionStorage.php, line 279  
Class
- OverridesSectionStorage
 - Defines the 'overrides' section storage type.
 
Namespace
Drupal\layout_builder\Plugin\SectionStorageCode
public function buildLocalTasks($base_plugin_definition) {
  $local_tasks = [];
  foreach ($this->getEntityTypes() as $entity_type_id => $entity_type) {
    $local_tasks["layout_builder.overrides.{$entity_type_id}.view"] = $base_plugin_definition + [
      'route_name' => "layout_builder.overrides.{$entity_type_id}.view",
      'weight' => 15,
      'title' => $this->t('Layout'),
      'base_route' => "entity.{$entity_type_id}.canonical",
      'cache_contexts' => [
        'layout_builder_is_active:' . $entity_type_id,
      ],
    ];
  }
  return $local_tasks;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.