From f1e12d3c6e019359ad192016eafdff041c7390fa Mon Sep 17 00:00:00 2001 From: Morten Nissen Date: Tue, 8 Jun 2021 14:52:31 +0200 Subject: [PATCH 1/3] Borger.dk --- ...article--os2web-borgerdk-article.html.twig | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig diff --git a/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig b/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig new file mode 100644 index 000000000..01657b6b1 --- /dev/null +++ b/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig @@ -0,0 +1,120 @@ +{# +/** + * @file + * Theme override for a field. + * + * To override output, copy the "field.html.twig" from the templates directory + * to your theme's directory and customize it, just like customizing other + * Drupal templates such as page.html.twig or node.html.twig. + * + * Instead of overriding the theming for all fields, you can also just override + * theming for a subset of fields using + * @link themeable Theme hook suggestions. @endlink For example, + * here are some theme hook suggestions that can be used for a field_foo field + * on an article node type: + * - field--node--field-foo--article.html.twig + * - field--node--field-foo.html.twig + * - field--node--article.html.twig + * - field--field-foo.html.twig + * - field--text-with-summary.html.twig + * - field.html.twig + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + * + * + * @see template_preprocess_field() + */ +#} +{% + set classes = [ + 'field', + 'field--name-' ~ field_name|clean_class, + 'field--type-' ~ field_type|clean_class, + 'field--label-' ~ label_display, +] +%} +{% + set title_classes = [ + 'field__label', + label_display == 'visually_hidden' ? 'visually-hidden', +] +%} + +{% if label_hidden %} + {% if multiple %} + + {% for item in items %} + + {{ item.content.pre_text }} + {{ item.content.article }} +
+ {{ item.content.selfservices }} +
+
    + {{ item.content.microarticles }} + {{ item.content.legislation }} + {{ item.content.recommendation }} +
+ {{ item.content.byline }} + {{ item.content.post_text }} + + {% endfor %} + + {% else %} + {% for item in items %} + + {{ item.content.pre_text }} + {{ item.content.article }} +
    + {{ item.content.microarticles }} + {{ item.content.legislation }} + {{ item.content.recommendation }} +
+
+ {{ item.content.selfservices }} +
+ {{ item.content.byline }} + {{ item.content.post_text }} + + {% endfor %} + {% endif %} +{% else %} + + {{ label }} + {% if multiple %} +
+ {% endif %} + {% for item in items %} + + {{ item.content.pre_text }} + {{ item.content.article }} +
    + {{ item.content.microarticles }} + {{ item.content.legislation }} + {{ item.content.recommendation }} +
+
+ {{ item.content.selfservices }} +
+ {{ item.content.byline }} + {{ item.content.post_text }} +
+ {% endfor %} + {% if multiple %} + + {% endif %} + +{% endif %} + From e7dd20557e4aa8e5104c38dbf0b6b65b2a48afd2 Mon Sep 17 00:00:00 2001 From: Morten Nissen Date: Tue, 8 Jun 2021 14:53:13 +0200 Subject: [PATCH 2/3] Borger.dk --- ...ld-os2web-bdk-article--os2web-borgerdk-article.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig b/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig index 01657b6b1..07a963940 100644 --- a/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig +++ b/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig @@ -77,14 +77,14 @@ {{ item.content.pre_text }} {{ item.content.article }} +
+ {{ item.content.selfservices }} +
    {{ item.content.microarticles }} {{ item.content.legislation }} {{ item.content.recommendation }}
-
- {{ item.content.selfservices }} -
{{ item.content.byline }} {{ item.content.post_text }} From bbbe9b95c80cfb9d7c910475cab40f20e7ccb458 Mon Sep 17 00:00:00 2001 From: Morten Nissen Date: Tue, 8 Jun 2021 14:59:48 +0200 Subject: [PATCH 3/3] Borger.dk --- ...ld-os2web-bdk-article--os2web-borgerdk-article.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig b/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig index 07a963940..1b1efad4a 100644 --- a/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig +++ b/web/themes/custom/fds_ballerup_theme/templates/borgerdk/field--paragraph--field-os2web-bdk-article--os2web-borgerdk-article.html.twig @@ -100,14 +100,14 @@ {{ item.content.pre_text }} {{ item.content.article }} +
+ {{ item.content.selfservices }} +
    {{ item.content.microarticles }} {{ item.content.legislation }} {{ item.content.recommendation }}
-
- {{ item.content.selfservices }} -
{{ item.content.byline }} {{ item.content.post_text }}