Chris@0: {# Chris@0: /** Chris@0: * @file Chris@0: * Default theme implementation for a field. Chris@0: * Chris@0: * To override output, copy the "field.html.twig" from the templates directory Chris@0: * to your theme's directory and customize it, just like customizing other Chris@0: * Drupal templates such as page.html.twig or node.html.twig. Chris@0: * Chris@0: * Instead of overriding the theming for all fields, you can also just override Chris@0: * theming for a subset of fields using Chris@0: * @link themeable Theme hook suggestions. @endlink For example, Chris@0: * here are some theme hook suggestions that can be used for a field_foo field Chris@0: * on an article node type: Chris@0: * - field--node--field-foo--article.html.twig Chris@0: * - field--node--field-foo.html.twig Chris@0: * - field--node--article.html.twig Chris@0: * - field--field-foo.html.twig Chris@0: * - field--text-with-summary.html.twig Chris@0: * - field.html.twig Chris@0: * Chris@0: * Available variables: Chris@0: * - attributes: HTML attributes for the containing element. Chris@0: * - label_hidden: Whether to show the field label or not. Chris@0: * - title_attributes: HTML attributes for the title. Chris@0: * - label: The label for the field. Chris@0: * - multiple: TRUE if a field can contain multiple items. Chris@0: * - items: List of all the field items. Each item contains: Chris@0: * - attributes: List of HTML attributes for each item. Chris@0: * - content: The field item's content. Chris@0: * - entity_type: The entity type to which the field belongs. Chris@0: * - field_name: The name of the field. Chris@0: * - field_type: The type of the field. Chris@0: * - label_display: The display settings for the label. Chris@0: * Chris@0: * @see template_preprocess_field() Chris@0: * Chris@0: * @ingroup themeable Chris@0: */ Chris@0: #} Chris@17: {% Chris@17: set title_classes = [ Chris@17: label_display == 'visually_hidden' ? 'visually-hidden', Chris@17: ] Chris@17: %} Chris@0: Chris@0: {% if label_hidden %} Chris@0: {% if multiple %} Chris@0: