Recordset to a set of HTML pages

This extension will take a Recordset and create a set of HTML files using the records to populate a self-made template. Also it will create an index.htm file with these files, with a Table of Contents and hyperlinks to all the pages created.

A use for this extension is to create a set of static html files when you have a lot of data in a database and want a set of page for a CD or other place where an Application Server is not an option.

Overview

First thing you need to do is create your template page. Where you want the dynamic data to appear you need to add a 'token' onto the page for the extension to replace it with the relevant data. The token is identified as the name of the Field from the Recordset that you want to retrieve the data surrounded by '@' symbols. ie @myField@

An example would be, if you had the following columns in a DB table:

ID
Name
Description
Image

You could create a HTML page as follows:

<html>
<head>
<title>@Name@</title>
<meta http-equiv="Content-Type" content="text/html; charset="iso"-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<p><b>@Name@ </font></b></p>
<p><img src="@Image@"> </p>
@Description@</font></p>
</body>
</html>

Save the template on your web server.

Create an ASP page containing the Recordset that contains all of the records that you want to create static HTML pages for. Apply the T3_DB to HTML Server Behaviour, where you will need to supply the following information:

Template Name: Enter path/file details to the template file you created

Recordset: Choose the recordset that contains the data you want to place on the HTML files.

Destination Folder: Select the folder where you want to place the set of created HTML files.

OutputFileName: Choose the field that you want to use to create the unique name for each HTML file.

Save the file, and load into your browser..........

You will need to ensure that any images you have used in you template are also copied to the relevant place so that the image links are live in the destination folder.

Should there be enough interest, I may modify the code in future releases to allow Repeat Regions etc. If you have any suggestions as to how to better implement this code, please contact me.

Any questions?

Requirements

Type: Server Behavior
Product: UltraDev 4
Server Model: ASP VBScript

Reviews

same here...

October 10, 2001 by e site
I got the same error... I think it has to do with an emty field (when there's nothing in it) but I wouldn't know how to fix...

It´s simply wonderful!

November 14, 2001 by Hugo Alejandro Ospina Naranjo
This is what I need to automate the production of CD web-based magazins!

This is an excellent extension. It can save you much time

March 9, 2002 by Juan Carlos Escobar

DreamWeaver MX?

November 28, 2002 by Gavin Botica

This is a great extension, but does anyone know if it can be modified to work in MX? Or is there an MX version on the way?

OR is the someother alternative for performing this task, such as another extension?

You must me logged in to write a review.