-
Notifications
You must be signed in to change notification settings - Fork 1
Tags Loop
Q edited this page Dec 13, 2020
·
5 revisions
Loops tags define work with Scope tags to define data and markup to use in foreach loops
Loop tags allowed the UI developer to define the markup that is returned from the template engine, by defining the start and end points used for data iterations.
Loop tags use the following format:
{@ loop @}
Here is an example, from a user system, which runs a request to Advanced Custom Fields - via the group context and loops over the returned indexed array of data in the frontpage_feature key:
<div class='col-12 card-columns'>
{~ group~frontpage_feature {+ [array]
config = debug: false &
markup = template: "
{@ {: frontpage_feature :}
<div class='card'>
<div class='card-body'>
<h5 class='card-title'>{{ title }}</h5>
<p class='card-text'>{{ content }}</p>
<a href='{{ url }}' class='btn btn-primary'>More</a>
</div>
</div>
@}"
+} ~}
</div>
- Wrapping markup in double quotes will stop the argument parser from removing whitespaces, preserving markup correctly for rendering