Login

Snippets by itchyfingrs

Snippet List

alientag

Renders enclosing contents as it is. Useful to avoid tags conflict with certain javascript libraries (eg. jquery-tmpl.js, mustache.js) Example usage: `<script class="content-tmpl" type="text/x-jquery-tmpl">` `{% alien %}` `{{ tmpl(results) "#results .item-tmpl" }}` `{% endalien %}` `</script>`

  • templatetag
Read More

math tag

Syntax: {% math <argument, ..> "expression" as var_name %} Evaluates a math expression in the current context and saves the value into a variable with the given name. "$<number>" is a placeholder in the math expression. It will be replaced by the value of the argument at index <number> - 1. Arguments are static values or variables immediately after 'math' tag and before the expression (the third last token). Example usage, {% math a b "min($1, $2)" as result %} {% math a|length b|length 3 "($1 + $2) % $3" as result %}

  • math
  • min
  • max
Read More

itchyfingrs has posted 3 snippets.