Skip to content

Create a video list shortcode to render playlists

Blocks eclipsefdn/it/websites/sdv.eclipse.org#28

We already have a shortcode under ECDTools which fetches the latest video from an array of playlists and renders it. This can be modified into a shortcode which can do the following:

  • Render a list of videos from an array of playlist Ids
  • Specify how many videos to render
  • Toggle pagination (a view more button)
  • Ability to choose a template

Idea for the shortcode signature

Rendering the latest video from an array of playlists (this will be a sorted list, and we are showing 1 video with show)

{{< video-list show="1" paginate="false" templateId="tpl-ecdtools-latest" playlistIds="FHJ9df7Ak, JIFd894fJ, KF89fbjka" >}}

Rendering 5 videos from one playlist with a "View More" button displayed

{{< video-list show="5" playlistIds="Pfad9FfDSN" >}}

Params

  • show - control how many videos are rendered per page
  • paginate - renders view more button
  • playlistIds - comma separated playlist ids
  • templateId - specify mustache template
Edited by Olivier Goulet