Skip to content

Tags Scope

Q edited this page Dec 13, 2020 · 4 revisions

Scope tags define the data element from a returned data array to increment over and are currently only used inside Loop Tags

Scope tags use the following format:

{: scope :}

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>
Clone this wiki locally