Print

PRO: Data-Usage

When you have access to the data you can work with it. For that we need data in the JSON-Format.

JSON or an other Format?

Usually this is the case. But sometimes the API gives not JSON but Text, CSV, XML, binary-data for images etc.
If Text, XML, CSV… check the Shortcode-Options for inputtype. If something else comes along see there for displayapireturn=NUMBER

twig-template in JCI Template

The JCI Template has a field for the Twig-Syntax for the Template using the JSON

This twig-Code is used on the JSON for calculating the result.

twig-Basics

The basic syntax of twig is documented at https://twig.symfony.com/doc/3.x/templates.html

For backward compatibility twig-versions 1, 2.4.3, 3, 3.3.2 are part of the JCI PRO Plugin. These twig-versions will be removed in futur versions of the JCI-PRO plugin, therefore they are officially deprecated!

And also the JCI-optimized JCI-twig 3.3.2 and JCI-twig 3.5.1. Use JCI-twig 3.5.1 to avoid comptibility problems with other plugins also using twig and when you use PHP 8.X .

If you think about switching from twig 1 or twig 2 to twig 3 test your twig-code, as there are some changes from verson 2 to 3.

twig-Examples

At http://api.json-content-importer.com/twig-programming-examples/ you find many examples shoing how twig & JSON work together.

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: