This Wordpress plugin is used to connect to the Sportlink API. It is used to show the fixtures, results and standings of a club, or show details of a match.
This Wordpress plugin is used to connect to the Sportlink API.
This Wordpress plugin is currently not available in the Wordpress plugin repository. To install it, download the zip file and upload it to your Wordpress installation.
After installing the plugin, you need to configure it. Go to the settings page of the plugin (under Settings -> Sportlink - KNVB) and fill in the following fields:
The plugin uses shortcodes to display the data. The following shortcodes are available:
[sportlink type="programma"]
: Shows the fixtures of the club[sportlink type="uitslagen"]
: Shows the results of the club[sportlink type="stand" poule="1234"]
: Shows the standings of the club[sportlink type="wedstrijd"]
: Shows the details of a match. The Match ID is grabbed from the URL: $_GET['wedstrijd']
The plugin uses templates to display the data. The templates are located in the templates
folder of the plugin. You can override the templates by copying them to your theme folder.
Shortcode | Template | Available data |
---|---|---|
[sportlink type="programma"] |
templates/fixtures.php |
$data->fixtures |
[sportlink type="uitslagen"] |
templates/results.php |
$data->results |
[sportlink type="stand" poule="1234"] |
templates/standings.php |
$data->standings |
[sportlink type="wedstrijd"] |
templates/match.php |
$data->match : [ wedstrijd-informatie , history , poule , teams ] |
The default templates are very basic and should be used as examples. You can override them by copying the default templates from the templates
folder of the plugin to your (child) theme in a folder called sportlink-knvb
.
In addition to overriding the default templates, you can also modify the template from the shortcode. This is done by adding the template
attribute to the shortcode. For example:
[sportlink type="programma" template="small"]
This will use the templates/fixtures-small.php
template.
The templates are written in PHP. This means you can use PHP functions and variables in the templates. The $data
variable contains the data from the API. You can use this data to display the information you want.
An example of a template with a bit more logic can be found in the templates/match.php
template.
The data from the API is available in the $data
variable. The available data can be found in the 'Available data' column in the table above
There is no team logo available in the API. You can use the following code to get the team logo from the voetbal.nl logo API (replace {clubcode}
with the correct club code):
<img src="https://logoapi.voetbal.nl/logo.php?clubcode={clubcode}">
The following attributes are available for the shortcodes:
Attribute | Description | Default |
---|---|---|
type | The type of data to show. Can be programma , uitslagen , stand or wedstrijd |
programma |
template | The template to use. See the 'Templates' section for more information | |
team | The teamcode of the team to show. Only used for the programma and uitslagen |
|
aantaldagen | The number of days to show. Only used for the programma and uitslagen |
Fixtures: 13 , Team: 365 |
aantalwekenvooruit | The week offset. Only used for the programma and uitslagen |
0 |
poule | The poule ID. Only used for the stand |
This plugin is not actively maintained and is provided as-is.
Support for this plugin is very limited. If you have any questions, please file an issue on Github.
2024-01-19
2017-03-03