{# area needs its own copy of the widget options as #} {# JSON, for adding new widgets #} {# Print attributes string from attrs object. Examples: attrs({ one: "1", two: true, three: false }) -> one="1" two attrs({ one: "1", two: true, three: false }, 'data-') -> data-one="1" data-two #} {%- macro _writeAttr(attrs, prefix = 'data-') -%} {%- for key, value in attrs -%} {{ " " }}{{ prefix + key }}={{ value | jsonAttribute({ single: true }) }} {%- endfor -%} {%- endmacro -%}
{%- for item in data.area.items -%} {%- set widgetOptions = data.options.widgets[item.type] or {} -%} {%- if data.options.widgetTemplate -%} {% include data.options.widgetTemplate %} {%- else -%} {%- if data.canEdit -%}
{%- endif -%} {% widget item, widgetOptions with data._with %} {%- if data.canEdit -%}
{%- endif -%} {% endif %} {%- endfor -%}