I'm trying to duplicate entries inside a macro, which will displays duplicated items inside a carousel.
It's not possible to merge Element Queries. Even if it's possible to merge IDs, merging an array of IDs will end up with non-duplicated entries.
This is how I duplicate entries:
{% set entries = entries | merge(entries) %}
After that, this is how I loop, and the resulting issue:
for entry in entries.all()
- → Twig error: Impossible to invoke a method ("all") on an array;
for entry in entries
- → deprecated warning: Looping through element queries directly has been deprecated. Use the all() function to fetch the query results before looping over them;
for entry in entries.all() ?? entries
orentry in entries ?? entries.all()
- → same warning as previous point;