marc-leopold/cms/themes/marc-leopold-api/pages/albums.htm

46 lines
1.4 KiB
HTML
Raw Normal View History

2019-02-25 14:26:11 +00:00
title = "Galleries"
url = "/api/v1/galleries"
is_hidden = 0
contentType = "json"
force_show = 0
[albumList]
albumPage = "album"
thumbMode = "auto"
thumbWidth = 640
thumbHeight = 480
albumsOnPage = 12
==
{
"success": true,
"title": "My Galleries",
"galleries": [
{% for album in albumList.albums %} {
"id": {{ album.id }},
"title": "{{ album.title }}",
"url": "{{ album.url }}",
"featuredImage": "{{ album.latestPhoto.thumb }}",
"created": "{{ album.created_at|date('M d, Y') }}",
"count": {{ album.photo_count }},
"images": [
{% for photo in album.photos %} {
"id": {{ photo.id }},
"thumbUrl": "{{ photo.image.thumb(600,400,{'mode': 'crop'}) }}",
"url": "{{ photo.image.path }}",
"sort_order": "{{ photo.image.sort_order }}"
}{% if not loop.last %},{% endif %} {% endfor %}
]
}{% if not loop.last %},{% endif %} {% endfor %}
]
{% if albumList.lastPage > 1 %}
{% if albumList.currentPage > 1 %}
"next": {{ this.page.baseFileName|page }}?page={{ albumList.currentPage-1 }}"
{% endif %}
{% if albumList.lastPage > albumList.currentPage %}
"prev": "{{ this.page.baseFileName|page }}?page={{ albumList.currentPage+1 }}"
{% endif %}
{% endif %}
}