Hi,
I would like to display an image gallery using a shortcode from my theme (=> [vc_images_carousel images="ID1,ID2,..."] => the Ids separate with commas)
For that, I have to retrieve the IDS of my custom field image_upload.
Unfortunately, I can't store IDs in my array medias_ids.
I believe there is a problem when I try to store the ID of each image in my media variable.
Can you help me please ?
Here is my view code :
{% if post.image_upload %}
{% set medias_ids = [] %}
{% for item in post.image_upload %}
{{ item.thumbnail.ID }}
{% set media = item.thumbnail.ID %}
{% if media %}{% set medias_ids = medias_ids|merge([media.ID]) %}{% endif %}
{% endfor %}
{% endif %}
[vc_row]
[vc_column]
[vc_images_carousel images="{{ medias_ids|join(',') }}"]
[/vc_column]
[/vc_row]