We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{{extend ("./layout")}}
├── footer.xtpl ├── header.xtpl ├── index.xtpl ├── layout.xtpl ├── layout1.xtpl └── sub └── header.xtpl
index.xtpl
{{extend ("./layout1")}} {{#block ("head")}} <!--index head block--> <link type="text/css" href="test.css" rev="stylesheet" rel="stylesheet" /> {{/block}} {{#block ("body")}} <!--index body block--> <h2>{{title}}</h2> {{/block}}
layout1.xtpl
<!doctype html> <html> <head> <meta name="charset" content="utf-8" /> <title>{{title}}</title> {{{block ("head")}}} </head> <body> {{{include ("./header")}}} {{{block ("body")}}} {{{include ("./footer")}}} </body> </html>
render
res.render("index", {title: "xtpl engine!"})
output
<!doctype html> <html> <head> <meta name="charset" content="utf-8" /> <title>xtpl engine!</title> <!--index head block--> <link type="text/css" href="test.css" rev="stylesheet" rel="stylesheet" /> </head> <body> <h1>header</h1> <h2>sub header</h2> <!--index body block--> <h2>xtpl engine!</h2> <h1>footer</h1> </body> </html>
The text was updated successfully, but these errors were encountered:
b73a81a
No branches or pull requests
syntax
Example
index.xtpl
layout1.xtpl
render
output
The text was updated successfully, but these errors were encountered: