Become a member!

TemplatePro 1.1 Guide: Now Available in 4 Languages!

🌐
This article is also available in other languages:
🇮🇹 Italiano  •  🇩🇪 Deutsch  •  🇪🇸 Español
TemplatePro 1.1 - The Definitive Guide

TemplatePro 1.1 Guide is a 209-page comprehensive guide to TemplatePro, the open-source template engine for Delphi and Object Pascal. Written by Daniele Teti (creator of DMVCFramework), it is available in 4 languages (English, Italian, German, Spanish) and includes 12+ complete, compilable example projects covering variables, filters, conditionals, loops, macros, template inheritance, includes, auto-escaping, localization (i18n), and performance tuning.

When I first published the TemplatePro 1.1 Guide in English a few weeks ago, I honestly didn’t expect this kind of response. Dozens of developers downloaded it, and the feedback was overwhelmingly positive. Many of you told me it was the resource you’d been waiting for — a comprehensive, practical guide to a template engine designed specifically for Delphi.

So I decided to go further: the guide is now available in Italian, German, and Spanish as well, bringing the total to 4 languages. Same depth, same examples, same quality — just in your preferred language.


Why Should You Care About Template Engines?

If you’re a Delphi developer building web apps, generating reports, sending emails, or producing any kind of dynamic text output, you’ve probably written code like this:

HTML := '<h1>Welcome, ' + UserName + '</h1>';
HTML := HTML + '<p>Order #' + IntToStr(OrderID) + ' confirmed.</p>';
for I := 0 to Items.Count - 1 do
  HTML := HTML + '<li>' + Items[I].Name + ' - $' +
          FormatFloat('0.00', Items[I].Price) + '</li>';

We’ve all been there. It works. But let’s be honest — it’s a nightmare to maintain.

The Problems with String Concatenation

  • Readability: after 20 lines it becomes impossible to understand what the output looks like
  • Security: it’s incredibly easy to forget HTML escaping, opening the door to XSS vulnerabilities
  • Collaboration: no designer or translator can work on that Pascal code
  • Flexibility: every layout change requires recompilation and redeployment
  • Testing: how do you unit test a wall of concatenated strings?

“But I Use StringReplace…”

Some developers move to a slightly better approach: create an HTML file with markers like {{USERNAME}} and then use StringReplace to fill them in. It’s a step forward, but it still falls short:

  • No conditionals: you can’t show or hide sections based on logic
  • No loops: you can’t iterate over a list of items
  • No filters: you can’t format dates, numbers, or escape HTML
  • No composition: you can’t reuse partial templates or define layouts
  • No expressions: you can’t do even simple calculations

You end up building a half-baked template engine yourself — full of bugs, edge cases, and maintenance burden.

The Right Tool: A Real Template Engine

TemplatePro gives you all of this out of the box:

<h1>Welcome, {{:UserName}}!</h1>
<p>Order #{{:OrderID}} confirmed.</p>

{{if IsPremium}}
  <div class="badge">Premium Customer</div>
{{endif}}

<ul>
  {{for item in OrderItems}}
    <li>{{:item.Name}} - ${{:item.Price|formatfloat,"0.00"}}</li>
  {{endfor}}
</ul>

Clean. Readable. Testable. Secure. And the template can be modified without recompiling your application.

TemplatePro works with DMVCFramework, WebBroker, and any other Delphi framework or library. It doesn’t impose constraints on your architecture — you choose the framework, TemplatePro handles the templates. It’s also a perfect fit for HTMX, enabling you to build modern, dynamic web applications that return server-rendered HTML fragments without the complexity of a JavaScript SPA.


What’s Inside the Guide

This is not a quick tutorial — it’s 209 pages covering everything from installation to enterprise patterns:

  • Variables, filters, and expressions — the complete syntax
  • Conditionals and loopsif/elseif/else, for..in with full iteration support
  • Macros — reusable UI components, like building your own Bootstrap in templates
  • Template inheritance and includes — DRY architecture for your views
  • AutoEscape — automatic XSS protection
  • Localization (i18n) — multilingual applications with JSON translation files and FormatSettings
  • Performance tuning — compile once, render many

12+ Ready-to-Use Examples

This is probably the most valuable part of the guide. Every concept comes with complete, compilable Delphi projects that you can open in your IDE, run, and adapt to your needs. No incomplete snippets, no “left as exercise for the reader” — real code that works out of the box.

The examples cover:

  • Basic variable substitution and formatting
  • Advanced filtering and custom filters
  • Conditional rendering with complex logic
  • List iteration with nested objects
  • Macro-based UI component libraries
  • Template inheritance hierarchies
  • A complete WebBroker web application with HTMX integration
  • Localization with FormatSettings and JSON translation files

You can literally copy an example, adapt the template, plug in your data, and ship it. This alone can save you hours — or even days — on your next project.


How to Get It

Patreon Members: AllAccess+ and Above

If you’re a Patreon AllAccess+ member (or higher tier), you already have access — the guide and all its source code are included in your membership, along with dozens of other exclusive resources: guides, articles, projects, and tools that are continuously updated.

👉 Download it now on Patreon

Not a Patreon Member?

No problem. You can purchase the guide separately without a Patreon subscription. You’ll get the complete package: all 4 language versions, all source code examples, the IDE wizard template, and lifetime updates.

👉 Buy the guide on Patreon


Stop Concatenating. Start Templating.

Every hour you spend fighting string concatenations is an hour you could spend building features. Every XSS vulnerability you miss is a security incident waiting to happen. Every time a client asks for a layout change and you have to recompile, that’s friction that shouldn’t exist.

TemplatePro eliminates all of this. This guide teaches you how to use it effectively — from the very first template to enterprise-grade architectures with inheritance, localization, and compiled templates.

The guide is available now. In your language.

Happy coding!

Daniele Teti

Comments

comments powered by Disqus