Call to Action - Button over a Custom Liquid video?

Hi,

I have a custom liquid section that displays a video on my landing page. I was wondering if it was possible to add a “call to action” button (to send people to my shop) that overlays the video? The code I have so far is:-

<style>
  video {
    display: block;
    margin: 0 auto;
    width: 97%;
    height: 50%;
  }

  @media screen and (max-width: 767px) {
    video {
      display: none;
    }
  }
</style>

<!-- Video section will be hidden on mobile devices -->
<video autoplay loop playsinline muted>
  <source src="https://cdn.shopify.com/videos/c/o/v/dfc57cbdaa394a368dd633a60a1c9615.mp4">
</video>

Using Dawn Theme 11 and my URL is https://www.snowdoniahoney.com (no password)

Apologies for the basic question but just learning my way around Shopify.

Best regards

Alun

Hi @Alun

You can use this code to do that. o


	
	Open website
	
	

Please add URL that you want to open in href element of button code

That’s amazing Dan! Thanks so much

Just a further thought - rather than moving to a different page, could the button move the viewer to different “coordinates”/section on the same page?

You can do that by adding Id of section that you want to move in href element

Sorry! I’m sure I’m being numb here but I’ve been trying to find out a way to this without success. I’m assuming that instead of sending the click of the button I created to the video file, it needs to reference the section that you want to jump to so it’s at the top of the page?

multicolumn color-scheme-83ad98f1-5d87-469d-8257-b59fa0f1f3c6 gradient background-none

    

      
# 
                **Welsh Wildflower Honey & Welsh Heather Honey** 
              

    

  

Do I use the “rich-text__wrapper” element and then change the button to reference that element??

Please add this to href element of button #shopify-section-template–19592360198454__df329a39-baec-4186-82b2-b20f9fb17e73

That’s amazing @Dan-From-Ryviu ! Thanks for your help - I hope you like coffee? :wink:

I love it. Thank you and have a great day ahead.

For my own learning, could I ask why you get the string "

#shopify-section-template–19592360198454__df329a39-baec-4186-82b2-b20f9fb17e73" from that goes into the button element?? How do you know what to leave out?

You can find section ID when view source of page

Great - thanks!

Very welcome

this worked but i want the video to fill the page how would i do that?

Thank you, it works better than anything I tried. Only, how can I make it work on mobile devices also?

Hi! I would like to use this to add a CTA button to my home page video. I want it to link to a collection or landing page elsewhere on the site. How do I do that? I am also sorry if I’m being dumb here :wink:

Hi @laurenahertex

Please create a Custom Liquid section on your homepage in Sales channels > Online Store > Themes > Customize, replace Add your site URL here in the code with the page link you want the button to open.

Hi, I don’t have the option to ‘replace Add your site URL herein the code with the page link you want the button to open.’ I only see the attached when I add a new section:

Go to your store admin > Sales channels > Online store > Themes > Customize > click + Add section > Custom Liquid, add above code which marked as solution, and add your link

ok amazing, that worked :slightly_smiling_face:

next question: how do I create a button? at the moment it’s just text and it’s not in keeping with our brand. So can it be made to look the same as our other CTA buttons? Pls see attached screen shots - if possible I’d love to have the white CTA button?