Templates are reusable content blocks that can be inserted into multiple pages. They help maintain consistency and reduce duplication across the wiki. Templates can contain text, LGWL markup, and even dynamic logic using modules.
Using Templates
To include a template in a page, use double curly braces around its name:
{{TemplateName}}
You can also pass parameters to customize how the template behaves:
{{TemplateName|parameter1=value1|parameter2=value2}}
Example
Suppose there is a template called Infobox that displays structured data about a topic.
You can use it like this:
{{Infobox
| title = Example Item
| description = A simple example of using templates.
| image = example.png
}}
This will render a formatted information box using the template’s layout.
Creating Templates
Templates are stored in the Template namespace.
To create one:
- Go to Template:YourTemplateName.
- Add the content you want to reuse across pages.
- Save the page.
Once saved, the template can be included anywhere using its name.
Template Parameters
Templates can use parameters to display dynamic values.
Inside a template, parameters are accessed using triple braces.
Parameters can be either named or nameless.
For example:
Inside Template:Example
Value of {{{1}}}: {{{value}}}
Usage:
{{Example|Current Page|value=Hello World}}
The result will show:
Value of Current Page: Hello World
Magic Words (Built-in Templates)
Magic Words are built-in, system-defined templates and variables provided by the LiveGobe Wiki System (LGWS). They allow you to dynamically pull system data, track page metadata, or change the structural behavior of a page without manual updates.
Types of Magic Words
Magic Words generally fall into two categories:
- Variables: Return dynamic structural text data (like the current page title).
- Behavior Switches: Change the layout or rendering settings of the page.
Core Variables
Variables are called exactly like standard templates, using double curly braces. They output dynamic system strings.
| Syntax | Description | Example Output |
|---|---|---|
{{PAGENAME}} | Returns the current page title without namespaces. | LiveGobe Wiki Language |
{{FULLPAGENAME}} | Returns the full page title including its namespace prefix. | Help:LiveGobe Wiki Language |
{{NAMESPACE}} | Returns only the namespace prefix of the active page. | Help |
{{BASEPAGENAME}} | Returns only the last part in the page's path, take a page Modules/Reference. | Reference |
{{PAGELANGUAGE}} | Returns 2-letter language code of the page. | en |
{{SITENAME}} | Displays the configured name of the wiki platform. | LiveGobe Wiki |
Date and Time Variables
These variables help you track revisions, display timestamps, or create timezone-aware data tables.
| Syntax | Description |
|---|---|
{{DATE}} | Outputs the current ISO date. |
{{TIME}} | Outputs the current time. |
Behavior Switches
Behavior switches are specialized magic words often wrapped in double underscores __SWITCH__. They do not display visual text but directly modify how the LGWS engine interprets the page.
__NOTOC__: Hides the automated Table of Contents (TOC) box regardless of heading count.__NOINDEX__: Makes the page non-discoverable for search engines, like Google.
Escaping Magic Words
If you need to show a magic word as raw text to documentation readers without executing its code, wrap it in <nowiki> blocks or use the bracket/brace escape templates:
Advanced Templates
Templates can include other templates or use logic defined in Modules.
This allows creation of dynamic and data-driven templates, such as infoboxes, navigation bars, or data tables.
Best Practices
- Use templates for content repeated across many pages.
- Keep template names short and descriptive.
- Document each parameter in a comment or documentation subpage.
- Avoid overly complex templates unless needed for layout consistency.