Remove YouTube Recommended Videos

Jeff do you mean you’re adding the videos as part of posts of a CMS collection?

Edit ok I saw your site so you have a video field in your collection:

http://vincent.polenordstudio.fr/snap/xohy2.jpg

I’ll describe how to switch from a video field to a text field using a custom code widget, step by step. Easy and you’ll see, interesting. I unfortunately can’t do this on your site because I can’t add fields on a read only site.


Let’s add a TEXT field for the video ID, you’ll be able to remove the video field once the job s finished. For your site, you’re using both Youtube and Vimeo videos, so let’s add 2 fields, because the custom code isn’t the same for YT and Vimeo so we need to address that. One text field for YT ID and one for Vimeo ID.

http://vincent.polenordstudio.fr/snap/21vhg.jpg

Now I’m going to create 2 records (posts), one with a YT ID of one of your videos, one with a Vimeo ID of one of your videos.

YT video:

http://vincent.polenordstudio.fr/snap/3a6t6.jpg

So we copy the ID and paste it in a record of the video collection

http://vincent.polenordstudio.fr/snap/ne4j8.jpg

Vimeo Video:

Same thing, locate and copy the ID

http://vincent.polenordstudio.fr/snap/h2427.jpg

and paste it in a record

http://vincent.polenordstudio.fr/snap/pvxz3.jpg

We have our two records now

http://vincent.polenordstudio.fr/snap/qt3zq.jpg

On your site, you are using the videos on the Video template page, let’s do the same. Let’s go to the Video template a create a quick structure and save room for the video

http://vincent.polenordstudio.fr/snap/raghz.jpg

Let’s deal with the Youtube video first. Instead of dragging a video widget, let’s drag a custom code widget

http://vincent.polenordstudio.fr/snap/gqpig.jpg

http://vincent.polenordstudio.fr/snap/9rtae.jpg

Now let’s go to Youtube to generate the code we need.

http://vincent.polenordstudio.fr/snap/tasv0.jpg

http://vincent.polenordstudio.fr/snap/e54o0.jpg

http://vincent.polenordstudio.fr/snap/zjjvq.jpg

Then copy the code

http://vincent.polenordstudio.fr/snap/usdju.jpg

And back to Webflow, paste the code in the custom code widget box

http://vincent.polenordstudio.fr/snap/fevm2.jpg

Now, we’re going to make that code DYNAMIC so it always show the video of the post we’re on. For that we’re going to select the video ID in the code

http://vincent.polenordstudio.fr/snap/w0ype.jpg

then we’re going to click on ADD FIELD and link that piece of code to our Youtube Video ID from our collection

http://vincent.polenordstudio.fr/snap/a068v.jpg

Now it looks like that and… it works already!

http://vincent.polenordstudio.fr/snap/swc1c.jpg

Be sure to be on the YT page, right?

http://vincent.polenordstudio.fr/snap/mci96.jpg

OK there are dimensions in the code so let’s address this:

http://vincent.polenordstudio.fr/snap/pri5d.jpg

Put the desired dimensions, height must be in pixels.

Vimeo now. Add another custom code in the same page, yes you’ll have 2 videos in the page, for the moment.

http://vincent.polenordstudio.fr/snap/0ixx6.jpg

At Vimeos, click on share

http://vincent.polenordstudio.fr/snap/k755s.jpg

http://vincent.polenordstudio.fr/snap/8j2jm.jpg

then link to collection the same way

http://vincent.polenordstudio.fr/snap/l9icu.jpg

then it works when you’re on the vimeo video page

Now let’s tell the YT video to display only when the YT ID is set, and the same for Vimeo video

http://vincent.polenordstudio.fr/snap/e1osh.jpg

http://vincent.polenordstudio.fr/snap/kkboj.jpg

Et voilà. Sorry it’s long but I just love to draw green arrows.

7 Likes