article
An article, or blog post, in a blog.
Properties
The full name of the author of the article.
The relative URL where POST requests are sent when creating new comments.
The published comments for the article.
Returns an empty array if comments are disabled.
TipUse the paginate tag to choose how many comments to show at once, up to a limit of 50.
The content of the article.
A timestamp for when the article was created.
TipUse the
date
filter to format the timestamp.- metafields
The metafields applied to the article.
TipTo learn about how to create metafields, refer to Create and manage metafields or visit the Shopify Help Center.
Returns
true
if the blog that the article belongs to is set to moderate comments. Returnsfalse
if not.A timestamp for when the article was published.
TipUse the
date
filter to format the timestamp.The tags applied to the article.
ExampleShow the total tag countWhen looping through
article.tags
, you can print how many times a tag is used with. This number shows visitors how many blog posts have been tagged with a particular tag.
{% for tag in article.tags -%}{{ tag }} ({{ tag.total_count }}){%- endfor %}{% for tag in article.tags -%} {{ tag }} ({{ tag.total_count }}) {%- endfor %}
{ "article": { "tags": [ "clear potions", "potion troubleshooting", "tips" ] } }
Output
clear potions (1)potion troubleshooting (2)tips (2)The name of the custom template assigned to the article.
The name doesn't include the
article.
prefix, or the file extension (.json
or.liquid
).If a custom template isn't assigned to the article, then
nil
is returned.A timestamp for when the article was updated.
TipUse the
date
filter to format the timestamp.
{
"author": "Polina Waters",
"comment_post_url": "/blogs/potion-notions/how-to-tell-if-you-have-run-out-of-invisibility-potion/comments",
"comments": [],
"comments_count": 1,
"comments_enabled?": true,
"content": "<p>We've all had this problem before: we peek into the potions vault to determine which potions we are running low on, and the invisibility potion bottle looks completely empty.</p>\n<p>...</p>\n<p>Â </p>",
"created_at": "2022-04-14 16:56:02 -0400",
"excerpt": "And where to buy <strong>more</strong>!",
"excerpt_or_content": "And where to buy <strong>more</strong>!",
"handle": "potion-notions/how-to-tell-if-you-have-run-out-of-invisibility-potion",
"id": 556510085185,
"image": {},
"metafields": {},
"moderated?": true,
"published_at": "2022-04-14 16:56:02 -0400",
"tags": [],
"template_suffix": "",
"title": "How to tell if you're out of invisibility potion",
"updated_at": "2022-06-04 19:27:33 -0400",
"url": {},
"user": {}
}