{#------calculate values from template elements--------#} {% set ns = namespace(cols=1, rows=1) %} {% for i in range(24) %} {% if (uniquePathsAt(elements, i ~ "/*") | length) != 0 %} {% set ns.rows = i %} {% endif %} {% if (uniquePathsAt(elements, "*/" ~ i) | length) != 0 %} {% set ns.cols = i %} {% endif %} {% endfor %} {% set rows = ns.rows %} {% set cols = ns.cols %} {% for r in range(rows) %} {% set row = r + 1 %} {% if rows != 1 %} {% endif %} {% if row == rows %} {% endif %} {% endfor %} {% for c in range(cols) %} {% set col = c + 1 %} {% if cols != 1 %} {% endif %} {% if col == cols %} {% endif %} {% for r in range(rows) %} {% set row = r + 1 %} {% endfor %} {% endfor %}