PRO, twig: Replace \r\n in JSON to HTML-Linefeeds

Challenge: Display JSON from and replace the “\r\n” linefeeds by “<br>” Solution: Use the twig-command “replace” Twig-Code: Koulutuspaikka:{{ Courses.0.Koulutuspaikka}} Koulutuksen sisältö: {% set text = attribute(Courses.0, ‘Koulutuksen sisältö’) %} {{ text |replace({‘\r\n’: ”}) }} In Action: No idea what the text means…

Free Plugin: Show Data with subloop-array

Challenge: Show data from Shortcode: totalResults: 2 entry.championship_name: Regular Season Serie A2 Credem Banca – Girone Bianco entry.standing.team_name: Synergy Arapi F.lli Mondovìentry.standing.team_name: Monini Spoleto In Action:

PRO: JSON meets JCI and jQuery for a facet-search

Selecting a hotel for oyur holiday depends on options like location and price. With a facet-search you select several locations out of the all available and define a range for the price. Then the matcihing hotels should be displayed. This can be done with the JCI-PRO-Plugin which grabs the JSON-data, builds a facet and shows … Continue reading “PRO: JSON meets JCI and jQuery for a facet-search”

PRO: Faceted Search with JSON and JCI

Challenge: You have a JSON-API which gives realtime-data. The user should be able to search this data with a faceted search to set options for selecting items. In action: see Example-Data: has data on hotels at different locations, different prices etc. Step 1: Create a page with the search-results Create a JCI-template with … Continue reading “PRO: Faceted Search with JSON and JCI”

PRO: Faceted Search in Action

This page shows how the JCI-PRO-Plugin creates a faceted-search out of JSON-data from Details: see here. 


Challenge: Show data from Solution: PRO Plugin Create a new JCI-Template with the above URL and this twig-code: {% for c in carParks.carPark %} {{c.definition.parkingRecord.parkingRecord.parkingNumberOfSpaces}} parkingNumberOfSpaces at {{ attribute(c.definition.parkingRecord.parkingRecord.parkingDescription.values.value, ‘#text’) }} (id: {{ attribute(c, ‘@id’) }}) parkingSiteStatus: {{c.status.parkingRecord.parkingRecordStatus.parkingSiteStatus }} parkingSiteOpeningStatus: {{c.status.parkingRecord.parkingRecordStatus.parkingSiteOpeningStatus}} measurementOrCalculationTime: {{c.status.parkingRecord.parkingRecordStatus.parkingOccupancy.vehicleCountAndRate.vehicleRate.measurementOrCalculationTime | date(“d.m.Y, H:i”) }} fillRate: {{c.status.parkingRecord.parkingRecordStatus.parkingOccupancy.vehicleCountAndRate.vehicleRate.fillRate.vehicleFlowRate}} exitRate: {{c.status.parkingRecord.parkingRecordStatus.parkingOccupancy.vehicleCountAndRate.vehicleRate.exitRate.vehicleFlowRate}} {% endfor %} … Continue reading “PRO:”

PRO: Calc with data from 2 JSON-URLs by merging the JSON-feeds

Challenge: You have two JSON feeds you want to merge and calc with the JSON-values. Example-Solution: Examle JSON-Feeds: and Create a new JCI-Template and use one JSON-feed-URL as “URL of Template” twig: {% set secondjsonurl = “” %} {% set sc = “Fetching URL failed: A valid URL was not provided.” %} … Continue reading “PRO: Calc with data from 2 JSON-URLs by merging the JSON-feeds”