template

Eliminating whitespace in Sempare Template Engine for Delphi templates

Eliminating whitespace in Sempare Template Engine for Delphi templates

The Sempare Template Engine (available at https://github.com/sempare/sempare-delphi-template-engine and GetIt) is a versatile templating system designed specifically for Delphi developers to streamline the creation and management of dynamic HTML, text, or any other text-based output formats. Whether you are building web applications, reports, or email templates, the Sempare Template Engine offers a powerful yet straightforward solution that integrates with minimal boilerplate into Delphi projects. The template engine has been around since 2019 and has many features for you to explore. In this tutorial, we will illustrate how whitespace (space and newlines) can be eliminated from templates managed by the Sempare Template…
Read More
Dynamic DOM Element Creation :

Dynamic DOM Element Creation :

In HTML Create parent div <!--------------- Parent div --------------> <div id="parent" class="card m-5 mx-auto" > <h1>Hello Template</h1> </div> Create template: <!----------------- Template tag ------------> <template id="template"> <div class="card d-flex"> <img id="temp-img" src="https://picsum.photos/id/293/100/100" alt="smth"> <h1>Template title</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi, architecto dolor eius fugiat incidunt ipsa iure iusto officiis recusandae rerum!</p> </div> </template> In CSS: #parent{ width: 43%; } .card { width:500px; padding: 20px; } .card h1{ font-size: 50px; } #temp-img { margin: 0 auto; width: 400px; height: 300px; } In Javascript: Call from HTML const parent = document.querySelector('#parent'); const template = document.querySelector('#template'); Clone the template…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.