Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
romainj CreditAttribution: romainj as a volunteer commentedI 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.
Comment #4
romainj CreditAttribution: romainj as a volunteer commentedFixed in the latest dev version.