PRO: List data and offer link to details
Your situation:
You have a API that gives you a list of dataitems (e. g. Sport-Ranking). The task is to display the dataitems and add a link to show more details.
Solution:
Create a Page with the list of the dataitems and have a HTML-Link to another page like
...<a href=/detailspage?pid=ID">link to details</a>...
...<a href=/detailspage?pid=ID">link to details</a>...
...<a href=/detailspage?pid=ID">link to details</a>...
Now create a page with URL /detailspage/ and have another JCI-shortcode with a 2nd JCI-Template on this page. In this JCI-Template have at urlparam4twig “pid” to register the parameter “pid”.
Then
{{urlparam.pid}}
{{urlparam.pid}}
{{urlparam.pid}}
is available in the 2nd JCI-Template.
Set the URL there:
http://api.snooker.org/?p={{urlparam.pid}}
http://api.snooker.org/?p={{urlparam.pid}}
http://api.snooker.org/?p={{urlparam.pid}}
By this the needed JSON is requested.