Of all the data you’ll use to build Hot Ink templates, probably the most important is the data associated with your newspaper itself. The “newspaper drop” is available and contains the same data on all templates and no matter what the context.
To learn more about Liquid, the templating language used by Hot Ink, read the Liquid wiki at http://wiki.github.com/tobi/liquid
Your newspaper’s drop is the main piece of data used for building your template’s structure. If you’re interested in fleshing out your template with a little more data, be sure to take a good look at what’s inside this drop. We’re still adding new features to the site, so look forward to this drop expanding significantly over the next few month.
Before getting into exactly what data is included in the newspaper drop, it’s important to note one key detail: your newspaper drop does NOT contain real-time data. That is, the data in this drop is not reloaded with each user/reader page-view. The newspaper drop contains a wide selection of data, such a wide selection that reloading it all with each page view would slow down your site’s performance significantly. Instead, the various pieces of data in this drop are loaded at a regular frequency from your newspaper’s Hot Ink archive.
This means that changes made in your archive to the data in this drop can take a few minutes to become reflected on your site’s front page. If you add a category/section to your paper, for example, it may take a few minutes to for that category/section to appear on your site’s front page.
The newspaper drop includes the following data:
newspaper.name - the name of your newspaper’s account
newspaper.homepage_url - the relative url of your site’s front page, used to link back to it.
newspaper.root_url - the root url of your site that’s used to build composite urls, ie <a href=”{{newspaper.root_url”/blogs”}}>Blogs</a>.
This sometimes differs in value from the homepage url, so be sure you’re using the right one.
newspaper.pages - your newspapers static pages, as created under the “Pages” link under Hot Ink “Publisher” tab.
newspaper.blogs - an array of your newspaper’s blogs, each returned in a Blog drop, detailed in an upcoming post
newspaper.latest_issue - the most recently dated issue of your paper.
Issues are available in an issue drop, detailed in an upcoming post.
newspaper.latest_issues - the 15 most recent issues of your publication.
newspaper.latest_by_section[section_name] - a hash, keyed by section name, of the 5 most recent articles from each of your newspaper’s main categories. Can be used in liquid for loops (ie {% for section in newspaper.sections %}{% for article in newspaper.latest_by_section [section.name] %} {% endfor %}{% endfor %}) Read up on hashes in the Liquid wiki, linked above, to learn more about this technique.
newspaper.latest_entries - Your paper’s 5 most recent blog entries, each returned in an “article drop” but with an array of blogs this entry is a member of returned as well. You can access an entry’s blogs through the array “entry.blogs” (technically, an entry can be in
multiple blogs, so we use an array).
newspaper.latest_by_blog[blog_name] - a hash, keyed by blog title, of the 5 most recent entries from each of your newspaper’s blogs. Can be
used in liquid for loops (ie {% for blog in newspaper.blogs %}{% for entry in newspaper.latest_from_blog[blog.title] %} {% endfor %}{% endfor %}).
