Difference between revisions of "Blog.liquid"

From Spiffy Stores Knowledge Base

(New page: This template renders a blog and its articles. Blogs are a collection of articles. Each blog can have its own feed (RSS and/or Atom) that visitors can subscribe to. You will want to iter...)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
This template renders a blog and its articles.
+
This template renders a [[Liquid Template Variables - blog|blog]] and its [[Liquid Template Variables - article|articles]].
  
 
Blogs are a collection of articles. Each blog can have its own feed (RSS and/or Atom) that visitors can subscribe to.
 
Blogs are a collection of articles. Each blog can have its own feed (RSS and/or Atom) that visitors can subscribe to.
Line 15: Line 15:
  
 
* [[Liquid Template Variables - blog|blog]] - The current blog being displayed.
 
* [[Liquid Template Variables - blog|blog]] - The current blog being displayed.
* [[Liquid Template Variables - handle|handle]] - The handle of the blog product.
+
* [[Liquid Template Variables - handle|handle]] - The handle of the blog.
  
 
In addition, all [[Liquid Variable Reference#Global objects|global variables]] are available.
 
In addition, all [[Liquid Variable Reference#Global objects|global variables]] are available.

Latest revision as of 19:08, 16 September 2008

This template renders a blog and its articles.

Blogs are a collection of articles. Each blog can have its own feed (RSS and/or Atom) that visitors can subscribe to.

You will want to iterate through all the articles of a blog to show their content:

{% for article in blog.articles  %}
   ...do things with article, e.g. render its content with
   {{ article.content }}
{% endfor %}

Variables

In blog.liquid you have access to the following variables:

  • blog - The current blog being displayed.
  • handle - The handle of the blog.

In addition, all global variables are available.