Skip to content

Instantly share code, notes, and snippets.

@bartholomej
Last active December 1, 2022 14:53
Show Gist options
  • Save bartholomej/762d66a3494d49f193ba to your computer and use it in GitHub Desktop.
Save bartholomej/762d66a3494d49f193ba to your computer and use it in GitHub Desktop.
MODx: How to grab, cache and crop YouTube thumbnails

Simple MODx way how to grab YouTube thumbnails and cache.

Requirements

Features

  • MODx caching
  • Zoom Crop to avoid black bars (16:9)
<a href="http://youtu.be/[[getPlaceholder? &id=`[[+parent]]` &placeholder=`tv.video`]]" target="_blank">
<img src="[[!pthumb? &input=`http://img.youtube.com/vi/[[getPlaceholder? &id=`[[+parent]]` &placeholder=`tv.video`]]/0.jpg` &options=`&w=480&h=270&zc=1`]]">
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment