我想创建一个包含三列的图库,我使用了twig批量过滤器。是否可以添加if条件,以便列出所有禁用的图像?我的例子不起作用:
<table>
{% for items in content.galleries|batch(3) if items.enabled %}
<tr>
{% for cell in items %}
<td><img src="{{ asset(cell.image) }}"></td>
{% endfor %}
</tr>
{% endfor %}
</table>