{# CONTEXT MODULE #} {# Vars #} {% set p = page %} {% set context = p.context %} {% set page_description = p.description %} {% set content = (p.include.content_prepend|trim ~ ' ' ~ p.content ~ ' ' ~ p.include.content_append|trim)|replace({'{{files}}': assetspath ~ '/content/custom/files', '[contact]' : '
'})|trim|escapecode %} {# Date #} {% set date = p.date|default(p.updated) %} {% if page.settings.date_format == 'timeago' %} {% set date_formatted = date|date("d F Y") %} {% set date_class = 'date timeago' %} {% else %} {% set date_formatted = date|date(page.settings.date_format|default('d F Y')) %} {% set date_class = 'date' %} {% endif %} {% set time_tag = '' %} {# Set items order #} {# title,label,amount,folder_amount,date,preview,description,content #} {% set items = context.items|split(',') %} {# Output items #} {% for item in items %} {# Title #} {% if item == 'title' %}

{{ page_title }}

{% endif %} {# Label #} {% if item == 'label' %}

{{ page.label }}

{% endif %} {# Amount #} {% if item == 'amount' %} {% set amount = gallery_images|length %}
{{ amount }} {{ pluralize(amount, 'image', 'images') }}
{% endif %} {# Folders Amount #} {% if item == 'folders_amount' %} {% set folders_amount = folder.children_count %}
{{ folders_amount }} {{ pluralize(folders_amount, 'album', 'albums') }}
{% endif %} {# Date #} {% if item == 'date' %}
{{time_tag}}
{% endif %} {# Description #} {% if item == 'description' and page_description is not empty %}

{{ page_description }}

{% endif %} {# Preview #} {% if item == 'preview' %} {# Crop #} {% if context.crop.enabled %} {% set crop_ratio = context.crop.crop[1] / context.crop.crop[0] * 100 %} {% set data_crop = ' data-crop="' ~ context.crop.crop[0] ~ '.' ~ context.crop.crop[1] ~ '"' %} {% endif %} {# preview url #} {% set preview_image_url = assetspath ~ preview_image|trim(".") %} {# preset dimensions and ratio if using default preview from /app/ #} {% if preview_img == './app/public/images/default.png' %} {% set imgInfo = [1280, 1280] %} {% set image_ratio = 100 %} {% else %} {% set imgInfo = getimginfo(preview_image) %} {% set image_ratio = crop_ratio|default(imgInfo[1]/imgInfo[0] * 100) %} {% endif %} {# Output #}
{# Caption #} {% if context.caption.enabled %}
{# title, label, amount, folder_amount, date, description, content #} {% set caption_items = context.caption.items|split(',') %} {# loop items #} {% for item in caption_items %} {# Title #} {% if item == 'title' %} {{ page_title|replace({'': '', ' href=': ' data-href=', ' target=': ' data-target='}) }} {% endif %} {# Label #} {% if item == 'label' %} {{ page.label }} {% endif %} {# Amount #} {% if item == 'amount' %} {% set amount = gallery_images|length %} {{ amount }} {{ pluralize(amount, 'image', 'images') }} {% endif %} {# Folder Amount #} {% if item == 'folders_amount' %} {% set folders_amount = folder.children_count %} {{ folders_amount }} {{ pluralize(folders_amount, 'album', 'albums') }} {% endif %} {# Date #} {% if item == 'date' %} {{time_tag}} {% endif %} {# Description #} {% if item == 'description' and page_description is not empty %} {{ page_description|replace({'': '', ' href=': ' data-href=', ' target=': ' data-target='}) }} {% endif %} {# Content #} {% if item == 'content' and content is not empty %} {{ content }} {% endif %} {% endfor %}
{% endif %}
{% endif %} {# Content #} {% if item == 'content' and content is not empty %} {#{% set text_align = 'text-left' %}
{{ content }}
#}
{{ content }}
{% endif %} {% endfor %}