From e732645d31d496eee5b929fc755846fa2abfc239 Mon Sep 17 00:00:00 2001 From: Bob den Otter Date: Thu, 20 Aug 2020 20:59:45 +0200 Subject: [PATCH] Add "Number" and "Date" fields --- templates/helpers/_field_blocks.twig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/templates/helpers/_field_blocks.twig b/templates/helpers/_field_blocks.twig index 94f728e8e..c276284f2 100644 --- a/templates/helpers/_field_blocks.twig +++ b/templates/helpers/_field_blocks.twig @@ -69,6 +69,19 @@ {{ field.value.responsive_inline|raw }} {% endif %} + {# Number fields #} + {% if type == "number" %} +

{{ field|label }}: {{ field }}

+ {% endif %} + + {# Date / Datetime fields #} + {% if type == "date" %} +

+ {{ field|label }}: {{ field|localedatetime("%A %B %e, %Y") }} + {%- if field.definition.mode == 'datetime' %}, {{ field|localedatetime("%H:%M:%S") }}{% endif %} +

+ {% endif %} + {# No special cases defined for other fieldtypes. We just output them if they're a simple scalar, and 'dump' them otherwise. #} {% if type not in allfields and field is not empty %}