How do you embed a video as one of the slides in slideshow on homepage

New Member
2 0 0

I already know what file to edit (index.liquid) but need the specific code to put in (including where the YouTube embed code goes).

 

Thanks!!

0 Likes
New Member
4 0 0

Hey Jessica, 

So what you need to do is to replace some of the code in the carousel.liquid snippet under your template editor and replace it with the embed code from YouTube. I found a really good example of how to do this further back in the forum here.

You can centre it by changing the height and width within the code to match the dimensions of the carousel. 

Here's a before:

  {% if settings.show_carousel_item_1 %}
        <li>
          {% if settings.carousel_item_1_link != empty %}
            {{ 'carousel-item-1.jpg' | asset_url | img_tag: settings.carousel_item_1_alt | link_to: settings.carousel_item_1_link }}
          {% else %}
            {{ 'carousel-item-1.jpg' | asset_url | img_tag: settings.carousel_item_1_alt }}
          {%endif%}
        </li>
        {% endif %}

and after you embed your video

 

   {% if settings.show_carousel_item_1 %}
        <li>
         <iframe width="700" height="300" src="http://www.youtube.com/embed/_OBlgSz8sSM" frameborder="0" allowfullscreen></iframe>
        </li>
        {% endif %}

hope that helps! 

 

 

0 Likes
Shopify Partner
9 0 0

Hello Jessica, you can add video with this app: https://apps.shopify.com/pluspage

0 Likes