JCI template engine: Subloops: Objects and Arrays (D)

Any HTML-Code plus “basenode”-datafields wrapped in “{}” {subloop:”basenode_subloop”:”number of subloop-datasets to be displayed”} Any HTML-Code plus “basenode_subloop”-datafields wrapped in “{}”. If JSON-data is HTML add “html” flag like “{fieldname:html}” {/subloop:”basenode_subloop”}

  • If the subloop is not an object but an array, e.g.: “{subloop-array:type:5}{1:ifNotEmptyAddRight:aa<br>bb}{2:ifNotEmptyAddLeft:AA}{3:ifNotEmptyAddRight:BB}{/subloop-array}” shows the first, second and third entry of that array, modified by ifNotEmptyAddLeft and ifNotEmptyAddRight (see below).
  • templates like “{subloop-array:AAAA:10}{text}{subloop:AAAA.image:10}{id}{/subloop:AAAA.image}{/subloop-array:AAAA}” are possible: one is the recursive usage of “subloop-array” and “subloop”. the other is “{subloop:AAAA.image:10}” where “AAAA.image” is the path to an object. This is fine for some JSON-data.

Recursive usage of “subloop-array” and “subloop” of wordpress-shortcode

If the JSON-Tree is deep, the template has to be deep. Then “subloop” and “subloop-array” can be used inside the other.