How To use "Include"

1,167 views
Skip to first unread message

Stanley Tsang

unread,
Feb 14, 2012, 10:13:12 AM2/14/12
to dotliquid
Hi all,

I have some question on using dotliquid. In the wiki page for design,
I found that dotliquid support "include" which can include another
partial template to a template.
However, when I tried to use "include" like the following:
{% include "NotificationTemplate.tmp" %}

The following error showed:
Liquid error: Error - This liquid context does not allow includes

I have also found from http://havanacommerce.net/en/help/templates.syntax
it showed that dotliquid support "extends", however, when I use the
following code
{% extends "NotificationTemplate.tmp" %}

The same error showed.

How can I solve this problem?

Stanley Tsang

unread,
Feb 14, 2012, 11:00:30 AM2/14/12
to dotliquid
Problem found.

it is necessary to set the following:
Template.FileSystem = new
LocalFileSystem(AppDomain.CurrentDomain.BaseDirectory);

and there is naming convention in template name
It should be named as _NotificationTemplate.liquid
and include like:
{% include "NotificationTemplate" %}



On 2月14日, 下午11時13分, Stanley Tsang <stanleya...@gmail.com> wrote:
> Hi all,
>
> I have some question on using dotliquid. In the wiki page for design,
> I found that dotliquid support "include" which can include another
> partial template to a template.
> However, when I tried to use "include" like the following:
> {% include "NotificationTemplate.tmp" %}
>
> The following error showed:
> Liquid error: Error - This liquid context does not allow includes
>
> I have also found fromhttp://havanacommerce.net/en/help/templates.syntax
Reply all
Reply to author
Forward
0 new messages