twig Date and time: Format, set Timezone and Language – twig-Attribute syntax

Task:
Format the date and time from a JSON-API. Also set the timezone and language.

If only simple formatting is required: see here.


Details for “dateformat”:
The twig-extension “dateformat” accepts three arguments:

  • The format of the date, see PHP strftime for that.
  • The second optional argument sets the Timezone, see PHP List of Supported Timezones for more. If empty the default value of the PHP-Installation is used.
  • The third optional argument sets the Language, see PHP Locale for more. If empty the default value of the PHP-Installation is used.

    In case of encodein problems add “.UTF-8” like this: {{JSONFIELD | dateformat(“%B %Y”, ‘Europe/Berlin’, ‘de_DE.UTF-8’)}}

Also note this syntax:
{{ attribute(c.definition.parkingRecord.parkingRecord, ‘@id’) }}
If a JSON-Node has a “special Name” like having special Chars or numbers you’re safe with such a syntax.

JCI-Shortcode:

[jsoncontentimporterpro nameoftemplate="nottingham-parking.json"]

JCI-Template:

{% for c in carParks.carPark | slice(0,3) %}
{{ attribute(c.definition.parkingRecord.parkingRecord, '@id') }} - parkingRecordVersionTime: 
{{ c.status.parkingRecord.parkingRecordStatus.parkingStatusOriginTime  | dateformat('%A %m/%d/%y %H:%M:%S ', 'Europe/Berlin', 'nl_NL')}}
<br>
parkingSiteStatus: {{c.status.parkingRecord.parkingRecordStatus.parkingSiteStatus }}<br>
parkingSiteOpeningStatus: {{c.status.parkingRecord.parkingRecordStatus.parkingSiteOpeningStatus}}<br>
measurementOrCalculationTime: {{c.status.parkingRecord.parkingRecordStatus.parkingOccupancy.vehicleCountAndRate.vehicleRate.measurementOrCalculationTime | date("d.m.Y, H:i") }}<br>
fillRate: {{c.status.parkingRecord.parkingRecordStatus.parkingOccupancy.vehicleCountAndRate.vehicleRate.fillRate.vehicleFlowRate}}<br>
exitRate: {{c.status.parkingRecord.parkingRecordStatus.parkingOccupancy.vehicleCountAndRate.vehicleRate.exitRate.vehicleFlowRate}}<hr>
{% endfor %}

In Action:

12233069 - parkingRecordVersionTime: donderdag 03/12/20 16:28:18
parkingSiteStatus: spacesAvailable
parkingSiteOpeningStatus: open
measurementOrCalculationTime: 07.08.2020, 21:46
fillRate: 0
exitRate: 0
12233071 - parkingRecordVersionTime: maandag 03/09/20 13:17:42
parkingSiteStatus: spacesAvailable
parkingSiteOpeningStatus: open
measurementOrCalculationTime: 07.08.2020, 21:46
fillRate: 0
exitRate: 0
12233072 - parkingRecordVersionTime: vrijdag 03/13/20 13:21:07
parkingSiteStatus: spacesAvailable
parkingSiteOpeningStatus: open
measurementOrCalculationTime: 07.08.2020, 21:46
fillRate: 0
exitRate: 0

PRO: Simple twig loop

API: https://api.opendota.com/api/heroes

JSON locally stored at: http://api.json-content-importer.com/extra/json/heroes.json

Shortcode (the twig-template is here inline in the shortcode. It’s way better to use JCI-Templates!):
“slice(2,5) means that the loops starts at item 2 and loops through 5 items

[jsoncontentimporterpro url=https://api.opendota.com/api/heroes parser=twig332adj]
{% for item in _context | slice(2,5) %}
{{item.id}} {{item.name}} {{item.localized_name}}<br>
{% endfor %}
[/jsoncontentimporterpro]

In Action:

3 npc_dota_hero_bane Bane
4 npc_dota_hero_bloodseeker Bloodseeker
5 npc_dota_hero_crystal_maiden Crystal Maiden
6 npc_dota_hero_drow_ranger Drow Ranger
7 npc_dota_hero_earthshaker Earthshaker

twig: Sorting JSON

The PRO Version can sort JSON by using a JCI-twig-extension.
Example-JSON: http://api.json-content-importer.com/extra/json/travel.json

This is done like this:

{% for item in JSONArray | sortbyjsonfield("fieldA##fieldB,desc##fieldC,,num") %}
fieldA: {{item.fieldA}}  / fieldB: {{item.fieldB}} / fieldC: {{item.fieldC}}
{% endfor %}

Syntax:

sortbyjsonfield(STRING) with a special string like “fieldname” (sort field as string from A to Z)

  • “fieldname,desc” (sort field as string from Z to A)
  • “fieldname,,num” (sort field as number from -infinity to infinity)
  • “fieldname,desc,num” (sort field as number from infinity to -infinity)
  • “fieldname,,date” and “fieldname,desc,date” (sort field as date)

“,” and “##” are delimiters (if those are part of the fieldname this won’t work – contact developer in this case to make the delimiter dynamic).

Here we use it like this:


{% for i in Offers | sortbyjsonfield("Refnum,desc,") | slice(0,5) %}
    {{i.Refnum}}: {{i.Arraptname}}<br>
{% endfor %}

In action:

WEBPCK1919-276: Tenerife, Sur Int.(Reina Sofia
WEBPCK1919-275: Tenerife, Sur Int.(Reina Sofia
WEBPCK1919-274: Tenerife, Sur Int.(Reina Sofia
WEBPCK1919-273: Lanzarote (Arrecife) Int.
WEBPCK1919-272: Lanzarote (Arrecife) Int.

PRO: Send authentication data in http-header

Website: http://www.veezi.com/, API: http://api.us.veezi.com/help/Authentication


Create new JCI.Template:

  • Name of template: veezi
  • URL: https://api.us.veezi.com/v1/film (local storage)
  • Method: CURL-GET
  • Curloptions: CURLOPT_HTTPHEADER=VeeziAccessToken:YOUR_VEEZI_TOKEN
  • twig-template:
{% for item in _context %}{% if item.Id != false %}
{{item.OpeningDate | date("d.m.Y") }}<br>
<b>Title: {{item.Title}}</b><br>
{{item.Synopsis}} 
<ul>{% for p in item.People %}
<li>{{p.LastName}}</li>
{% endfor %}</ul>
<hr>
{% endif %}
{% endfor %}

Shortcode:

[jsoncontentimporterpro nameoftemplate="veezi"]

In Action:

23.01.1943
Title: Casablanca
Casablanca, a triple-Oscar winner, “is probably the most famous Hollywood movie of all time, and for good reason,” says Common Sense Media. “Much more fun than its stuffy ‘Greatest Film Ever Made’ tag suggests, with a literate script, stylish direction, a great song and cinema's most romantic couple in Bogie and Bergman,” declares Empire. “Casablanca accomplishes that which only a truly great film can: enveloping the viewer in the story, forging an unbreakable link with the characters, and only letting go with the end credits,” says ReelViews.com.
  • Bogart
  • Bergman
  • Curtiz

05.10.1961
Title: Breakfast at Tiffany's
A young New York socialite becomes interested in a young man who has moved into her apartment building, but her past threatens to get in the way.

    01.12.1989
    Title: National Lampoon's Christmas Vacation
    National Lampoon's Christmas Vacation keeps the dream of a perfect holiday alive. "Holiday films are rarely as priceless," raves Matinee Magazine. “Christmas Vacation is a glowingly goofy homage to family holidays,” declares The Hollywood Reporter. “The ultimate family holiday film," remarks Movie Views, "playing on both the heart strings and the horror to capture a genuine Christmas spirit.”

      05.10.2017
      Title: It's A Wonderful Life
      It’s a Wonderful Life tops too many holiday film lists to count. “It’s one of those ageless movies, like Casablanca, that improves with age ... (and) can be viewed an indefinite number of times,” says the late critic Roger Ebert. George Bailey was Jimmy Stewart’s favorite role. Who could argue with the Indiana, Pa., hometown boy, combat pilot and Air Force Reserves retired Brigadier General? “It’s a Wonderful Life is one of the best films America has ever made about itself, and that’s why I love it so much,” reveals Vox. “(Capra and Stewart) knew how easy it is to destroy our best qualities. They knew that humanity is only as good as it is kind, and they made a film about just that… Years later, it bobs up to us like a message in a bottle from the past. Do not let cruelty win, it says. Reach out. Hold on. Help.”

        29.03.1965
        Title: SING-ALONG The Sound of Music
        The Sound of Music, a beloved Thanksgiving weekend sing-along event, will return to The Tull Family Theater on Friday, Nov. 25, and Saturday, Nov. 26, both at 10:30 a.m. Those attending in costume will receive complimentary popcorn. Screenings of the 3-hour film will have a 20-minute intermission. Tickets are at the special event price of $15 each. Leading the audience as they follow the bouncing ball on screen will be Pittsburgh celebrity Phat Man Dee, a prolific performer consistently chosen as the Best Jazz Act by Pittsburgh City Paper readers. A cabaret vocalist, bandleader, videographer, poet and occasional cellist, she is also a music educator, teaching voice to youth. Phat Man Dee performs about 100 events a year in theaters, educational facilities, private events, nightclubs and festivals. When not teaching or performing, the artist serves as social media manager for the Pittsburgh Racial Justice Summit. A lifelong fan of the film, like multiple generations enamored with the The Sound of Music, Phat Man Dee offers her perspective: “As a Jewish child, I always appreciated how the characters refused to go with the Nazis, and fled their mansion and their entire life rather than bend to the will of fascism.” The 1965 classic “underlines how the strength of togetherness, love and sense of community could prevail over the horrors of war,” says Salzburgerland.com, a website dedicated to the region where the movie, based on a true story, was filmed. With her portrayal of Maria, governess to the seven von Trapp children, Julie Andrews won millions of hearts worldwide. Her dashing co-star, Christopher Plummer, also rose to fame, becoming the only Canadian to win Oscar, Emmy and Tony awards. Unfortunately, he passed in 2021, before a reunion of the film’s cast for Andrews’ Life Achievement Award from the American Film Institute. Andrews shared her surprise at the strength and persistence of audience response to the film released nearly six decades ago. “It stayed in people’s consciousness all this time,” she shared with CNN. “It made a big, big dent in people’s psyche.” Phat Man Dee agrees: “As a musician, these songs have inspired generations of artists to interpret them across multiple genres but the originals still hold their magic. On Thanksgiving weekend, we’re going to ‘climb every mountain!’ ”
        • Wise
        • Plummer
        • Andrews

        07.11.2003
        Title: Elf
        This 2003 classic “cemented Will Ferrell as a big screen star, and his performance as Buddy the Elf plays up his innocence, his sense of childlike wonder, and his unpredictable energy,” says the Detroit News. "The holidays aren't complete without it.” “Buddy's naive pleasure in the world around him is ultimately almost as endearing to us as it is to (almost) everyone he meets,” cheers Common Sense Media. “Simplicity. Goodness. Sugar-coated. Nostalgic. Maybe a little hokey at times. Endearing. Enchanting,” says Behind the Lens. “Go celebrate Christmas a little early with Elf—a new Christmas classic for the 21st century.”
        • Ferrell
        • Deschanel

        22.08.2019
        Title: Event Blocking

          13.05.2020
          Title: Random Movie In The Future

            20.05.2020
            Title: Test One
            This is Test One

              20.05.2020
              Title: Test Film 2
              This is Test Film 2

                22.08.2019
                Title: Video Game Blocking

                  20.05.2020
                  Title: House Will Call
                  Will Call

                    11.06.2021
                    Title: Wordpress film creation tracking
                    Haunted by his mysterious past, a devoted high school football coach leads a scrawny team of orphans to the state championship during the Great Depression and inspires a broken nation along the way.
                    • Shaw
                    • Lofland
                    • De Luca
                    • Williams
                    • Knight
                    • Roberts
                    • Hill
                    • Dylan
                    • Bryan
                    • De Luca
                    • Walker
                    • DuVall
                    • Wilson
                    • Sheen

                    22.08.2019
                    Title: OCAP WEDNESDAY!!! DON'T FORGET!

                      22.08.2019
                      Title: Boom and Bust

                        26.04.2022
                        Title: Redslate Films Fantasy Premiere
                        The Theater is honored to host the Redslate Films Fantasy Premiere on Monday, Sept. 19 at 7:30 p.m., followed by a brief Q&A with the local indie filmmakers. The premiere includes: - Arrivederci Bastardo - Fire - Runai - Children as Giants This event is free to the public but reservations are recommended as space is limited.

                          05.10.1979
                          Title: Nosferatu with music by Tom Roberts
                          Nosferatu: A Symphony of Horror (German: Nosferatu – Eine Symphonie des Grauens) is a 1922 silent German Expressionist horror film directed by F. W. Murnau and starring Max Schreck as Count Orlok, a vampire who preys on the wife (Greta Schröder) of his estate agent (Gustav von Wangenheim) and brings the plague to their town. The silent film will be paired with new music composed and performed live in the Theater by Pittsburgh native, Tom Roberts.

                            11.11.2022
                            Title: The Fabelmans
                            A semi-autobiography based on Spielberg's own childhood.
                            • Williams
                            • Spielberg
                            • Macosko Krieger
                            • Dano
                            • Kushner
                            • LaBelle
                            • Lynch
                            • Rogen

                            11.11.2022
                            Title: Black Panther: Wakanda Forever
                            In Marvel Studios’ “Black Panther: Wakanda Forever,” Queen Ramonda (Angela Bassett), Shuri (Letitia Wright), M’Baku (Winston Duke), Okoye (Danai Gurira), and the Dora Milaje (including Florence Kasumba), fight to protect their nation from intervening world powers in the wake of King T’Challa’s death. As the Wakandans strive to embrace their next chapter, the heroes must band together with the help of War Dog Nakia (Lupita Nyong’o) and Everett Ross (Martin Freeman) and forge a new path for the kingdom of Wakanda. Introducing Tenoch Huerta as Namor, king of a hidden undersea nation, the film also stars Dominique Thorne, Michaela Coel, Mabel Cadena, and Alex Livanalli.
                            • Boseman
                            • Feige
                            • Bassett
                            • Coogler
                            • K. Brown
                            • Nyong'o
                            • Duke
                            • Jordan
                            • Wright
                            • Gurira
                            • Coel
                            • Huerta
                            • Thorne
                            • Cadena
                            • Livanalli
                            • Whitaker
                            • Freeman

                            04.11.2022
                            Title: Good Night Oppy
                            Good Night Oppy tells the inspirational true story of Opportunity, a rover that was sent to Mars for a 90-day mission but ended up surviving for 15 years. The film follows Opportunity’s groundbreaking journey on Mars and the remarkable bond forged between a robot and her humans millions of miles away.
                            • White
                            • Hargrave
                            • Frank
                            • Falvey
                            • Carroll
                            • Goldberg

                            22.08.2019
                            Title: Teen Screen--Repairing the World

                              21.12.2022
                              Title: Puss in Boots: The Last Wish
                              Puss in Boots discovers that his passion for adventure has taken its toll: he has burned through eight of his nine lives. Puss sets out on an epic journey to find the mythical Last Wish and restore his nine lives.
                              • Colman
                              • Pugh
                              • Swift
                              • Crawford
                              • Miller
                              • Moura
                              • Randolph
                              • Kayo
                              • Guillén
                              • Flanagan
                              • Mercado
                              • Mulaney
                              • Mendez
                              • Banderas
                              • Hayek
                              • Winstone

                              16.12.2022
                              Title: Avatar: The Way of Water
                              Set more than a decade after the events of the first film, “Avatar The Way of Water” begins to tell the story of the Sully family (Jake, Neytiri and their kids), the trouble that follows them, the lengths they go to keep each other safe, the battles they fight to stay alive and the tragedies they endure
                              • Worthington
                              • Saldana
                              • Weaver
                              • Lang
                              • Chaplin
                              • Falco
                              • Moore
                              • Landau
                              • Curtis
                              • Winslet
                              • Cameron
                              • Ribisi
                              • Thewlis

                              18.11.2022
                              Title: She Said
                              New York Times reporters Megan Twohey and Jodi Kantor break one of the most important stories in a generation — a story that helped launch the #MeToo movement and shattered decades of silence around the subject of sexual assault in Hollywood.
                              • Kazan
                              • Gardner
                              • Kleiner
                              • Pelphrey
                              • Braugher
                              • Mulligan
                              • Morton
                              • Schrader
                              • Barta
                              • Pitt
                              • Clarkson

                              21.10.2022
                              Title: The Banshees of Inisherin
                              Set on a remote island off the west coast of Ireland, THE BANSHEES OF INISHERIN follows lifelong friends Pádraic (Colin Farrell) and Colm (Brendan Gleeson), who find themselves at an impasse when Colm unexpectedly puts an end to their friendship. A stunned Pádraic, aided by his sister Siobhán (Kerry Condon) and troubled young islander Dominic (Barry Keoghan), endeavours to repair the relationship, refusing to take no for an answer. But Pádraic's repeated efforts only strengthen his former friend’s resolve and when Colm delivers a desperate ultimatum, events swiftly escalate, with shocking consequences.
                              • McDonagh
                              • Keoghan
                              • Czernin
                              • Broadbent
                              • Condon
                              • Farrell
                              • Gleeson

                              23.12.2022
                              Title: I Wanna Dance With Somebody
                              Upcoming feature about the late musical icon, Whitney Houston. Naomi Ackie stars as Whitney Houston in the musical biopic, which is based on the epic life and music of the iconic singer. Directed by Kasi Lemmons and written by Academy Award Nominee Anthony McCarten, the film will take audiences on an emotional, energetic journey through Houston's career and music.
                              • Sanders
                              • McCarten
                              • Davis
                              • Lemmons
                              • Peters
                              • Meghie
                              • Smith
                              • Tunie
                              • Luckinbill
                              • Luckinbill
                              • Kalligheri
                              • Ackie
                              • Jackson
                              • Mestel
                              • O'Sullivan
                              • Houston
                              • Papagjika
                              • Salloway
                              • Tucci

                              13.01.2023
                              Title: A Man Called Otto
                              The film will follow Otto (Hanks), a grumpy isolated widower with staunch principles, strict routines and a short fuse, who gives everyone in his neighborhood a hard time as he watches over it like a hawk. Just as it seems like he’s finally given up on life, an unlikely and reluctant friendship develops with his new neighbors. Little by little, Otto undergoes a subtle transformation…but is he really capable of change?
                              • Goetzman
                              • Forster
                              • Britton
                              • Garcia-Rulfo
                              • Treviño
                              • Wilson
                              • Keller
                              • Birbiglia
                              • Wikström Nicastro
                              • Hanks
                              • Wilson

                              09.12.2022
                              Title: Empire of Light
                              From Academy Award®-winning director and writer Sam Mendes, EMPIRE OF LIGHT is an intimate and moving story about love, friendship, and connection, set in a coastal town in Southern England against the social turmoil of the early 1980s. Hilary (Olivia Colman), a woman with a difficult past and an uneasy present, is part of a makeshift family at the old Empire Cinema on the seafront. When Stephen (Micheal Ward) is hired to work in the cinema, the two find an unlikely attraction and discover the healing power of movies, music and community.
                              • Colman
                              • Jones
                              • Harris
                              • Clarke
                              • Brooke
                              • Moodie
                              • Onslow
                              • Firth
                              • Mendes

                              23.12.2022
                              Title: Women Talking
                              A group of women in an isolated Mennonite religious colony in Bolivia as they struggle to reconcile their faith with a string of sexual assaults committed by the colony's men.
                              • Mara
                              • McDormand
                              • Foy
                              • Whishaw
                              • Gardner
                              • Kleiner
                              • Buckley
                              • McCarthy
                              • Pitt
                              • Polley

                              04.11.2022
                              Title: Salvatore: Shoemaker of Dreams
                              The documentary tracks Salvatore ferragamo’s  fascinating  personal, artistic and business story, from his childhood in Bonito, where he made his first pair of shoes, to his journey to America to seek his fortune, from his experiences in Hollywood to his return to Italy, from the verge of bankruptcy to resurgence in his Florence factory and rise to definitive acclaim. Character, instinct, genius, curiosity and extraordinary intuition: SALVATORE: SHOEMAKER OF DREAMS shows the mystery and magnetism of a complex man, an icon of Italian and international luxury fashion who never lost sight of the importance of family. Guadagnino presents never-before-seen images and stories told by members of the Ferragamo family, director Martin Scorsese, costume designer Deborah Nadoolman Landis, shoe designers Manolo Blahnik and Christian Louboutin, and many historians, teachers, designers, journalists, and fashion and film critics.
                              • Stuhlbarg
                              • Guadagnino
                              • Moratti
                              • Melzi d'Eril
                              • Ferragamo
                              • Scorsese

                              11.11.2022
                              Title: Spirited
                              A musical version of the classic Christmas story by Charles Dickens. A miserly man who treats everyone around him with terrible selfishness finds himself on a fantastical adventure into the three phases of time: past, present, and future, in order to discover how he ended up so miserable and alone.
                              • Spencer
                              • Anders
                              • Morris
                              • Elbaum
                              • Koplan
                              • Dewey
                              • Ferrell
                              • Reynolds

                              18.11.2022
                              Title: The Menu
                              A couple (Anya Taylor-Joy and Nicholas Hoult) travels to a coastal island to eat at an exclusive restaurant where the chef (Ralph Fiennes) has prepared a lavish menu, with some shocking surprises.
                              • McKay
                              • Hoult
                              • Taylor-Joy
                              • Chau
                              • McTeer
                              • Leguizamo
                              • Adelstein
                              • Birney
                              • Light
                              • Castro
                              • Carrero
                              • Mylod
                              • Goodson
                              • Koch
                              • Nguyen
                              • Phillips
                              • St. Cyr
                              • Yang
                              • Fiennes

                              13.11.2022
                              Title: Sweet Disaster

                                08.12.2022
                                Title: Teen Screen: The Light of Hope

                                  09.12.2022
                                  Title: Father Stu: Reborn
                                  God wanted a fighter and He found one. Mark Wahlberg stars in the inspiring true-life story, Father Stu. Based on a true story, Father Stu is an unflinchingly honest, funny, and ultimately uplifting drama about a lost soul who finds his purpose in a most unexpected place. When an injury ends his amateur boxing career, Stuart Long (Mark Wahlberg) moves to L.A. dreaming of stardom. While scraping by as a supermarket clerk, he meets Carmen (Teresa Ruiz), a Catholic Sunday school teacher who seems immune to his bad-boy charm. Determined to win her over, the longtime agnostic starts going to church to impress her. But surviving a terrible motorcycle accident leaves him wondering if he can use his second chance to help others find their way, leading to the surprising realization that he is meant to be a Catholic priest. Despite a devastating health crisis and the skepticism of Church officials and his estranged parents (Mel Gibson and Jacki Weaver), Stu pursues his vocation with courage and compassion, inspiring not only those closest to him but countless others along the way. Written for the screen and directed by Rosalind Ross, and starring Academy Award Nominee® Mark Wahlberg (Best Supporting Actor, The Departed, 2006) as Father Stu, along with Academy Award Winner® Mel Gibson (Best Director, Braveheart, 1995), Academy Award Nominee® Jacki Weaver (Best Supporting Actor, Silver Linings Playbook, 2012) and Teresa Ruiz (Narcos). The film is produced by Mark Wahlberg, Stephen Levinson and Jordon Foss and executive produced by Miky Lee, Colleen Camp, Rosalind Ross, Patrick Peach and Tony Grazia.
                                  • Weaver
                                  • Levinson
                                  • Ruiz
                                  • Ross
                                  • Foss
                                  • Gibson
                                  • Wahlberg

                                  07.10.2022
                                  Title: TÁR
                                  From writer-producer-director Todd Field comes TÁR, starring Cate Blanchett as Lydia Tár, the groundbreaking conductor of a major German Orchestra. We meet Tár at the height of her career, as she’s preparing both a book launch and a much-anticipated live performance of Mahler’s Fifth Symphony. Over the ensuing weeks, her life unravels in a singularly modern way. The result is a searing examination of power and its impact and durability in today’s society.
                                  • Strong
                                  • Merlant
                                  • Hoss
                                  • Lambert
                                  • Milchan
                                  • Glover
                                  • Field
                                  • Corduner
                                  • Kauer
                                  • Blanchett

                                  09.12.2022
                                  Title: Guillermo del Toro's Pinocchio
                                  Academy Award®-winning director Guillermo del Toro and award-winning, stop-motion legend Mark Gustafson reimagine the classic Carlo Collodi tale of the fabled wooden boy with a whimsical tour de force that finds Pinocchio on an enchanted adventure that transcends worlds and reveals the life-giving power of love.
                                  • Waltz
                                  • Wolfhard
                                  • del Toro
                                  • Bradley
                                  • Henson
                                  • Bulkley
                                  • Campodonico
                                  • Gustafson
                                  • Ungar
                                  • Mann
                                  • McGregor
                                  • Swinton
                                  • Perlman

                                  31.12.1982
                                  Title: Annie
                                  In the depths of the 1930's, Annie is a fiery young orphan girl who must live in a miserable orphanage run by the tyrannical Miss Hannigan. Her seemingly hopeless situation changes dramatically when she is selected to spend a short time at the residence of the wealthy munitions industrialist, Oliver Warbucks. Quickly, she charms the hearts of the household staff and even the seemingly cold-hearted Warbucks cannot help but learn to love this wonderful girl. He decides to help Annie find her long lost parents by offering a reward if they would come to him and prove their identity. However, Miss Hannigan, her evil brother, Rooster, and a female accomplice, plan to impersonate those people to get the reward for themselves which put Annie in great danger.
                                  • Huston
                                  • Burnett
                                  • Peters
                                  • Quinn
                                  • Reinking
                                  • Stark
                                  • Finney
                                  • Curry

                                  18.12.2022
                                  Title: It's a Wonderful Life 75th Anniversary
                                  Embraced as a cherished holiday tradition by families around the world, Frank Capra’s heart-warming masterpiece now celebrates 75 years with this big-screen event. George Bailey (James Stewart) sets aside his dreams of world travel to run his father’s small community bank, and protect the people of Bedford Falls from greedy businessman Mr. Potter (Lionel Barrymore). When a costly mistake pushes George to the brink of despair, a visit from a kindly angel (Henry Travers) will show George how the life of one good man can change the world forever.
                                  • Stewart
                                  • Capra
                                  • Reed
                                  • Barrymore
                                  • Mitchell
                                  • Travers

                                  PRO: API bikereg.com

                                  API: https://www.bikereg.com/api/EventSearchDoc.aspx, Example: https://www.bikereg.com/api/search?region=Rocky%20Mountain

                                  Local stored JSON: http://api.json-content-importer.com/extra/json/bikereg-search.json


                                  Shortcode:

                                  [jsoncontentimporterpro nameoftemplate="bikereg"]

                                  twig-Template:

                                  <ul>{% for me in MatchingEvents | slice(0,3) %}
                                  <li><a href={{me.EventPermalink}} target=_blank>{{me.EventName}}</a>
                                  {{me.EventCity}}, {{me.EventState}}, 
                                  {% set dateofevent = me.EventDate | slice(6, 10) %}
                                  {{dateofevent | date("d.m.Y H:i") }}</li>
                                  {% endfor %}</ul>

                                  In Action:

                                  PRO: API workshopbutler.com

                                  This pages shows you how simple you can loop through a JSON-feed.

                                  API: https://www.workshopbutler.com
                                  locally stored at http://api.json-content-importer.com/extra/json/workshopbutler/1.json

                                  {% for item in _context %}
                                  {{item.unique_name}}: rating: {{item.rating}}, countries: 
                                      {% for co in item.countries %}
                                          {{co}}<br>
                                      {% endfor %}
                                  {% endfor %}

                                  In Action:

                                  char..maq: rating: 8.96999988556, countries: AU
                                  danny: rating: 0, countries: AU
                                  NZ
                                  dtellu: rating: 0, countries: NZ
                                  d.josey: rating: 0, countries: IE
                                  : rating: , countries:

                                  PRO: Pagination by twig – 1 feed, many pages

                                  This page demonstrates how you can paginate data. All data comes in 1 feed (see here for data in several feeds)

                                  Create a new JCI-Template for that:

                                  {% set noonpage = 20 %}
                                  {% set noofitems = ( days | length ) %}
                                  {% if urlparam.no %}{% set selno = urlparam.no %}{% else %}{% set selno = 1 %}{% endif %}
                                  
                                  number of data-items: {{ noofitems  }} at <a href="http://api.json-content-importer.com/extra/paginationdata.php" target="_blank">http://api.json-content-importer.com/extra/paginationdata.php</a><br>
                                  {% set noofpages = (noofitems /noonpage) | round(0, 'ceil') %} show on {{noofpages}} pages:
                                  
                                  {% set start = noonpage *(selno-1) %}
                                  {% set end= start + noonpage %} 
                                  
                                  {% for i in 1..noofpages %} 
                                  {% if i==selno %} 
                                  <b>this is page: </b> {{selno}} ({{start+1}} - {{end}})
                                  {% else %} 
                                  <a href=?no={{i}}>{{i}}</a>
                                  {% endif %} 
                                  {% endfor %}
                                  <hr>
                                  {% if noofitems ==0 %} No data-items found {% endif %} 
                                  <ul>
                                  {% for day in days | slice(start, noonpage) %} 
                                  <li>
                                  {% set currno = start + loop.index0+1 %} {{currno}}. {{day.FORENAMES}} {{day.SURNAME}}
                                  </li>
                                  {% endfor %} 
                                  </ul>

                                  Shortcode:

                                  [jsoncontentimporterpro parser=twig nameoftemplate=pagination]

                                  Example in action:

                                  number of data-items: 165 at http://api.json-content-importer.com/extra/paginationdata.php
                                  show on 9 pages: this is page: 1 (1 - 20) 2 3 4 5 6 7 8 9
                                  • 1. Johnson Williams
                                  • 2. Brown Jones
                                  • 3. Miller Davis
                                  • 4. Garcia Rodriguez
                                  • 5. Wilson Martinez
                                  • 6. Anderson Taylor
                                  • 7. Thomas Hernandez
                                  • 8. Moore Martin
                                  • 9. Jackson Thompson
                                  • 10. White Lopez
                                  • 11. Lee Gonzalez
                                  • 12. Harris Clark
                                  • 13. Lewis Robinson
                                  • 14. Walker Perez
                                  • 15. Hall Young
                                  • 16. Allen Sanchez
                                  • 17. Wright King
                                  • 18. Scott Green
                                  • 19. Baker Adams
                                  • 20. Nelson Hill

                                  PRO: Basic JSON-/Twig-Usage with “_context” or “_parent”

                                  API-Source: http://api.json-content-importer.com/extra/json/2.json

                                  If your JSON starts with “[{” try this:


                                  JCI-template:

                                  _context<br>
                                  _context.0.id: {{_context.0.id}}<br> 
                                  _context : {{_context | json_encode }}<br>
                                  {% for item in _context %}
                                  item {{loop.inxes}}: {{item | json_encode}}<br>
                                  {% endfor %}
                                  <hr>
                                  _parent<br>
                                  _parent.0.id: {{_parent.0.id}}<br> 
                                  {% for item in _parent %}
                                  _parent : {{_parent | json_encode }}<br>
                                  item {{loop.inxes}}: {{item | json_encode}}<br>
                                  {% endfor %}

                                  Shortcode:

                                  [jsoncontentimporterpro nameoftemplate="contextparent"]

                                  twig defines some Global Variables

                                  • _self: references the current template name;
                                  • _context: references the current context;
                                  • _charset: references the current charset.

                                  _parent is almost the same as _context but:
                                  note the differnce of _context and _parent loops

                                  In Action:

                                  _context
                                  _context.0.id: 1696
                                  _context : {"0":{"id":1696,"title":"1Experiment Your Way Through Change","type":14},"1":{"id":2696,"title":"2Experiment Your Way Through Change","type":24},"urlparam":{"no":"1"}}
                                  item : {"id":1696,"title":"1Experiment Your Way Through Change","type":14}
                                  item : {"id":2696,"title":"2Experiment Your Way Through Change","type":24}
                                  item : {"no":"1"}
                                  item : {"0":{"id":1696,"title":"1Experiment Your Way Through Change","type":14},"1":{"id":2696,"title":"2Experiment Your Way Through Change","type":24},"urlparam":{"no":"1"}}

                                  _parent
                                  _parent.0.id:
                                  _parent : {"0":{"id":1696,"title":"1Experiment Your Way Through Change","type":14},"1":{"id":2696,"title":"2Experiment Your Way Through Change","type":24},"urlparam":{"no":"1"}}
                                  item : {"id":1696,"title":"1Experiment Your Way Through Change","type":14}
                                  _parent : {"0":{"id":1696,"title":"1Experiment Your Way Through Change","type":14},"1":{"id":2696,"title":"2Experiment Your Way Through Change","type":24},"urlparam":{"no":"1"}}
                                  item : {"id":2696,"title":"2Experiment Your Way Through Change","type":24}
                                  _parent : {"0":{"id":1696,"title":"1Experiment Your Way Through Change","type":14},"1":{"id":2696,"title":"2Experiment Your Way Through Change","type":24},"urlparam":{"no":"1"}}
                                  item : {"no":"1"}

                                  Free & PRO: API Stadt Köln open-data

                                  API-Source:
                                  https://www.stadt-koeln.de/externe-dienste/open-data/traffic.php
                                  and
                                  https://www.stadt-koeln.de/leben-in-koeln/verkehr/verkehrskalender/

                                  JSON stored locally: http://api.json-content-importer.com/extra/json/koeln-20220130-traffic.json

                                  In Action:

                                  Free Plugin (show the first four items)

                                  [jsoncontentimporter url=https://www.stadt-koeln.de/externe-dienste/open-data/traffic.php]STRASSE:AUSLASTUNG
                                  {subloop-array:features:4}{subloop:features.attributes:-1}{NAME}: {AUSLASTUNG}
                                  {/subloop:features.attributes}{/subloop-array:features}
                                  [/jsoncontentimporter]
                                  STRASSE:AUSLASTUNG
                                  Militärring - Aachener Straße bis A 57 - Ausfahrt Longerich: 16
                                  Gürtel - Aachener Straße bis Rheinufer Süd: 0
                                  Rheinufer - Theodor-Heuss-Ring bis Ubierring: 16
                                  Industriestraße - Niehler Hafen bis A1 - Anschlussstelle Köln-Niehl: 0


                                  PRO-Plugin (show only >0 values and only 6 items):

                                  URL: https://www.stadt-koeln.de/externe-dienste/open-data/traffic.php
                                  twig-Template:

                                  {% set numb = 0 %}
                                  found features: {{features| length}}<br>
                                  {% for f in features %}
                                  {% if (f.attributes.auslastung>0) and (numb<6) %}
                                      {% set numb = numb  + 1 %}
                                      {{numb}}. {{f.attributes.name}}: {{f.attributes.auslastung}}<br>
                                  {% endif %}
                                  {% endfor %}
                                  found features: 113
                                  1. Ost-West-Achse - Deutzer Brücke bis Innere Kanalstraße: 16
                                  2. Riehlerstraße - Mülheimer Brücke (Schanz) bis Zoobrücke: 16
                                  3. Siegburger Straße - A4 - Ausfahrt Poll bis Severinsbrücke: 16
                                  4. Rheinufer - Ubierring bis Theodor-Heuss-Ring: 1
                                  5. Dürener Straße - Gürtel bis A1 - Ausfahrt Frechen: 16
                                  6. Olpener Straße - A4 - Ausfahrt Refrath bis A4 - Ausfahrt Merheim: 16