Drupal Views based slide shows with optional videos.
Tech Notes
This is for creating a slide show per node (not a slide show of nodes). IE a slideshow of all media attached to a particular node on that node.
Using the Media module in D7 we can include video from Youtube and Vimeo as well as local or remote images. Modules required
- Views (& dependencies)
- Media
- Media: Youtube
- Media: Vimeo
- jCarousel
- or Views slideshow (& submodules and libraries)
. Two very similar methods are outlined below. Note: you can achieve similar effects with modules like Field slideshow and Gallery formatter. .
1 jCarousel
- Create a content type (or use an existing one) that has a media or image field that permits more than one item (unlimited for example).
- Create an Image Style to suit the block (remembering that you can display more than one `slide` at a time). Note down the pixel dimensions.
- [Media module only] Edit a File Type Admin > Configuration > Media > File types
- Select Image.
- Manage display and select a display type (eg: preview) that hasn't been used (one day we will be able to create new types). Add the fields required (caption, title).
- Manage file display Select the same type (eg: preview) and select the image style created previously.
- Save and return to types, selecting Video.
- Manage display and select the same display type (eg: preview). Add the fields required (caption, title).
- Manage file display Select the same type (eg: preview) and check Vimeo video and Youtube video. For each video enter the same sizes you created for the Image style.
- Select Image.
- Create a test node with more than one media item and note down the node's NID.
- Create a new view with a block at Admin > Structure > Views.
- Show [content] of [your content type].
- Create a block (not a page).
- Display format [jCarousel] of [fields] (not content).
- Items per page [0] (unlimited).
- Save and continue.
- Format jCarousel [settings]
- Number of visible items [1 or more]
- Auto-scroll after [1 or more] seconds.
- Show field [settings]
- Field title [remove] the default field.
- Field > add [media / image]
- Don't display a label.
- MOST IMPORTANT: Multiple field settings DON'T display all values in the same row.
- Formatter [media] for media (not files).
- File view mode [preview or whatever you chose in #3.1.1 above] for media(not files).
- Advanced Contextual filter [add]
- Content: NID
- When the filter value is not available [provide a default] type [Content ID from URL
- Test the View by adding the NID of your test node to the Preview with contextual filters field.
- Add the newly minted block to the correct region in Admin > Structure > Blocks
- Include it only on relevant pages using the URL filter.
2 Views slideshow
Identical but enable views_slideshow and views_slideshow_[your type here]. And at #6 choose the other Slideshow format. Extra points.
Extra points I said.