API Access

The Cloud Rendering Service allows you to focus on the template without you to care about the API handling at all. We’ve capsuled the available functions in easy to use Tags.

Story / Content Entry

Capsules the Story Content Delivery API.

Single

by Slug

{% set variable from story id:'global' %} <!-- id at this point is equal to a content entries slug. -->

{{ variable.name }} <!-- Will output the content entries name -->

By uuid

{% set variable from story id:'c6b4d6fc-6e93-4c31-8bb7-04b04eeac0b7', find_by:'uuid' %} <!-- id at this point is equal to a content entries uuid. -->

{{ variable.name }} <!-- Will output the variable content entries name -->

Collection

Access a content entry by a folders slug

{% set posts from stories starts_with:'posts', per_page: 3, is_startpage: false %}
{% for post in posts.data %}
  {{ post.name }} <!-- Will output the name of the post -->
{% endfor %}

As you see above you’ve the possibility to easily create an overview page without to worry about the API request handling. You can filter and sort as you need.

<!-- Sets the stories beginning with the slug 'products' and filter by options array -->
{% set stories from stories starts_with:'products', per_page:per_page, filter_by:'{"options":["red"]}' %}

Data Source Entries

Capsules the Datasource Content Delivery API

<!-- Retrieves the first 10 entries from the datasource 'labels' -->
{% set entries from datasource_entries datasource:'labels', per_page:'10', page: 1 %}
{{ entries | json }}

Capsules the Links Content Delivery API

{% set navitems from links %}
{% for navitem in navitems.data.links %}
  {{ navitem[1].name }}
{% endfor %}

Tree

Capsules the Links Content Delivery API and transfers it into a traversable array.

<!-- Gets content entries and folders as tree (ex. for generating menus) -->
{% set navitems from tree %}
{% for navitem in navitems %}
  {{ navitem[1].item.name }}
  <ul class="sidenav">
    {% for i in navitem[1].children %}
      {% if i[1].children|length > 0 %}
      <li>
        {{ i[1].item.name }}
      </li>
      {% endif %}
    {% endfor %}
  </ul>
{% endfor %}

Documentation