Skip to main content

article

An article, or blog post, in a blog.

Properties

Anchor to
author

The full name of the author of the article.

Anchor to
comment_post_url

The relative URL where POST requests are sent when creating new comments.

Anchor to
comments
array of comment

The published comments for the article.

Returns an empty array if comments are disabled.

Tip

Use the paginate tag to choose how many comments to show at once, up to a limit of 50.

Anchor to
comments_count

The number of published comments for the article.

Anchor to
comments_enabled?

Returns true if comments are enabled. Returns false if not.

Anchor to
content

The content of the article.

Anchor to
created_at

A timestamp for when the article was created.

Tip

Use the date filter to format the timestamp.

Anchor to
excerpt

The excerpt of the article.

Anchor to
excerpt_or_content

Returns the article excerpt if it exists. Returns the article content if no excerpt exists.

Anchor to
handle

The handle of the article.

Anchor to
id

The ID of the article.

Anchor to
image

The featured image for the article.

Anchor to
metafields

The metafields applied to the article.

Tip

To learn about how to create metafields, refer to Create and manage metafields or visit the Shopify Help Center.

Anchor to
moderated?

Returns true if the blog that the article belongs to is set to moderate comments. Returns false if not.

Anchor to
published_at

A timestamp for when the article was published.

Tip

Use the date filter to format the timestamp.

Anchor to
tags
array of string

The tags applied to the article.

Example
Show the total tag count

When looping through article.tags, you can print how many times a tag is used with tag.total_count. 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 %}

Output

clear potions (1)potion troubleshooting (2)tips (2)
Anchor to
template_suffix

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.

Anchor to
title

The title of the article.

Anchor to
updated_at

A timestamp for when the article was updated.

Tip

Use the date filter to format the timestamp.

Anchor to
url

The relative URL of the article.

Anchor to
user

The user associated with the author of the article.

{
"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": {}
}
Was this section helpful?