Change theme:   

Data

Represents custom data property of article, page or site. The values can be saved to corresponding objects using API and custom data javascript toolkit

For example page data under key "bgcolor" can be obtained from corresponding objects as follows:

{{ page.data.bgcolor }}
As data can be saved in JSON structure, the corresponding child objects are also accessible from template directly:

Saved JSON data:
{
    "bgcolor": "gold", 
    "bg" : {
        "image": "myimage.jpg",
        "width": "100px",
        "height": "100px" 
    },
    "fruits": ["apple", "orange", "lemon"]
}
In template:
BG color: {{ page.data.bgcolor }}<br/> 
BG Image: {{ page.data.bg.image }}<br/> 
 
// rendering all keys and values in object
{% for item in page.data.bg %}
    Key is: "{{ item[0] }}" and value is "{{ item[1] }}" <br/>
{% endfor %} 

// iterating arrays
{% for fruit in page.data.fruits %}
    {{ fruit }}, 
{% endfor %} 
Example output:
BG color:  gold
BG Image: myimage.jpg
Key is: "image" and value is "myimage.jpg"
Key is: "width " and value is "100px"
Key is: "height " and value is "100px"
apple, orange, lemon