{{include "header.html"}}

{{page_heading}}

Welcome, {{username}}! This page demonstrates the templating capabilities of the Beaker web framework.

Simple Variable Substitution

Your favourite colour is: {{favourite_colour}}

The current year is: {{current_year}}

This is a safe string: {{safe_html|safe}}

This is an unsafe string (will be escaped): {{unsafe_html}}

List of Features (String Array)

Here are some features:

User Data (Array of Arrays)

Here's some user information:

Conditional Statements (if/elif/else)

Simple truthy check

{{if user_logged_in}} User is logged in! {{else}} User is NOT logged in. {{endif}}

Equality check (role == "admin")

{{if role == "admin"}} Welcome, Admin! You have full access. {{elif role == "user"}} Welcome, User! You have standard access. {{else}} Welcome, Guest! You have limited access. {{endif}}

Not equal check (status != "inactive")

{{if status != "inactive"}} Account is active. {{else}} Account is inactive. {{endif}}

Variable existence check (exists)

{{if exists username}} Username exists! {{else}} Username does NOT exist. {{endif}}

Variable existence check (not exists)

{{if not exists missing_var}} missing_var does NOT exist (as expected) {{else}} missing_var exists (unexpected!) {{endif}}