ComboStrap UI - Template

About

template are text that may contains variables that are replaced at runtime.

They are supported:

Example

Printing information about the actual page

The below template text inside a template component will print a bullet list with the title and path of the actual page.

<template>
  * Title: $title
  * Path: $path 
</template>

  • Title: Template
  • Path: :docs:templating:template

With pipeline

Example of template text that you could used in a page-explorer navigation panel.

It will create:

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

Result:

The Template page.

Syntax

Template Text

A template text can contains any component and zero or more variable (that supports text transformation through the use of a pipeline)

A template text with a $variable

Template component

A template component contains a template text

<template>
The template text with $variable
</template>

If this is a standalone template component, the variable are replaced with the values of the actual requested page, otherwise they are replaced by the value of the requested data (ie in a iterator)

Variable

A variable is the name of an attribute prefixed with the $ dollar character.

Example:

  • for the path attribute
  • the variable would be $path
Powered by ComboStrap