Set Page-Title and Head-Tags by JSON and CPF

This pages shows you, how to set the Page-Title and Head-Tags out of JSON-data together with Custom Post Fields.
  1. Step 1: Custom Post Fields
    You need two Custom Post Fields named “jci_pagetitle” and “jci_pagehead”. One way is to do that with ACF.. Connect these CPF with the Custom Post Type you want to set Title and Head, e. g. “Pages”.
  2. Step 2: Custom Post Fields
    Create a new Custom Post Page out of the Custom Post Type you connected to the new Custom Post fields (CPF). Add some dummyvalues to the CPF and preview the page: The title should be the dummyvalue you set in “jci_pagetitle”
  3. Step 3: Create a new JCI-Template
  4. Step 4: Add shortcode with template
    Insert the following into the CPF “jci_pagetitle”: begin-[jsoncontentimporterpro nameoftemplate=addpagetitle]-end The preview of the page should have the HTML-Title <title>begin-name is Love Breakfast-end</title> out of JSON-data. And out of first 5 characters of the GET-parameter “ename”, see here.
  5. Step 5: Add Head-Tags to page, created out of JSON (Step 4 and the Shortcode there is required!)
    Insert the following into the CPF “jci_pagehead”:
    <meta name="event" content="{{urlparam.ename |e('html'|slice(0, 3) ) }}-{{ local_date|date("s:i;H-m/d/Y") }}: {{_context.0.name}}">#LF#<meta name="city" content="{{_context.0.venue.city}}">
    See it in action here (open HTML-Sourcecode for that in the browser, please): JSON and the first 3 characters of the GET-parameter “ename” meet in Meta-Tags.