Helper modules can't be used in the Custom tags #103

ad1862 opened this Issue Apr 20, 2012 · 3 comments

3 participants


I need to create a widget, which consists of code (functions), and HTML.
To separate code and presentation, I put HTML into: /tag_html/widget.html, code into: /tag_modules/zzz_custom_tags.erl
and call from widget.html: {% widget_a foo="bar" %} or {% widget foo="bar" %}

How to create a Helper module without HTML?

What sense in the Custom tags? ErlyDTL's "include" tag does the same function:
{% Include "name_snippet.html" with person = "Jane" greeting = "Hello"%}


From the API Guide:

The difference between using an "include" tag and custom tags is that "include" will have access to all variables currently in the caller's scope, whereas custom tags only have access to the variables explicitly passed in. (In addition, custom tags are compiled only once for the entire project, but included files are compiled for each template that includes it.)


imho, it's same:
{% foo bar=1 %}
{% Include "foo.html" with bar=1 only %}

What about main question ?


This issue is fixed in master. Closing.

@evanmiller evanmiller closed this Jan 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment