The variables that can be used anywhere

Undraw Building Websites I78t

About

Variables in Combostrap are first-class citizen meaning that you can use them anywhere.

Example

Without Transformation

The below markup will print:

  * Title: ''$title''
  * Path: ''$path''

Output

  • Title: The variables that can be used anywhere
  • Path: :docs:templating:variable

With pipeline transformation

You can transform the variable by using the pipeline syntax

It will create:

  • a link
  • with a pipeline
  • that separate the h1 with the minus -
  • and used the second part as link description
The [[$path| ${h1 | cut("-","2-") | trim()} page]].

Result:

Variable List

The supported variable are:

  • path is the full qualified path of a page that can be used in a page link as reference
  • 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.
  • description - the description - a long description
  • label - the label - a short description
  • keyword - the page keywords
  • date_created - the creation date
  • date_modified - the modification date
  • date_published - the publication 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
  • backlink_count - the number of backlinks
  • type - the type of 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
  • depth - the maximum difference between the level of the current page and the selected page (page sql only attribute)
  • 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.




Showcase yourself and your brand

Get free news, tips, and tricks
to create a remarkable experience for your readers.




Related HowTo's
Undraw Animating
How can I generate a list of pages?

This howto shows you how you can generate a list of pages with the iterator components. page sql a list element with a link created from: the path and the title variables ...
Combostrap Default Theme File Explorer
How to create your own theme?

This page shows you how to create your own theme. You can then apply advanced design and logic to your whole website application. Combostrap uses a theme system where: each page has its own template...
How to format a date ?

This page shows you how to format a date.
Undraw Animating
How to generate a list of events?

This howto shows you how you can generate a list of pages event with the iterator components. page sql a list element with the date_start and date_end formated date of a page event...
Undraw Animating
How to generate and layout a list of pages with a grid and their image?

This howto shows you how to use the page sql, a fragment, the iterator and to generate a grid layout.


Recommended Pages
Backlink Action
Backlinks management in ComboStrap

Backlinks are important because they give extra-navigation possibilities and gives also more weight to pages. This article tell you everything about backlinks in ComboStrap
Undraw Building Websites I78t
ComboStrap Pipeline

A pipeline permits to transform a variable value with a succession of transformation function.
Undraw File Analysis 8k9b
Date

This page describes date management in ComboStrap ComboStrap supports the following date metadata: creation date modification date published date All dates are available as variable that you...
Undraw My Documents
H1 - A shorter version of the title

The H1 is the text of the first header and can be used in template within a list of link.
How to define your data set with Sql

This page defines the sql that can be used to retrieve data from pages
Undraw My Documents
Lead

The lead is an appealing text that is generally used below the page title. It's also known as the tagline. You can set it by setting a lead property in the metadata manager By default: the lead...
Undraw My Documents
Page KeyWords

keywords are a couple of words that are relevant to the content of your page. They are added to the generated HTML page. It was requested for SEO purpose but they have really little effect as they were...
Surfer600
Page-image Component: Renders the illustrative image of your page

Page-image is a component that renders the illustrative image of the page and is generally used in a fragment.
Undraw Building Websites I78t
Simple Templating markup

Simple templating markup are markups that you can use inside the content of your page: to show information your pages or to show a list of pages Templating offers the following components: ...
Undraw My Documents
The label

is a short description of a page. It's generally used in a listing such as a table cell. Its length should be a couple of words while the description may flow on several lines. By default, the value...



Task Runner