At the moment, Admin Toolbar shows submenus for node types and their fields, and also for taxonomy. However, any entity types provided by contrib modules or custom code don't get this. That's quite a severe limitation.

The problem is that the submenus for the entities that have them come from hardcoded values:

  $content_entities = array(
    "block_content" => array(
      "content_entity" => "block_content",
      "config_entity" => "block_content_type"
    ),
    "comment" => array(
      "content_entity" => "comment",
      "config_entity" => "comment_type"
    ),
    "contact" => array(
      "content_entity" => "contact_message",
      "config_entity" => "contact_form"
    ),
    "node" => array("content_entity" => "node", "config_entity" => "node_type"),
    "taxonomy" => array(
      "content_entity" => "taxonomy_term",
      "config_entity" => "taxonomy_vocabulary"
    ),
  );
  // Add  common links to entities.
  // The common links for entities are :
  // - Editing entity, Deleting entity,manage fields for entity
  //, manage form display for an entity, entity view display and others links relating to entity
  foreach ($content_entities as $module_name => $entities) {
    $config_entity = $entities['config_entity'];
    $content_entity = $entities['content_entity'];

Instead of hardcoding these types, they should be obtained from entity info dynamically.

Comments

joachim created an issue. See original summary.

romainj’s picture

I agree and will try to find a solution. The main problem is that not all content entities are fieldable so for example we do not have to provide those field specific menu links for menu entity.

  • romainj committed ec6af02 on 8.x-1.x
    Issue #2723381 by joachim, romainj: fieldable content entities are no...
romainj’s picture

Status: Active » Fixed

Fixed in the latest dev version.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.