Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
C++CodeDelphiNewsRAD Server

WebStencils Demos Updated: C++Builder, Shared Templates and More

webstencils newdemos

We’ve just pushed some exciting updates to the official WebStencils demo repository on GitHub. If you’ve been using WebStencils or are curious about integrating HTML templating into your Delphi or C++Builder applications, now’s a great time to take a look.

C++Builder Joins the Party!

The biggest news is the addition of full C++Builder versions for our demos. Alongside the existing Delphi examples for WebBroker and RAD Server, you’ll now find parallel projects built entirely with C++Builder. These aren’t simplified versions; they offer the same functionality and show how WebStencils fits into C++ workflows, whether you’re building a classic WebBroker application or a modern RAD Server service.

One Set of Templates to Rule Them All

One of the main ideas behind WebStencils is flexibility. To really demonstrate this, we’ve refactored the WebBroker and RAD Server demos (both Delphi and C++Builder) to use a single, shared set of HTML templates. All four web projects now pull their templates from the common resources/HTML directory. This clearly demonstrates that your WebStencils templates are independent of your backend technology or programming language. Write them once, use them across your projects.

Mix and Match Backends & Databases

Speaking of independence, the demos now better illustrate how WebStencils works with different data sources and backends:

  • The WebBroker projects (Delphi & C++) use an in-memory list for the Tasks demo and an SQLite database for the Customers demo.
  • The RAD Server projects (Delphi & C++) connect to an Interbase database for both tasks and customers.

Despite these different setups, they all render the exact same front-end website using those shared templates. It really highlights that WebStencils focuses on merging your data with your HTML, regardless of where that data comes from or which framework serves it.

New Feature: Customer Pagination

We’ve added a practical new feature to the Customers section in the WebBroker and RAD Server demos: server-side pagination. This is a common requirement for handling larger datasets. You can see an example of fetching and displaying customer data page by page. Check out the Controllers.Customers unit (or the C++ equivalent like ControllerCustomers.h/.cpp) and the corresponding templates in partials/customers to see how it works.

The pagination template and class have been created in a way that can be easily reused in any project. Using class helpers, the integration with FireDAC is very simple and matches the requirements for a web-based pagination system. 

Enhanced HTMX Tasks Demo: Completion Progress

We’ve also improved the HTMX Tasks demo. At the top of the task list, you’ll now find a handy completion status section. It automatically shows how many tasks are in total and how many are marked as complete, along with a visual progress bar. The cool part? This updates automatically whenever you add, complete, or delete a task, using the power of HTMX to refresh the content and some CSS for the progress bar display: no full page reloads needed.

Take a look

Ready to explore? Head over to the GitHub repository to grab the latest code, run the demos (WebBroker, RAD Server, or the FMX Showcase), and see how WebStencils can simplify generating HTML in your own Delphi and C++Builder projects.

We hope these updates make it even easier to get started with WebStencils and see its potential. If you are interested in learning more about WebStencils, don’t forget to download our free guide. Happy coding!

See What's Coming in RAD Studio 13 Florence The AI Codecamp: Learn, Code, Create

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Pre-sales consultant engineer at Embarcadero inc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Worth reading...
How To Use WebStencils To EASILY Create Modern, Professional, Superfast Websites

IN THE ARTICLES