This page demonstrates the Widget Page template. It lets an editor add a YouTube video or supported external widget by filling in simple fields in the Admin panel.

The editor does not need to write iframe code or HTML. Paste the normal sharing link and the template builds the embedded player.

What This Template Can Show

The Widget Page template currently supports:

  • YouTube videos.
  • Elfsight calendar widgets.
  • Introductory page text above the widget.

YouTube Fields

Use these fields for a YouTube video:

Field What to enter
Widget type Choose YouTube Video.
YouTube video link Paste the normal YouTube link. Short links, watch links, and embed links are supported.
YouTube video title Enter a plain title for screen readers and browser accessibility.
Video height Use 450 for standard videos, 500 to 550 for training videos, or 600 for a large feature video.
Introductory text Add normal page text above the video. Markdown is fine.

Supported YouTube link formats include:

  • https://youtu.be/IeT7rRn42KQ
  • https://www.youtube.com/watch?v=IeT7rRn42KQ
  • https://www.youtube.com/embed/IeT7rRn42KQ

Elfsight Calendar Fields

Use these fields for an Elfsight calendar:

Field What to enter
Widget type Choose Elfsight Calendar.
Elfsight App ID Paste the app ID from Elfsight.
Introductory text Add normal page text above the calendar.

The shared Elfsight platform script is loaded by the theme, so editors only need the app ID.

How This Page Works

The template reads the page front matter and chooses what to render:

  • widget_provider: youtube renders a YouTube iframe.
  • youtube_url is converted into a YouTube video ID when possible.
  • youtube_id can also be used directly if a video ID is already known.
  • youtube_title becomes the iframe title.
  • youtube_height controls the player height.
  • widget_provider: elfsight_calendar renders an Elfsight widget using widget_app_id.

If the required link or app ID is missing, the page shows a configuration message instead of a broken embed.

Good Editing Practice

  • Use the video title from YouTube or a clear plain-English title.
  • Add one or two lines of context above the video so members know why it is there.
  • Avoid uploading video files to Grav; use YouTube or another external video host.
  • Test the page after saving, especially if the video is unlisted or has embedding disabled.