Skip to content
donnerjack13589 edited this page Aug 31, 2010 · 2 revisions

This is a standart module included with nTPL.

How to include it

require("./nTPL.block");

Note that you must require nTPL before and nTPL.block.js must be in your project’s folder.

Usage

Template #1

< div >
{%block 'pre-content' %}
  default value of this block
{%/block %}
{%block ‘content’ %}
default value of this block
{%/block %}

</ div>

Lets name this template as “base”

Template #2

{%extends 'base' %}

{%block ‘content’ }
not default content
{
/block %}

Now when you’ll render second template you will see that value of first block is default, while value of second is “not default content”.

Clone this wiki locally