1 {% extends "base/file.php.twig" %}
4 {{ entity_name }}.page.inc{% endblock %}
7 * Page callback for {{ label }} entities.
11 use Drupal\Core\Render\Element;
14 {% block file_methods %}
16 * Prepares variables for {{ label }} templates.
18 * Default template: {{ entity_name }}.html.twig.
20 * @param array $variables
21 * An associative array containing:
22 * - elements: An associative array containing the user information and any
23 * - attributes: HTML attributes for the containing element.
25 function template_preprocess_{{ entity_name | machine_name }}(array &$variables) {
26 // Fetch {{ entity_class }} Entity Object.
27 ${{ entity_name | machine_name }} = $variables['elements']['#{{ entity_name }}'];
29 // Helpful $content variable for templates.
30 foreach (Element::children($variables['elements']) as $key) {
31 $variables['content'][$key] = $variables['elements'][$key];