5 * Provides {{ entity_type_label|article|lower }} entity type.
8 use Drupal\Core\Render\Element;
11 * Implements hook_theme().
13 function {{ machine_name }}_theme() {
15 '{{ entity_type_id }}' => [
16 'render element' => 'elements',
22 * Prepares variables for {{ entity_type_label|lower }} templates.
24 * Default template: {{ template_name }}.
26 * @param array $variables
27 * An associative array containing:
28 * - elements: An associative array containing the {{ entity_type_label|lower }} information and any
29 * fields attached to the entity.
30 * - attributes: HTML attributes for the containing element.
32 function template_preprocess_{{ entity_type_id }}(array &$variables) {
33 foreach (Element::children($variables['elements']) as $key) {
34 $variables['content'][$key] = $variables['elements'][$key];