Twig-template engine

The free Version of the JSON Content Importer-Plugin is based on the proprietary “JCI-parser” with some great features. This is good and still available.

But: In some cases this parser / template-engine had limits. Therefore now you can use the popular Twig-engine ( with this plugin.

The usage is as following:
After getting access to the JSON-data the plugin from Version 3.4.11 on can suggest you twig-code displaying all the JSON-data.
For that create a template with the URL and maybe needed accessdata so that JSON is available. Leave the template empty and switch on the debugmode.
Preview the page and see the twig-code generated.


[jsoncontentimporterpro url=http://... parser=twig]
{% for eventitem in event %}
{% if eventitem.evs3|length > 0 %}
{% endif %}
{% endfor %}

twig-Extensions (3 to 6 from Version 3.4.0 on):

  • Extension 1: Sort JSON by “sortbyjsonfield”
  • Extension 2: By “dateformat” you can set timezone and language / locale of time- and date-output. See example here.
  • Extension 3: By “convert2html” you can convert JSON-data into HTML
  • Extension 4: “removespecialcharsinurl” is useful for building URLs by lower strings, replacing blanks into dashes, converting “ä” into “ae” etc.
  • Extension 5: “stringshorter(length, suffix)” cuts a string to length and puts a suffix (e.g. “…”) at the end. This is useful for creating a Teasertext out of a long text.
  • Extension 6: “formatnumber(decimals, dec_point, thousands_sep)” formats numerical JSON-data
  • Extension 7: “converthex2ascii” converts hex-data from JSON to ascii
  • Usage of twig for JSON starting with “[{“: See twig and it’s _context