From 1f495bc39a4cc6d3a241f55072b919b91f9dc16f Mon Sep 17 00:00:00 2001 From: Ruud Denivel Date: Thu, 7 Aug 2014 11:41:33 +0200 Subject: [PATCH] allow to render specific parts of a subentity --- Resources/views/Default/export.csv.twig | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Resources/views/Default/export.csv.twig b/Resources/views/Default/export.csv.twig index bf4e9b5..e870188 100644 --- a/Resources/views/Default/export.csv.twig +++ b/Resources/views/Default/export.csv.twig @@ -1,7 +1,7 @@ {% set quote = '"' %} {%- for column in adminlist.exportColumns -%} - {{- quote|raw -}}{{- column.header | trans -}}{{- quote|raw -}} - {%- if not loop.last -%},{%- endif -%} +{{- quote|raw -}}{{- column.header | trans -}}{{- quote|raw -}} +{%- if not loop.last -%},{%- endif -%} {%- endfor -%} {% for item in iterator %} {% if item[0] is defined %} @@ -11,18 +11,13 @@ {% endif %} {% for column in adminlist.exportColumns -%} - {%- set columnName = column.name -%} - {%- set template = column.template -%} - {{- quote|raw -}}{{- adminlist.getStringValue(item, columnName) -}}{{- quote|raw -}} - {%- if not loop.last -%},{%- endif -%} - {#- - {% spaceless %} - {% if template is not null %} - {% include template with {'row': item, 'columnName': columnName, 'object': adminlist.getValue(item, columnName)} %}, - {% else %} - {{- quote|raw -}}{{adminlist.getStringValue(item, columnName)}}{{- quote|raw -}}, - {% endif %} - {% endspaceless %} - -#} +{%- set columnName = column.name -%} +{%- set template = column.template -%} +{% if template is not null and template != 1 and template != "" %} +{% include template with {'row': item, 'columnName': columnName, 'object': adminlist.getValue(item, columnName)} %} +{% else %} +{{- quote|raw -}}{{- adminlist.getStringValue(item, columnName) -}}{{- quote|raw -}} +{% endif %} +{%- if not loop.last -%},{%- endif -%} {%- endfor -%} {% endfor %}