I have a custom coded email template that is using a choice field to display up to 10 unique blogs (each contains an image, title, leadin & link). I have a divider line running inbetween each loop to seperate the blogs.
Is there a way to add a boolean to be able to hide the divider line just on the last loop without having to build a custom module? Right now if I add the boolean around the divider, it show/hides all of the divider lines.
So I'll often run code in a loop every time except for the last by doing something like this:
{% if not loop.last %}
{# code to run every time except for last #}
{% endif %}
But in your case it looks like you're limiting your loop by checking the loop index against widget_data.repeats1.value. Could you then wrap your bottom nested table inside a condition that checks for 1 less than widget_data.repeats1.value ? So that condition would look like this:
{% if loop.index < (widget_data.repeats1.value - 1) %}
{# divider line #}
{% endif %}
I think that's right, but let me know if you have any questions about it.