ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Adding video to an image gallery

April 16, 2012 8:13pm

Subscribe [2]
  • #1 / Apr 16, 2012 8:13pm

    Hello,
    I’m fairly new to using expression engine so forgive me for some of my newbie tendencies.
    I want to add a video into an image gallery and I’m not exactly sure how to make that work. Something like what is shown on this site: http://www.superdry.com/mens/chinos/details/34531/commodity-skinny-chino

    I have the videos on vimeo right now, which seems like less of a headache than hosting it myself. So this would most likely mean trying to embed the videos into the image gallery. Does anyone have an idea about how this could work?

    Many thanks.
    -Harrison

  • #2 / Apr 18, 2012 10:10pm

    Man With A Peg

    124 posts

    Hey Harrison,

    How are you storing the image gallery right now?

    I’ve done this in the past by using channel entries and a matrix field. The entry represented the gallery. The matrix field had fields for image, video, caption, &c. When I had a video, I did not put a picture in that row. When I had a picture, there was no video.

    Once that was set up, the code on the front used an {if} conditional to determine which to show. It only took ~30 lines of JavaScript to swap out images and videos on the fly like the superdry.com website does.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases