Include videos in your NationBuilder feature slider
Include videos from YouTube and Vimeo through NationBuilder’s standard slider tool.
Update your slider to support Youtube & Vimeo
We love using videos in feature content sliders for our clients’ sites and decided we would share the way we include videos from YouTube and Vimeo through NationBuilder’s standard slider tool. Our improved
_features.html makes it easy to add a great looking video modal. Want to have a mix of images that trigger videos and other images that link to pages? No problems!
(this is a modified version of the excellent Responsive plugin)
The standard NationBuilder feature slider doesn’t support videos:
Download these 3 files and save the two images below. Upload them all to your theme.
theme.scss file of your custom theme and include the
_feature_video_styles.scss partial directly below the existing
@import statements, using the line below:
If you are using YouTube, then add the label of the featured content slider as
youtube | [ID]. For Vimeo set the label to
vimeo | [ID]. In either case make sure to replace the
[ID] element with the value for your chosen video. The ID of a youtube video can be found in the URL following
watch?v=. The video ID is also containd in each Vimeo URL, directly following
vimeo.com/. You can see an example label for a YouTube video in the screenshot below:
Finally, upload the image you wish to accompany your video. This will display in the slider as usual. The video will appear and autoplay in a responsive popup modal when the image is clicked. If you are using YouTube a useful shortcut to find a possible video thumbnail is to add the video ID to the following link instead of the word “HERE”:
Have any questions? We're always happy to help
Get in touch on email: email@example.com