November 2018
Intermediate to advanced
404 pages
10h 16m
English
Leaf also allows you to insert another Leaf template into your template file using the #embed tag:
#embed("another")
When doing this, you should omit the template's file extension.
A common practice for template embedding is to include header and footer templates in each of your pages:
#embed("header")#embed("footer")
This makes it easy for updating and propagating changes to all of your web pages.
You can also automate the creation of a child page using a master template:
#set("user") { <b>John Doe</b> }#embed("master")
master.leaf may look like this:
<html><head><title>Welcome to My Homepage</title></head><body>Hi #get(user), have a great day!</body></html>
You can use #set() to set up and assign a variable, then ...
Read now
Unlock full access