HiFi Results

Looping over HiFi results is extremely common, so it deserves it's own section.  It is simple using a for loop and hifi.get:

{% for post in hifi.get({'type':'post'}) %}
  {{ post.title }}
{% endfor %}

hifi.get always returns an array, so this is the best way to loop through the results of a HiFi query. The HiFi query can be as complex as desired. Here is one showing the latest news of a site:

{% for newsItem in hifi.get({'type':'post','parent':{'url':'/news'},'orderBy','-publishedAt','count',3}) %}
  <a href="{{ newsItem.url }}">{{ newsItem.title }}</a>
{% endfor %}