How to combine Image and Video fields in a views slideshow in a single carousel? I have a content type called Cities and it has an Image field. Using the Views Slideshow module with jquery.cycle I am able to create a block which takes the Image from the content and creates a slideshow.

However I have a requirements to be able to add the videos also in the same slideshow. So, I added one more field in the content type as Videos field where I can post the Youtube video URL.

Now the Dilemma is to display this video also in the same slideshow as the image, so, the slideshow would continue with mixture of Images and Videos.

My question is how to combine these two fields image and videos in views slideshow, to create a single slideshow/carousel?
You should be able to simply add both fields.  To help matters along you should can add a bit of logic to only show one field if both are populated.  To do this follow these steps:


First decide which field to show if both have values, for the purposes of this example I'll say that it's video but reverse everything if you want it to be the image field.
Make sure you view has "Fields" selected next to "Show:"
Add the image field and tick "Exclude from display"
Add the video field
In the settings for the video field under "Rewrite results", click on "Rewrite the output of this field" and then on "Replacement patterns"
Copy the token that relates to your image field (including the surrounding [ and ])
untick "Rewrite the output of this field" and click "No results behavior"
Paste the token you copied (including the [ and ]) into the "No results text" box.
Save.


Then the view row will show the video unless there is no video in which case it will show the image.