User Docs Developer Docs | |

Template Engine Reference

Pubvana uses a custom template engine for all .tpl files — themes, widgets, and plugin views. It is not Twig, Blade, or Smarty. It is a purpose-built Lexer → Parser → Interpreter pipeline with no PHP execution in templates.

Design Goals

  • No PHP in templates — all logic is expressed through tags, filters, and tag functions
  • Auto-escaping — all {{ }} output is HTML-escaped by default
  • Explicit raw output — unescaped output requires the {! !} syntax or the |raw filter
  • Theme portability — templates work across any Pubvana installation without modification

Syntax Summary

SyntaxPurpose
{{ variable }}Escaped output
{{ variable | filter }}Filtered escaped output
{! expression !}Raw unescaped output
{% tag %}Control tags (extends, block, include, for, if)
{# comment #}Template comment (not rendered)

Subsections

  • Syntax Overview — complete reference for all four syntax forms
  • Tags — extends, block, include, for, if/elif/else
  • Filters — all 10 available filters with examples
  • Expressions — variable paths, literals, comparisons, booleans
  • Tag Functions — all 10 callable functions for URLs, widgets, i18n, and content rendering