Template Plugin
The template plugin gives flexibility to change template data at a later time in the page.
template:title
Get the title generated or set for the template.
{{ template:title }}
page:title
because this will be shown on all pages while page:title
is only specific to the Pages module.template:set_title
Sets the page title to the passed in value. You can separate multiple sections with commas. Each call to this method will replace any prior title text.
{{ template:set_title value="My Custom Page Title, Another Segment" }}
Attributes
Name | Default | Required | Description |
---|---|---|---|
value | Yes | Comma separated string for title segments |
template:set_metadata
Set metadata for various meta tags. This will overwrite any existing tags set with the same name.
{{ template:set_metadata name="description" value="My Description" type="meta" }}
Attributes
Name | Default | Required | Description |
---|---|---|---|
name | Yes | Meta tag name attribute |
|
value | Yes | Meta tag value attribute |
|
type | meta | No | meta , link , or og |
template:set_breadcrumb
Add items to the breadcrumb or replace all and start over.
{{ template:set_breadcrumb name="My Page" uri="some-page" reset="true" }}
Attributes
Name | Default | Required | Description |
---|---|---|---|
name | Yes | Text to display in the breadcrumb segment | |
uri | Yes | Full URI path to the page for this item. Set to an empty string "" if this is the current page. |
|
reset | false | No | Reset or clear and previous breadcrumbs |
template:partial
Load a template partial previously set with $this->template->set_partial()
or $this->template->inject_partial()
.
{{ template:partial name="sidebar" }}
theme:partial
instead.Attributes
Name | Default | Required | Description |
---|---|---|---|
name | Yes | Name you previously set the partial under |
template:has_partial
Check if a template partial exists. If it does, parse the content inside the tags where {{ partial }}
will be the partials contents. Template partials are set with $this->template->set_partial()
or $this->template->inject_partial()
.
{{ template:has_partial name="sidebar" }}
<h2>Sidebar</h2>
{{ partial }}
{{ /template:has_partial }}
Attributes
Name | Default | Required | Description |
---|---|---|---|
name | Yes | Name you previously set the partial under |
template:has_breadcrumbs
Check if the template has breadcrumbs set.
{{ if {template:has_breadcrumbs} }}
{{ template:breadcrumbs }}
{{ if uri }}
{{ url:anchor segments=uri title=name }}
{{ else }}
{{ name }}
{{ endif }}
{{ /template:breadcrumbs }}
{{ endif }}
template:metadata
Get the meta tags of the page, in a string.
{{ template:metadata }}