{%- for block in section.blocks -%}
{%- case block.type -%}
{%- when '@app' -%}
{% render block %}
{%- when 'featured_image' -%}
{%- if article.image -%}
{%- endif -%}
{%- when 'title' -%}
{{ article.title | escape }}
{%- if block.settings.blog_show_date -%}
{{- article.published_at | time_tag: format: 'date' -}}
{%- endif -%}
{%- if block.settings.blog_show_author -%}
{{ article.author }}
{%- endif -%}
{%- when 'content' -%}
{{ article.content }}
{%- when 'share' -%}
{% assign share_url = request.origin | append: article.url %}
{% render 'share-button', block: block, share_link: share_url %}
{%- endcase -%}
{%- endfor -%}
{%- if blog.comments_enabled? -%}
{%- endif -%}
{% schema %}
{
"name": "t:sections.main-article.name",
"tag": "section",
"class": "section",
"blocks": [
{
"type": "@app"
},
{
"type": "featured_image",
"name": "t:sections.main-article.blocks.featured_image.name",
"limit": 1,
"settings": [
{
"type": "select",
"id": "image_height",
"options": [
{
"value": "adapt",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.options__1.label"
},
{
"value": "small",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.options__2.label"
},
{
"value": "medium",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.options__3.label"
},
{
"value": "large",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.options__4.label"
}
],
"default": "adapt",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.label",
"info": "t:sections.main-article.blocks.featured_image.settings.image_height.info"
}
]
},
{
"type": "title",
"name": "t:sections.main-article.blocks.title.name",
"limit": 1,
"settings": [
{
"type": "checkbox",
"id": "blog_show_date",
"default": true,
"label": "t:sections.main-article.blocks.title.settings.blog_show_date.label"
},
{
"type": "checkbox",
"id": "blog_show_author",
"default": false,
"label": "t:sections.main-article.blocks.title.settings.blog_show_author.label"
}
]
},
{
"type": "content",
"name": "t:sections.main-article.blocks.content.name",
"limit": 1
},
{
"type": "share",
"name": "t:sections.main-article.blocks.share.name",
"limit": 2,
"settings": [
{
"type": "text",
"id": "share_label",
"label": "t:sections.main-article.blocks.share.settings.text.label",
"default": "Share"
},
{
"type": "paragraph",
"content": "t:sections.main-article.blocks.share.settings.featured_image_info.content"
},
{
"type": "paragraph",
"content": "t:sections.main-article.blocks.share.settings.title_info.content"
}
]
}
]
}
{% endschema %}
{{ 'blogs.article.comments' | t: count: article.comments_count }}
{% paginate article.comments by 5 %}{{ 'blogs.article.comment_form_title' | t }}
{%- if form.errors -%}{%- for field in form.errors -%}-
{%- if form.errors.translated_fields[field] contains 'author' -%}
{{ 'blogs.article.name' | t }}
{%- elsif form.errors.translated_fields[field] contains 'body' -%}
{{ 'blogs.article.message' | t }}
{%- else -%}
{{ form.errors.translated_fields[field] }}
{%- endif -%}
{{ form.errors.messages[field] }}
{%- endfor -%}
{%- elsif form.posted_successfully? -%} {%- endif -%}{{ 'blogs.article.moderated' | t }}
{%- endif -%} {% endform %}