Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Bought Jack McDade's course on design. Going through it now...and it is SO well done!

— Justin Jackson, Transistor.fm

is_embeddable Modifier

Checks to see if a video URL is embeddable. In other words: YouTube or Vimeo URL are considered as embeddable.

Plays nicely with the Video fieldtype and the embed_url modifier.

youtube: https://www.youtube.com/watch?v=s9F5fhJQo34
vimeo: https://vimeo.com/22439234
other: http://example.com/video.mp4
{{ youtube | is_embeddable }}
{{ vimeo | is_embeddable }}
{{ other | is_embeddable }}
@if (Statamic::modify($youtube)->isEmbeddable()->fetch()) ... @endif
@if (Statamic::modify($vimeo)->isEmbeddable()->fetch()) ... @endif
@if (Statamic::modify($other)->isEmbeddable()->fetch()) ... @endif
true
true
false
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →