Difference between revisions of "Liquid Template Variables - pages"

From Spiffy Stores Knowledge Base

m
 
(2 intermediate revisions by 2 users not shown)
Line 9: Line 9:
 
This example allows you to access the content of the '''about''' page.
 
This example allows you to access the content of the '''about''' page.
  
This can be used to "imbed" pages within any other template, or even the layout.
+
This can be used to "embed" pages within any other template, or even the layout.
 +
 
 +
== <code>pages.size</code> ==
 +
 
 +
This returns the number of pages 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 12:14, 25 June 2018

The liquid variable pages contains a collection of all of the store's pages.

You can access any page by using the page handle to index the pages contained within the pages variable.

<h1>{{ pages.about.title }}</h1>
<p>{{ pages.about.author }} says...</p>
<div>{{ pages.about.content }}</div>

This example allows you to access the content of the about page.

This can be used to "embed" pages within any other template, or even the layout.

pages.size

This returns the number of pages that have been published.

Further Reference