Plugin Author
berkux
(@berkux)
Hi,
can you post the complete JSON, please.
Bernhard
Thread Starter
ginowp
(@ginowp)
Shure – and thanks for looking into this!
– This is the result-page: https://itec.kuleuven-kulak.be/?page_id=2707
As you see, the item LINK is shown (in 1, 3 & 4) and is not shown in the others because there is more than one link in the json ‘baclink’;
This is what i put into the Gutenberg block:
API-URL: https://services.libis.be/search?query=user:U0006844&institution=lirias
basenode: data
template:
-
{subloop:display:-1}
{subloop:links:-1}
{display.creator} –
{display.creationdate} –
<b>{display.title}</b> –
{display.ispartof} –
{display.source_id}
<br>
<b>LINK</b>: {links.backlink}
<br>
{/subloop:links}
{/subloop:display}
<p>
And this is the shortcode:
[jsoncontentimporter url=https://services.libis.be/search?query=user:U0006844&institution=lirias numberofdisplayeditems=-1 basenode=data urlgettimeout=5 debugmode=10 ]
-
{subloop:display:-1}
{subloop:links:-1}
{display.creator} –
{display.creationdate} –
<b>{display.title}</b> –
{display.ispartof} –
{display.source_id}
<br>
<b>LINK</b>: {links.backlink}
<br>
{/subloop:links}
{/subloop:display}
<p>
[/jsoncontentimporter]
Plugin Author
berkux
(@berkux)
<<As you see, the item LINK is shown (in 1, 3 & 4) and is not shown in the others because there is more than one link in the json ‘baclink’;>>
Ok, this is due to inconsitent JSON.
If there is only one backlink it’s encoded as object, if there are more than 1 as array.
This is fatal for the free parser.
Even the PRO version of the plugin can handle this only with checking if “backlink” iterable or not.
The best way would be that the JSON is improved and this is always a array.
Bernhard
-
This reply was modified 6 years, 1 month ago by
berkux.
Thread Starter
ginowp
(@ginowp)
Ok, i understand, problem is we recieve this JSON file and cannot edit it.
Could this be a solution?
– we can axtract the source_id, and that is always LIRIAS########
– the link we need is always https://lirias.kuleuven.be/########
– is there a way we can extract the ######## from the source_id (or elemintte LIRIAS) and add it to https://lirias.kuleuven.be/#########
That would be a solution to have the correct link that we need….
**And another question: for formatting a date (20200430) we need the PROversion?
Thanks a lot for the service!
Plugin Author
berkux
(@berkux)
<<is there a way we can extract the ######## from the source_id>>
The plugin with the free parser unfortunaltely can’t do that.
<<for formatting a date (20200430) we need the PROversion? >>
yes
With the pro version this JSON is no problem.
Another solution would be to ask the API-supplier to change or add the JSON.
Bernhard
Thread Starter
ginowp
(@ginowp)
thanks!
so that means that the PRO version can extract the number…
Gino
Plugin Author
berkux
(@berkux)