Difference between revisions of "Liquid Template Variables - blogs"

From Spiffy Stores Knowledge Base

(New page: The liquid template variable ''blogs'' contains a collection of all of this shop’s blogs and articles. By calling a blog’s handle on the ''blogs'' variable, you will either receive ...)
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
The liquid template variable ''blogs'' contains a collection of all of this shop’s blogs and articles.
+
The Liquid template variable '''blogs''' contains a collection of all of this store’s [[Liquid Template Variables - blog|blogs]].
  
 
By calling a blog’s handle on the ''blogs'' variable,  you will either receive a blog object.
 
By calling a blog’s handle on the ''blogs'' variable,  you will either receive a blog object.
Line 11: Line 11:
  
 
This lists all article titles for the blog called '''myblog'''.
 
This lists all article titles for the blog called '''myblog'''.
 +
 +
== <code>blogs.size</code> ==
 +
 +
This returns the number of blogs that have been published.
 +
 +
== Further Reference ==
 +
 +
* [[Liquid Basics]]
 +
* [[Liquid Tag Reference]]
 +
* [[Liquid Filter Reference]]
 +
* [[Liquid Variable Reference]]
 +
* [[Liquid Paginate Tag|Pagination ]]

Latest revision as of 13:14, 25 June 2018

The Liquid template variable blogs contains a collection of all of this store’s blogs.

By calling a blog’s handle on the blogs variable, you will either receive a blog object.

For example:

<ul>
{% for article in blogs.myblog.articles  %}
  <li>{{ article.title }}</li>
{% endfor %}
</ul>

This lists all article titles for the blog called myblog.

blogs.size

This returns the number of blogs that have been published.

Further Reference