QuillObjects
Policy
The policy object for legal pages like privacy, terms, and returns.
The policy object holds a legal page like your privacy notice, terms of use, or return rules. These are stored apart from normal pages and each one has a type.
Properties
| Property | Type | Description |
|---|---|---|
policy.id | number | The unique policy ID |
policy.title | string | The policy title |
policy.handle | string | The URL slug |
policy.url | string | The full URL path |
policy.policy_type | string | The type of policy (see below) |
policy.content | string | The body text as HTML |
policy.published_at | string | When it was last saved |
Policy types
| Type | Description |
|---|---|
privacy_policy | Privacy notice |
terms_and_conditions | Terms of use |
returns_and_refunds | Return and refund rules |
shipping_policy | Shipping info |
cookie_policy | Cookie notice |
accessibility_statement | Access needs |
custom | Any other type |
Listing all policies
Use the global policies array to list all your live pages. This is most often used in the footer:
<ul class="footer-policies">
{% for policy in policies %}
<li><a href="{{ policy.url }}">{{ policy.title }}</a></li>
{% endfor %}
</ul>Showing a specific policy
On a single policy page, show the title, body, and date:
<article class="policy">
<h1>{{ policy.title }}</h1>
<div class="policy-content">
{{ policy.content }}
</div>
{% if policy.published_at %}
<p class="policy-date">Last updated {{ policy.published_at | date: '%d %B %Y' }}</p>
{% endif %}
</article>Footer links by type
You can check the type to show each link with its own label:
{% for policy in policies %}
{% if policy.policy_type == 'privacy_policy' %}
<a href="{{ policy.url }}">Privacy</a>
{% elsif policy.policy_type == 'terms_and_conditions' %}
<a href="{{ policy.url }}">Terms</a>
{% elsif policy.policy_type == 'returns_and_refunds' %}
<a href="{{ policy.url }}">Returns</a>
{% endif %}
{% endfor %}