mirror of
https://github.com/kemko/liquid.git
synced 2026-01-03 08:45:42 +03:00
1.6 KiB
1.6 KiB
layout, title, nav
| layout | title | nav | ||
|---|---|---|---|---|
| default | part |
|
part
Each part returned by the paginate.parts array represents a link in the pagination's navigation.
{% block "note-information" %}
The part object is only accessible through the paginate object, and can only be used within paginate tags.
{% endblock %}
The example below shows how the part object's attributes can be accessed through a for loop that goes through the paginate.parts array.
Input
{% highlight html %}{% raw %}
{% for part in paginate.parts %}
{% if part.is_link %}
{{ part.title | link_to: part.url}}
{% endif %}
{% endfor %}
{% endraw %}{% endhighlight %}
Output
The part object has the following attributes:
{% anchor_link "part.is_link", "part-is_link" %}
Returns true if the part is a link, returns false if it is not.
{% anchor_link "part.title", "part-title" %}
Returns the title of the part.
{% anchor_link "part.url", "part-url" %}
Returns the URL of the part.