ComboStrap UI - Template
Table of Contents
About
template are text that may contains variables that are replaced at runtime.
They are supported:
- in its own template component (to print information of the requested page)
- in the page explorer component (to print information of the page on the file system)
- in the iterator component (to print information of selected pages)
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)