Gallery
The gallery
object has the following attributes:
listing.galleries
Returns all albums of that listing.
Input
<ul>
{% for listing in listing.galleries %}
<li>{{ gallery.name }}</li>
{% endfor %}
</ul>
Output
<ul>
<li>Album1</li>
<li>Album2</li>
</ul>
gallery.images
Returns an array of the gallery’s images. Use the attachment_url filter to link to the image on Yoolk’s Content Delivery Network. [Optional]
Input
{% for image in gallery.images %}
{{ image | attachment_url: 'medium' | image_tag }}
{% endfor %}
Output
<img src="http://s-yoolk-images1.yoolk.com/kh/gallery_images/medium/1367097277/1250047?1367097277" />
gallery.current?
Returns true if this gallery is the one which is currently displayed.
Input
<ul class="nav">
{% for gallery in listing.galleries %}
<li>
<a href="{{ gallery.url }}" {% if gallery.current? %}class="active"{% endif %}>{{ gallery.name }} ({{ gallery.images.count }})</a>
</li>
{% endfor %}
</ul>
Output
<ul class="nav">
<li><a href="/galleries/1" class="active">Album1</a></li>
<li><a href="/galleries/2">Album2</a></li>
</ul>