Print

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>...

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}}

is available in the 2nd JCI-Template.
Set the URL there:

http://api.snooker.org/?p={{urlparam.pid}}

By this the needed JSON is requested.



Example:
http://api.json-content-importer.com/playerlist2/

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
On this page: