HTML templating engine

by Andy Prevost

Thursday January 15 2026

SmartTemplate is a project that has seen many iterations over the past 20 years. Note, this is NOT Smarty Templating.

SmartTemplate is one of the fore runners to many of the tokenizer engines. It's had its place and popularity over the years and one of the projects that has been fallow since 2010-2011. It had undergone several name changes including QSkin and the latest, QuickSkin. I have updated it on a regular basis and today it powers a few of the websites I still look after. 

While working on restoring DCP-Portal, I decided to upgrade the entire DCP Portal templating engine to QuickSkin.

There are new features added to QuickSkin to make the entire process faster, easier, and more secure. QuickSkin also now includes a "crawler" that optionally converts all email addresses on an HTML page to its ordinal equivalent. It's almost impossible for hackers to get email addresses off your website now – not 100% secure, but awful close. QuickSkin also now includes a "crawler" to convert images to their equivalent base64 string. Makes it entirely impossible to hot-link to your resources. And, since QuickSkin works on the basis of storing compiled versions of your page, the process of converting to base64 only happens once or when a page is updated.

DCP-Portal will also benefit from another new feature. It's a simple HTML formatter, mainly to strip out comments and properly indent HTML code. In the past, I've used Tidy and several other open source HTML formatters – and none work purely as formatters. They all modify HTML code, fix to XHTML standards, add components to javascript inline code ... etc. etc. etc. Trying to harness Tidy is an exercise in futility with option settings that get out of hand and not quite successfully. I give up on Tidy, et al. For a few years, I used "HTML Beautify", a project ported to PHP from a Javascript project. The promise of HTML Beautify is that it it as close to meeting the needs of simple indentation only. I've modified it to handle XHTML and deal with a few annoying issues. I've renamed it to QuickPrettify. The "Prettify" part of the name is to indicate that all it does is prettify. 

I'm looking into one (maybe two) more features ... that is to "crawl" the page and include the CSS as minified strings. And, ditto for Javascript.

Why include base64 images, minified CSS, and minified JS? All self-contained compiled PHP files ... rendering is a lot faster.

 

◀ Previous Next ▶

Post a Comment