# Template Tiger Handlebars Syntax Guide > **Handlebars basics: {{variable}} for values, {{#if}} for conditionals, {{#each}} for loops, {{#with}} for context.** Templates use Handlebars syntax for dynamic content rendering. ## Variable Substitution Basic variable: ```handlebars Hello {{name}}! ``` Nested object access: ```handlebars Hello {{user.firstName}} {{user.lastName}}! Email: {{user.profile.email}} ``` ## Conditionals If/else blocks: ```handlebars {{#if isPremium}} Welcome, premium user! {{else}} Upgrade to premium today. {{/if}} ``` Unless (inverse of if): ```handlebars {{#unless isLoggedIn}} Please log in to continue. {{/unless}} ``` ## Loops Iterating over arrays: ```handlebars ``` With index: ```handlebars {{#each items}}

{{@index}}: {{this.name}}

{{/each}} ``` ## Context Switching With block for nested objects: ```handlebars {{#with user}} Name: {{firstName}} {{lastName}} Email: {{profile.email}} {{/with}} ``` ## Complete Example Template: ```handlebars Welcome, {{user.firstName}}!

Hello {{user.firstName}} {{user.lastName}}

{{#if isPremium}}

Thank you for being a premium member!

{{else}}

Consider upgrading to premium.

{{/if}}

Your Features:

Get Started ``` JSON variables: ```json { "user": { "firstName": "Amina", "lastName": "Khan" }, "isPremium": true, "features": ["Templates", "API Access", "Analytics"], "ctaUrl": "https://example.com/dashboard" } ``` ## Official Documentation For complete Handlebars documentation, visit: https://handlebarsjs.com/guide/