Difference between revisions of "Liquid Template Variables - page"
From Spiffy Stores Knowledge Base
m (→page.title) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
== <code>page.title</code> == | == <code>page.title</code> == | ||
+ | Returns the title of this page. | ||
+ | == <code>page.published</code> == | ||
+ | Return <i>true</i> if the page is published. | ||
+ | == <code>page.published_at</code> == | ||
+ | Returns the timestamp of when the page was created. Use the date filter to format the timestamp. | ||
− | Returns the | + | == <code>page.author</code> == |
+ | Returns the author of the last user who updated or created the page. | ||
== <code>page.content</code> == | == <code>page.content</code> == | ||
Line 42: | Line 48: | ||
Metafields can only be managed using the Spiffy Stores API. | Metafields can only be managed using the Spiffy Stores API. | ||
+ | |||
+ | == Further Reference == | ||
+ | |||
+ | * [[Liquid Basics]] | ||
+ | * [[Liquid Tag Reference]] | ||
+ | * [[Liquid Filter Reference]] | ||
+ | * [[Liquid Variable Reference]] | ||
+ | * [[Liquid Paginate Tag|Pagination ]] |
Latest revision as of 10:36, 23 March 2022
The Liquid template variable page has the following attributes:
Contents
page.id
Returns the unique internal number of the page.
This is normally only for internal usage.
page.handle
This is the page handle. The handle uniquely identifies the page in the URL address.
The handle is usually the page's title in lower case with all blanks replaced by a dash. "My Pretty Page" would have the handle "my-pretty-page".
page.title
Returns the title of this page.
page.published
Return true if the page is published.
page.published_at
Returns the timestamp of when the page was created. Use the date filter to format the timestamp.
page.author
Returns the author of the last user who updated or created the page.
page.content
Returns the content of this page.
page.url
The is the relative URL address of the page.
page.type
Returns the type of the object, in this case, 'page'.
page.image
The image associated with a page is automatically extracted from the page text. It's usual to embed images in a page as this gives you full control on the appearance of the page. When you embed an image within the page text, the URL of the first such image will be returned.
page.images_count
Return the number of images associated with this page. If an image is found within the text of the page, a value of 1 will be returned. Otherwise, 0 is returned.
page.metafields
Return the metafields for the page.
Metafields can only be managed using the Spiffy Stores API.