When working with Liquid, the Hot Ink templating system, each type of object (like an article, a mediafile, an issue or even your newspaper itself) has data associated with it that’s available for use in your templates. Which piece of data is available depends on which template your working in, but perhaps the simplest case is a Hot Ink article page template. On each article template there’s a variable called “article” representing the article requested by the user.
You access the data using what’s called “dot-syntax” which really just means that the data is in the format “variable_name.data”. To output data in a template, you should use liquid output tags (they look like this: {{ your_data_here }} or {{ article.title }} ). Follow the liquid link above for a better idea of how to use data in your templates, including how to use for loops on arrays (a common task).
For each article the following data is available:
article.title - an article’s title or headline
article.subtitle - an article’s subtitle, subheadline or ‘deck’
article.authors_list - a formatted list of an article’s authors
article.id - an article’s unique Hot Ink id number
article.mediafiles - an array of an articles attached mediafiles
(including both articles and images). Follow the Liquid link above to
learn how to work with arrays.
article.images - an array of an articles attached images
article.audiofiles - an array of an articles attached audiofiles
article.published_at - a Gmail style date for the article (ie.
“12:33pm” for a recent article, “Apr 2″ for one this past April and
“12/28/08″ for one last December)
article.published_at_detailed - a detailed date output for this
article, useful with the Liquid “date” filter for custom date
formatting.
article.section - the name of the article’s primary section
article.categories - an array of all the sections (also called
categories) this article is a member of.
article.excerpt - either the article’s summary or truncated article
bodytext if no summary is present. Use Liquid’s truncatewords filter
to cutomize its length.
article.bodytext - the article’s full text. Since Hot Ink stores all
text formatted with “Markdown” you should use the “markdown” filter to
display bodytext (ie {{ article.bodytext | markdown }}).
article.url - the url of the article.
article.issues - an array of issues that this article was printed in
article.comments - an array of this article’s comments
Additions to the article drop:
article.tags - an array of this article’s tags.
article.tags_list - a tag-delimited list of this article’s tags
article.tags_list_with_links - a tag-delimited list of this article’s
tags with each tag name linking to a search for that tag.
article.authors - an array of this article’s authors.
article.authors_list_with_
commas and ‘and’) of this article’s authors with each author’s name
linking to a search for that author.
article.comment_count - the number of comments on this article.
article.comments_locked - a boolean (true/false) value returning
whether or not this article’s comments are locked. Generally, if
comments on an article are locked the article’s comments will display,
but no new comments can be added.
article.comments_enabled - a boolean value returning whether or not
this article’s comments are enabled. Generally, if comments on an
article are enabled they are visible to the reader. If they are
disabled then no comments display and no comments can be added.
entry.blogs - blog entries also use the article drop. When accessing a
blog entry you’ll have access to this variable which is an array of
blogs that this entry belongs to. Most entries will belong to only one
blog, which you can access conveniently as ‘entry.blogs.first’
