Help

Directives

include

It will include content of template

[% include 'template_name' %]

Example

Page: /

[% include 'header' %]
... page content ...
[% include 'footer' %]

Template: header

<html>
<head><title>Title</title></head>
<body>

Template: footer

</body>
</html>

Result:

<html>
<head><title>Title</title></head>
<body>
... page content ...
</body>
</html>

variable

Variables subtitutions

[% $variable='value' %]
[% $variable %]

Example

Page: /

[% $title = 'Home Page' %]
[% include 'header' %]
... page content ...
[% include 'footer' %]

Template: header

<html>
<head><title>[% $title %]</title></head>
<body>

Template: footer

</body>
</html>

Result:

<html>
<head><title>Home Page</title></head>
<body>
... page content ...
</body>
</html>

layout, yield

Layout using. We can set layout for page using 'layout' directive.

Page content will insert into 'yield' place.

[% layout 'layout_name' %]
[% yield %]

Example

Page: /

[% $title = 'Home Page' %]
[% layout 'first' %]
... page content ...

Layout: first

[% include 'header' %]
[% yield %]
[% include 'footer' %]

Template: header

<html>
<head><title>[% $title %]</title></head>
<body>

Template: footer

</body>
</html>

Result:

<html>
<head><title>Home Page</title></head>
<body>
... page content ...
</body>
</html>

image

You can use image's name in code for get it's url.

[% image:image_name %]

Example

You uploaded an image 'company-logo.png' and set the image name to 'logo'.

You can use the next code for insert image tag:

<img src="[% image:logo %]" alt="Logo"/>

file

You can use file's name in code for get it's url.

[% file:file_name %]

Example

You uploaded a file 'offer.pdf'.

You can use the next code for insert link to the document:

<a href="[% file:offer.pdf %]">View Offer</a>

Tricks

404 error pages (not found)

Create page with name 404 and this page will be render when no page found.