A templating plugin for jQuery. BETA. NO LONGER IN ACTIVE DEVELOPMENT OR MAINTENANCE. Issues remain open but are not being worked.
JavaScript
Pull request Compare This branch is 5 commits behind KanbanSolutions:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demos
tests
.gitignore
README.md
jquery-tmpl.jquery.json
jquery.tmpl.js

README.md

jQuery Templates plugin 1.0.1

This is the fork of jQuery Templates that we use internally here at Kanban Solutions. We have fixed all known and encountered bugs as well as changing the syntax from the standard

Docs

.tmpl() jQuery.tmpl() .template() jQuery.template()

{%= fieldNameOrExpression %}

Used for insertion of data values in the rendered template. Evaluates the specified field (property) on the current data item, or the specified JavaScript function or expression.

identical to the ${} tag of the origional jQuery Templates http://api.jquery.com/template-tag-equal/

{%html fieldNameOrExpression %}

Used for insertion of HTML markup strings in the rendered template. Evaluates the specified field on the current data item, or the specified JavaScript function or expression.

identical to the {{html}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-html/

{%if fieldNameOrExpression %}

Used for conditional insertion of content. Renders the content between the opening and closing template tags only if the specified data item field, JavaScript function or expression does not evaluate to false (or to zero, null, type "undefined", or the empty string ).

identical to the {{if}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-if/

{%elif fieldNameOrExpression %}

Used in association with the {{if}}...{{/if}} tag to provide alternative content based on the values of one or more expressions. The {%elif%} tag can be used with a parameter, as in: {%if a%}...{%elif b%}...{%/if%}.

Added because the old system actualy overloaded the else tag to handle elif as well and I didnt like that

{%else%}

Used in association with the {{if}}...{{/if}} tag to provide alternative content based on the values of one or more expressions. The {%else%} tag can be used without a parameter, as in: {%if a%}...{%elif b%}...{%else%}...{%/if%}

almost identical to the {{else}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-else/ but I removed the ability to do `{{else _test}}`_

{%each( index, value ) collection %}

Used to iterate over a data array, and render the content between the opening and closing template tags once for each data item.

identical to the {{each}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-each/

{%tmpl( [data], [options] ) template %}

Used to iterate over a data array, and render the content between the opening and closing template tags once for each data item.

identical to the {{tmpl}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-tmpl/

{%wrap( [data], [options] ) template %}

Used for composition of templates which incorporate wrapped HTML content. Rendered template items can combine wrapped HTML content with template markup.

identical to the {{wrap}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-wrap/