I have an entity that has an items property that is an array of item entities. the item entity has id and name properties.
what I want to do is to get entity.items and display all name properties, separated by commas.
the way I have it now:
<tr>
<th>Items</th>
<td>
{% for item in entity.items %}
{{ item.name }}
{% endfor %}
</td>
</tr>
But it is not separated by commas. I tried the Join filter, but I can’t find a way to use it in this situation, since I have an array of objects.
You can combine twig syntax with regular HTML. The {%%} markup indicates tags, telling the twig that there’s some rendering logic, but you don’t need to write strictly twig syntax inside the tags. So:
will work just fine