From 01181f4b59cd5ac1135ddac8fbf91a2ea3322303 Mon Sep 17 00:00:00 2001 From: Jarek Jakubowski Date: Tue, 22 Jan 2019 12:36:46 +0100 Subject: [PATCH] fix single record view --- public/theme/skeleton/partials/_sub_fields.twig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/theme/skeleton/partials/_sub_fields.twig b/public/theme/skeleton/partials/_sub_fields.twig index 86dd80b9..62c58bd3 100644 --- a/public/theme/skeleton/partials/_sub_fields.twig +++ b/public/theme/skeleton/partials/_sub_fields.twig @@ -99,14 +99,12 @@ {% endfor %} {# We do the same for the templatefields, if set and not empty. #} - {% set templatefields = record.getValue('templateFields') %} - {% if templatefields is not empty %} - + {% if record.hasField('templateFields') %} {# Note: This needs to be expanded upon!! For better detection the 'virtual' content type for the templatefields should know about the types of fields. #} {% set templatefields_field_types = attribute(record.contentType.templatefields|first, 'fields') %} - {% for key, value in templatefields if (key not in omittedkeys) %} + {% for key, value in record.templateFields if (key not in omittedkeys) %} {% set fieldtype = attribute(attribute(templatefields_field_types, key), 'type') %} {{ block('common_fields') }}