Can one media item show either video from Youtube Or image from website?

Hi,

Great question!

You can configure the logic with code in many ways, but I would recommend the following:

Step 1 - The Design
Add both the image container and video container on top of each other. Collapse both of them

Step 2 - The Collection
Set the collection columns to include a column for “Media type”, the field values could be “image”/“video”.

Connect the repeater to data

Step 3 - The Code
Use forEachItem( ) to run a function on all items where we check what “Media Type” is assigned and we use this to expand the required media.

Let us know if you have any questions.
Thanks