You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each row can have maximum of 2 columns, and if there is only one column a dummy one is added after nested foreach. So the code looks like this:
{foreach from=$data item='row'}
{foreach from=$row item='col'}
(insert column content)
{/foreach}
{if col@iteration == 1} // Also used total and index
(insert dummy column)
{/if}
{/foreach}
The problem does not occur when there is only one row and one column, dummy column is added. But if I have 3 items (2 rows, 1. has two columns and 2. has one) col@iteration is equal to two somehow, so dummy column is not added.
Changing if statement to {if $row|@count === 1} solves the problem so my guess is that there is something wrong with smarty after recent update (the current version we use is 3.1.30, the previous one was 3.1.27 end original if statement was working.
The text was updated successfully, but these errors were encountered:
Hi, I have a template file with nested
{foreach}
that creates a table that is filled with content:Each row can have maximum of 2 columns, and if there is only one column a dummy one is added after nested
foreach
. So the code looks like this:The problem does not occur when there is only one row and one column, dummy column is added. But if I have 3 items (2 rows, 1. has two columns and 2. has one)
col@iteration
is equal to two somehow, so dummy column is not added.Changing if statement to
{if $row|@count === 1}
solves the problem so my guess is that there is something wrong with smarty after recent update (the current version we use is3.1.30
, the previous one was3.1.27
end original if statement was working.The text was updated successfully, but these errors were encountered: