Auto Entity Label Extension#
The eb_auto_entitylabel module adds automatic label generation support to Entity Builder bundle definitions.
Project Page: https://www.drupal.org/project/eb_auto_entitylabel
Features#
- Configure automatic entity labels in YAML
- Token-based label patterns
- Multiple status modes (enabled, optional, prefilled)
- Sync mode support
Requirements#
- Entity Builder (
eb) - Automatic Entity Label (
drupal/auto_entitylabel) - Token (
drupal/token)
Installation#
YAML Structure#
Add auto_entitylabel_status and auto_entitylabel_pattern to bundle definitions:
Status Modes#
| Status | Title Field | Behavior |
|---|---|---|
disabled |
Visible, required | Normal Drupal behavior |
enabled |
Hidden | Label auto-generated, users cannot edit |
optional |
Visible, optional | Users can enter or leave blank for auto |
prefilled |
Visible, prefilled | Auto-generated but editable |
Complete Example#
Common Patterns#
Date-Based Labels#
Reference-Based Labels#
Counter-Based Labels#
Operations#
| Operation | Description |
|---|---|
configure_auto_entitylabel |
Creates/updates auto_entitylabel configuration |
Change Detection#
In sync mode:
- Configuration created if missing
- Configuration updated if status or pattern changed
- Configuration skipped if unchanged
UI Integration#
When eb_ui is enabled, two columns appear in the Bundles tab:
- Auto Label Status: Dropdown with status options
- Auto Label Pattern: Text field for token pattern
Configuration Storage#
Auto entity label configuration is stored in Drupal config:
Example: auto_entitylabel.settings.node.event
Token Reference#
Common tokens for labels:
Node Tokens#
[node:nid]- Node ID[node:created:date:short]- Creation date[node:field_*]- Field values[node:field_*:entity:name]- Referenced entity name
Term Tokens#
[term:tid]- Term ID[term:vocabulary]- Vocabulary name
User Tokens#
[user:uid]- User ID[user:name]- Username
Troubleshooting#
Labels Not Generating#
- Verify status is not
disabled - Check pattern uses valid tokens
- Save content to trigger generation
Tokens Not Resolving#
- Check token syntax (square brackets)
- Verify referenced fields exist
- Ensure token module is enabled
- Check for typos in field names
Title Field Still Visible#
- For
enabledstatus: title should be hidden - Clear cache:
drush cr - Check form display settings