glanceapp / glanceapp/community-widgets

Widget - football-league-table: No output in api.

Open
#224 2 comments 0 reactions 0 assignees View on GitHub
bug report
Dominant language
Go
Stars
872
Forks
175
Avg merge
6d 13h
Merged PRs (30d)
9

Description

### Widget link

https://github.com/glanceapp/community-widgets/blob/main/widgets/football-league-table/README.md

### Description

This api gives nothing. I have correct Token, but gives and error.

url: https://api.football-data.org/v4/competitions/BL1/standings

From log in Portainer:
2025/11/19 12:33:37 Config file changed, reloading...

2025/11/19 12:33:37 Config has errors: parsing variable: environment variable TEAM_ID not found

2025/11/19 12:34:13 Config has errors: parsing variable: environment variable TEAM_ID not found

Any help?

widgets:
- type: custom-api
title: League Table
cache: 30m
url: https://api.football-data.org/v4/competitions/BL1/standings
headers:
X-Auth-Token: xxxxxxxxxx
template: |


{{ $compName := .JSON.String "competition.name" }}
{{ $compName }}

{{ $standings := .JSON.Array "standings" }}
{{ if $standings }}
{{ $standing := index $standings 0 }}
{{ $table := $standing.Array "table" }}

#

Team

P

GD

Pts


{{ range $table }}
{{ $position := .Int "position" }}
{{ $team := .Get "team" }}
{{ $teamName := $team.String "shortName" }}
{{ $played := .Int "playedGames" }}
{{ $gd := .Int "goalDifference" }}
{{ $points := .Int "points" }}
{{ $teamId := $team.Int "id" }}

{{ $rowStyle := "padding: 4px 0;" }}
{{ $textStyle := "" }}
{{ if eq $teamId ${TEAM_ID} }}
{{ $rowStyle = "padding: 4px 0; background: rgba(255,255,255,0.05); border-left: 3px solid var(--color-highlight);" }}
{{ $textStyle = "font-weight: bold; color: var(--color-highlight);" }}
{{ end }}


{{ $position }}

{{ $teamName }}

{{ $played }}

{{ if gt $gd 0 }}+{{ end }}{{ $gd }}

{{ $points }}


{{ end }}
{{ else }}
Unable to load standings

{{ end }}

Contributor guide

Open the contributing guide

Research direction

Start with widgets/football-league-table/README.md and compare its configuration with the reported custom-api block, especially the ${TEAM_ID} reference. Check how the widget expects TEAM_ID to be supplied and verify the football-data.org standings request with the shown URL and token. Done means the configuration loads without the missing-environment-variable error and the widget renders standings.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.