Home > Articles > Programming > General Programming/Other Languages

  • Print
  • + Share This
From the author of

Including Custom Templates

One thing you've likely noticed is that when you create a new page with the New Page Wizard, you have only two choices for the HTML in your application—the standard template or a blank template. The standard template is nice for things such as the demo application in this article, but when you start developing more sophisticated sites, you'll want to be able to automatically include your own HTML templates when adding pages to your applications. WebSnap allows you to do that.

You can add new templates to the selections in the New Page Wizard by creating and registering a descendant of TProducerTemplatesList in a design-time package. There is a demo package that does this in the <Delphi>\Demos\WebSnap\Producer Template directory. You can look at that package and add your own HTML/script templates to the RC file included in the package. Note that for this package to compile, you must first have compiled the package <Delphi>\Demos\WebSnap\Util\TemplateRes.dpk. After you compile and install these packages, you'll have more templates to choose from in the New Page Wizard.

  • + Share This
  • 🔖 Save To Your Account