Templating - Variables
About
Variables in Combostrap are first-class citizen meaning that you can use them anywhere.
Example
The below markup will print:
-
with the variables:
title and
path of the actual page.
* Title: ''$title''
* Path: ''$path''
Output
You can transform the variable by using the pipeline syntax
It will create:
The [[$path| ${h1 | cut("-","2-") | trim()} page]].
Result:
Variable List
The supported variable are:
-
title - the
title of the page - if empty, the
h1
lead - the
lead of the page (tagline)
name - the
name of the page - if empty, the last part of the id
h1 - the
h1 title (the first header text of the page) - if empty, the
title.
-
label - the
label - a short description
-
date_created - the creation date
date_modified - the modification date
-
date_start - the start date of an
event
date_end - the end date of an
event
word_count - the number of word in a page
-
-
is_low_quality - a boolean that is set to 1 if the page is of
low quality
lang - the
lang of a page
is_index - a boolean that is set to 1 if the page is a
index page
slug - the
slug of the page
level - the
level of the page in the file system tree
-
now - the actual date (note that if the page is
cached, the
now date will be the date of the rendering)
And all frontmatter metadatas that are scalar (ie no array). Basically, all metadata that can be seen in the scalar metadata node of the analytics data can be used as attribute.
Value
By default all variables are filled with the value of the requested page.
When used inside a iterator fragment, they get the values of the selected page.
Parent Variable
You can retrieve parent page data with the hierarchical breadcrumb.