PRO: Use Custom Post Fields
A WordPress-Page can have some Custom Post Fields (CPF). By that one WP-page can be almost identical to another, the only differencewould be a CPF.
E. g. a CPF “language” on one page with “en” and on another “de”.
Having a JCI-Shortcode on such a page, the value of the CPF can be used in the API-URL and in the twig-template.
With twig this works this way: Get the current pageID by wp_get_page_properties
and then get the CPF by wp_get_custom_field_value
:
{% set pageprop = wp_get_page_properties(debug, pageid) %} {% set pageid = jcipageparam.post.ID %} pageid: {{pageid}}<br> {% set valkeyaa = wp_get_custom_field_value(pageid, 'keyaa') %} CPF-keyaa: {{valkeyaa | json_encode }}<br>
more on that an an example: http://api.json-content-importer.com/build-api-url-with-use-custom-fields/