Skip to main content
Templates define how your EPG content looks — the titles, descriptions, and artwork for every programme in your guide. A single template can be reused across multiple teams or event groups.

What templates do

When Teamarr generates EPG, it uses templates to produce XMLTV programme entries. Each template specifies:
  • Title, subtitle, and description formats using variables like {team_name}, {opponent}, {game_time}
  • Artwork URL for programme thumbnails
  • Filler content for pregame, postgame, and idle periods (team templates)
  • Conditional logic to vary descriptions based on game context
  • XMLTV metadata such as categories and broadcast flags

Team templates vs event templates

Choose the template type based on which EPG workflow you are using. The type cannot be changed after creation.
Team templates are for persistent channels dedicated to a single team.
  • The channel exists 24/7 regardless of whether a game is scheduled
  • Content is written from the team’s perspective: {team_name} is always your team, {opponent} is always the other side
  • Supports .next and .last suffixes for referencing upcoming and previous games
  • Filler content (pregame, postgame, idle) keeps the channel populated when no game is live
  • Assigned directly to teams on the Teams page
Best for: Detroit Lions channel, LA Lakers channel, regional sports network style setups.Variable context available:
ContextSuffixExample variableUse case
Current game(none){opponent}Live programme during a game
Next game.next{opponent.next}Pregame and idle content
Last game.last{opponent.last}Postgame recaps

Use team templates when

You want dedicated 24/7 channels for specific teams and need filler content, .next/.last context, and team-perspective descriptions.

Use event templates when

Your IPTV provider has game-specific streams and channels should appear and disappear with live events.

Template form tabs

The template editor is organized into five tabs:
TabPurpose
Basic InfoTemplate name and event duration settings
DefaultsTitle, subtitle, description(s), artwork URL, and channel name/logo (event templates only)
ConditionsPriority-based rules that substitute a different description based on game context (team templates only)
FillersPregame, postgame, and idle programmes with their own title/description/artwork (team templates only)
Other EPG OptionsXMLTV categories, tags (new/live/date), and video quality metadata

Variables

Templates use variables in curly braces that are replaced with real data at generation time:
{team_name} vs {opponent} at {venue}
→ "Detroit Lions vs Chicago Bears at Ford Field"
{away_team} @ {home_team} — {game_time}
→ "Buffalo Bills @ Miami Dolphins — 1:00 PM ET"
Next up: {opponent.next} on {game_date.next}
→ "Next up: Green Bay Packers on Sun Dec 1"
{team_name} {result_text.last} the {opponent.last} {final_score.last}
→ "Detroit Lions defeated the Chicago Bears 24-17"
The full list of 194 variables across 17 categories is available in the Variables reference. Variables cover game details, team records, venue, broadcast, odds, standings, and more.

Filler content

Team templates support three types of filler to keep channels populated when no live game is running:
FillerWhen it shows
PregameThe configurable window of hours before the game starts
PostgameAfter the game ends until midnight (or until the next programme)
IdleDays when no game is scheduled at all
Each filler has its own title, subtitle, description, and artwork URL. Filler content supports the same variables as the main programme, including .next and .last suffixes. Example idle description:
No game today. Next: {game_date.next} vs {opponent.next} at {venue.next}
→ "No game today. Next: Sun Dec 1 vs Green Bay Packers at Ford Field"

Conditions system

Conditions let team templates show different descriptions based on what is happening around the game. Instead of a single static description, you define multiple options each with a priority and a trigger. Teamarr evaluates all conditions and selects the highest-priority match (lowest number wins). If multiple conditions match at the same priority, one is chosen at random — useful for variety. Priority ranges:
PriorityPurpose
1–49High-priority conditions (rare situations like playoffs)
50–99Normal conditions (home/away, streaks, broadcast)
100Default fallback — always matches
Available condition types:
is_home — team is playing at homeis_away — team is playing on the road
{"condition": "is_home", "priority": 50, "template": "{team_name} hosts {opponent} at {venue}"}
{"condition": "is_away", "priority": 50, "template": "{team_name} travels to face {opponent}"}
win_streak — team is on a winning streak of at least N gamesloss_streak — team is on a losing streak of at least N games
{"condition": "win_streak", "condition_value": "5", "priority": 10, "template": "{team_name} riding a {win_streak}-game win streak!"}
{"condition": "loss_streak", "condition_value": "3", "priority": 20, "template": "{team_name} looking to snap a {loss_streak}-game skid"}
is_ranked — team is ranked (top 25)is_ranked_opponent — opponent is ranked (top 25)is_ranked_matchup — both teams are rankedis_top_ten_matchup — both teams are in the top 10
{"condition": "is_top_ten_matchup", "priority": 5, "template": "Top 10 showdown! {team_rank_display} {team_name} vs {opponent_rank_display} {opponent}"}
{"condition": "is_ranked_matchup", "priority": 15, "template": "Ranked matchup: {team_rank_display} {team_name} vs {opponent_rank_display} {opponent}"}
is_playoff — postseason gameis_preseason — preseason or exhibition game
{"condition": "is_playoff", "priority": 5, "template": "PLAYOFF: {team_name} vs {opponent}"}
{"condition": "is_preseason", "priority": 50, "template": "Preseason: {team_name} vs {opponent}"}
is_conference_game — both teams are in the same conference (college)is_national_broadcast — game is on ABC, CBS, NBC, FOX, ESPN, TNT, or TBShas_odds — betting odds are availableopponent_name_contains — opponent name contains a specific string (case-insensitive)
{"condition": "is_national_broadcast", "priority": 60, "template": "{team_name} vs {opponent} on {broadcast_network}"}
{"condition": "has_odds", "priority": 70, "template": "{team_name} ({odds_spread}) vs {opponent}. O/U: {odds_over_under}"}
{"condition": "opponent_name_contains", "condition_value": "Packers", "priority": 20, "template": "Rivalry game: {team_name} vs {opponent}"}
Always include at least one condition at priority 100 as a default fallback. Without a default, events that match no conditions will produce an empty description.

Template assignments

For team templates

Assign a team template directly on the Teams page. Click the template dropdown in a team’s row, or select multiple teams and bulk-assign.

For event templates

Event template assignment uses a priority-based subscription system configured in Event Groups > Global Defaults > Template Assignments:
Rule specificityExamplePriority
League-specificNHL, AHL → “NHL Premium” templateHighest
Sport-specificSoccer → “Soccer HD” templateMid
Default (no sport/league)Everything else → “Default” templateLowest
The most specific rule wins. An individual event group can also set a per-group template override that takes absolute priority over all subscription rules. Example resolution: For an AHL event:
  1. Is there a league-specific rule for AHL? Yes — use “NHL Premium”.
For a Premier League event:
  1. Is there a league rule for Premier League? No.
  2. Is there a sport rule for Soccer? Yes — use “Soccer HD”.
For an MLB event:
  1. Is there a league rule for MLB? No.
  2. Is there a sport rule for Baseball? No.
  3. Use the default template.

Real examples

A complete conditions set for an NFL team template:
[
  {"condition": "is_playoff", "priority": 5, "template": "PLAYOFF: {team_name} vs {opponent}"},
  {"condition": "win_streak", "condition_value": "5", "priority": 15, "template": "{team_name} riding a {win_streak}-game win streak vs {opponent}"},
  {"condition": "is_national_broadcast", "priority": 60, "template": "{team_name} vs {opponent} on {broadcast_network}"},
  {"condition": "is_home", "priority": 70, "template": "{team_name} hosts {opponent} at {venue}"},
  {"condition": "is_away", "priority": 70, "template": "{team_name} travels to face {opponent}"},
  {"priority": 100, "template": "{team_name} vs {opponent}"}
]
Idle filler description:
No game today. Next up: {game_date.next} vs {opponent.next} at {venue.next}
Pregame filler description:
Coming up: {team_name} vs {opponent.next} — {game_time.next} at {venue.next}
Postgame filler description:
{team_name} {result_text.last} the {opponent.last} {final_score.last}
An event template for MMA programming:Title:
{event_title} - {card_segment_display}
Description:
{matchup}. Main card at {main_card_time}. {bout_count} total bouts.
Because UFC streams use fighter names rather than team names, configure the Fighters custom regex extractor on the event group so the classifier correctly identifies both fighters.
The community has contributed production-ready templates designed to match real Gracenote EPG formatting as closely as possible, with dynamic artwork via Game Thumbs.These templates include:
  • Gracenote-accurate title and description formats
  • Dynamic matchup thumbnails showing team logos, scores, and broadcast badges
  • Full filler content for pregame, postgame, and idle periods
To use them, download the JSON file, replace <game-thumbs-base-url> with your Game Thumbs instance URL, then go to Templates > Import and select the file.

Build docs developers (and LLMs) love