VOOZH about

URL: https://docs.silverstripe.org/en/4/developer_guides/templates/

⇱ Templates and Views | Silverstripe CMS Documentation


Version 4End of Life

This version of Silverstripe CMS will not receive any additional bug fixes or documentation updates.

Go to documentation for the most recent stable version

Templates and views#

Most of what will be public on your website comes from template files that are defined in Silverstripe CMS. Either in the core framework, the modules or themes you install, and your own custom templates.

Silverstripe CMS templates are simple text files that have an .ss extension. They can contain any markup language (e.g. HTML, XML, JSON..) and are processed to add features such as $Var to output variables and logic controls like <% if $Var %>. In this guide we'll look at the syntax of the custom template engine SSViewer and how to render templates from your controllers.

Template Syntax

A look at the operations, variables and language controls you can use within templates.

Common Variables

Some of the common variables and methods your templates can use, including Menu, SiteConfig, and more.

Requirements

How to include and require other assets in your templates such as javascript and CSS files.

Rendering data to a template

Call and render Silverstripe CMS templates manually.

Template Inheritance

Override and extend module and core markup templates from your application code.

Themes

What makes up a Silverstripe CMS Theme. How to install one or write your own theme.

Caching

How template variables are cached.

Translations

Definition of the syntax for writing i18n compatible templates.

Formatting, Modifying and Casting Variables

Information on casting, security, modifying data before it's displayed to the user and how to format data within the template.

Generating Unique Keys

Outputting unique keys in templates.

Partial Template Caching

Cache a section of a template Reduce rendering time with cached templates and understand the limitations of the ViewableData object caching.

How to's#

Related lessons#