Files
liquid/_posts/objects/article.md
2014-07-23 11:17:11 -04:00

5.2 KiB

layout, title, nav
layout title nav
default article
group
Liquid Variables

article

The article object has the following attributes:

{% table_of_contents %}

{% anchor_link "article.author", "article-author" %}

Returns the full name of the article's author.

{% anchor_link "article.comments", "article-comments" %}

Returns the published comments of an article. Returns an empty array if comments are disabled.

{% anchor_link "article.comments_count", "article-comments_count" %}

Returns the number of published comments for an article.

{% anchor_link "article.comments_enabled?", "article-comments_enabled?" %}

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

{% anchor_link "article.comment_post_url", "article-comment_post_url" %}

Returns the relative URL where POST requests are sent to when creating new comments.

Input

{% highlight html %}{% raw %} {{ article.comment_post_url }} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} /blogs/news/10582441-sale-starts-today/comments {% endraw %}{% endhighlight %}

{% anchor_link "article.content", "article-content" %}

Returns the content of an article.

{% anchor_link "article.created_at", "article-created_at" %}

Returns the timestamp of when an article was created. Use the date filter to format the timestamp.

Input

{% highlight html %}{% raw %} {{ article.created_at | date: "%a, %b %d, %y" }} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} Fri, Sep 16, 11 {% endraw %}{% endhighlight %}

{% anchor_link "article.excerpt", "article-excerpt" %}

Returns the excerpt of an article.

{% anchor_link "article.excerpt_or_content", "article-excerpt_or_content" %}

Returns article.excerpt of an article if it exists. Returns article.content if an excerpt does not exist for the article.

{% anchor_link "article.id", "article.id" %}

Returns the id of an article.

{% anchor_link "article.moderated?", "article-moderated?" %}

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

{% anchor_link "article.published_at", "article-published_at" %}

Returns the date/time when an article was published. Use the date filter to format the timestamp.

{% anchor_link "article.tags", "article-tags" %}

Returns all the tags for an article.

Input

{% highlight html %}{% raw %} {% for tag in article.tags %} {{tag}} {% endfor %} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} tag1 tag2 tag3 tag4 {% endraw %}{% endhighlight %}

{% anchor_link "article.title", "article-title" %}

Returns the title of an article.

{% anchor_link "article.url", "article-url" %}

Returns the relative URL of the article.

Input

{% highlight html %}{% raw %} {{ article.url }} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} /blogs/news/10582441-my-new-article {% endraw %}{% endhighlight %}

{% anchor_link "article.user.account_owner", "article-user-account_owner" %}

Returns "true" if the author of the article is the account owner of the shop. Returns "false" if the author is not the account owner.

{% anchor_link "article.user.bio", "article-user-bio" %}

Returns the bio of the author of an article. This is entered through the Staff members options on the Account page.

{% anchor_link "article.user.email", "article-user-email" %}

Returns the email of the author of an article. This is entered through the Staff members options on the Account page.

{% anchor_link "article.user.first_name", "article-user-first_name" %}

Returns the first name of the author of an article. This is entered through the Staff members options on the Account page.

{% anchor_link "article.user.last_name", "article-user-last_name" %}

Returns the last name of the author of an article. This is entered through the Staff members options on the Account page.

{% anchor_link "article.user.homepage", "article-user-homepage" %}

Returns the homepage of the author of an article. This is entered through the Staff members options on the Account page.