Okay, I want to create a Matrix based layout like this:
| x | x | x |
| x | y |
| y | x |
X
is a 1/3 column and Y
is a 2/3 column.
I want to activate the size Y
with a lightswitch.
The problem is: If I have | x | x | y |
the layout will blow up because there are too many columns so when the column amount is 3/3 I want to create a new row so all is nice and tidy.
How do I solve this?
My idea was to add a number to each column and when the maximum number is reached, there will be a new row.
That code doesn't work. I just want to show the idea.
{% set x = 33.33 %}
{% set y = 66.66 %}
{% for block in entry.this %}
{% if x + y = 100 %}<div class="row">{% endif %}
{# content #}
{% if x + y = 100 %}</div>{% endif %}
{% endfor %}
If I can get all variables and add them up it should be possible. But how do I get the variables from each iteration.
Anybody know what I'm talking about? Other solutions?