Replicating Websites With Master Form V4
Replicating websites on a domain for affiliates or partners can be done with Master Form V4.
The replicated websites may be customized with ID, name, contact, and other affiliate/partner information. The URLs usually are something akin to http://example.com/aname/, http://example.com/anothername/, etc.
The Master Form V4 Users Manual has detailed information. Purchase of the software comes with a download link for a working site replication example.
Overview
Create the web page or pages that will be replicated. These will be the web page templates.
Create a form the affiliate/partner will fill in with custom information for the replicated website.
When the form is submitted, the website is replicated.
Planning Site Replication
Step 1.
Web page templates will be used to replicate web pages. The replicated web pages most likely will contain custom information.
List the custom information the replicated web pages will have. Examples:
Name Telephone Affiliate ID
Step 2.
A replication form will gather information to insert into the replicated web pages. Decide what names those form fields will have. Examples:
name="AffiliateName" name="telephone" name="AffiliateID"
Step 3.
Decide where the replicated pages will be written to. Usually, each replication would be in its own subdirectory. The subdirectory name may be determined by affiliate id, name, or something else.
The subdirectory name should be something that has no chance of being duplicated. An affiliate ID or similar code or ID may be ideal.
The Web Page Templates
Step 1.
Create the web page or pages that will be replicated.
Use placeholders in place of custom information when the page is replicated. Placeholders are the form field name where the information will be provided, in between double square brackets. Example:
If form field name="AffiliateName" is for the affiliate/partner's name, then the web page template has [[AffiliateName]] where the information will be inserted.
Similarly, if form name="telephone" is to be inserted into a replicated web page, use [[telephone]] in the web page template.
Upload the pages into a directory specifically for the templates and verify the pages work as they should images display, movies play, and so forth. (Actually, the template pages don't have to be in a separate directory. It generally feels more organized if they are.)
Make a note of the URL of each web page template.
Step 2.
Insert a BASE tag as the first line of the HEAD area in the source code of each web page template. The URL for the BASE tag is the URL of the web page template.
Example BASE tag:
<base href="http://example.com/pagetemplates/index.html">
The reason for the BASE tag is so relative links and URLs don't break once the page is replicated to a different location.
Step 3.
At the very top of the source code file of each web page template, put this line:
**OVERWRITE_FILE**
The **OVERWRITE_FILE** as the first line of the web page templates will cause any second and subsequent replications to replace the old page. Without that line, if there is reason to re-replicate the pages, the new page would be appended to the bottom of the old page. **OVERWRITE_FILE** ensures a fresh copy.
Upload the pages with the BASE tag and **OVERWRITE_FILE** line. Your templates are now ready.
The Website Replication Form
This form will ask for all the information required to replicate the website.
The field names for the information to be used for customizing the replicated web pages must match the name in the web page template placeholders.
Let us also assume the following:
- Two web pages are to be replicated, index.html and aboutus.html.
- The web page templates are in the /templates directory.
- The replicated pages will be put in a directory named as the Affiliate ID.
With the above assumptions, the replication form might look like this:
The form has several hidden fields. Here is the form source code:
<form method="post" action="/cgi-bin/mfV4/MasterFormV4.cgi">
<input type="hidden" name="redirect" value="/thankyou.html">
<input type="hidden" name="filetemplate" value="
/templates/index.html,
/templates/aboutus.html
">
<input type="hidden" name="dbfile" value="
/[[AffiliateID]]/index.html,
/[[AffiliateID]]/aboutus.html
">
<table>
<tr>
<td>Your Name</td>
<td><input type="text" name="AffiliateName"></td>
</tr><tr>
<td>Your Telephone Number</td>
<td><input type="text" name="telephone"></td>
</tr><tr>
<td>Your Affiliate ID</td>
<td><input type="text" name="AffiliateID"></td>
</tr><tr>
<td colspan="2" align="center"><input type="submit" name="submitter" value="Replicate My Site"></td>
</tr>
</table>
</form>
The first hidden field is name="redirect" and its value is the URL of the web page the browser is redirected to after the form has been submitted.
The second hidden field is name="filetemplate" and its value is a comma-separated list of the web page file templates.
The third hidden field is name="dbfile" and its value is a comma-separated list of the locations the web pages shall be replicated to. Note that the order of the list for name="dbfile" must correspond to order of the list for name="filetemplate".
(Master Form V4 treats web page template files the same as any other database template files.)
When the form is submitted, Master Form V4:
-
Grabs a copy of the web page templates specified in hidden field name="filetemplates".
-
Customizes them by replacing the placeholders with the information provided in the form.
-
Publishes the web pages as specified in hidden field name="dbfile".
-
Redirects the browser to the URL specified in hidden field name="redirect".
Additional Features
The above is a synopsis. The Master Form V4 Users Manual has detailed information about that and about other build-in features of the software.
For example, you as the domain owner can receive an email every time the replication form is used.
A database file can be updated with the information provided in the replication form.
After form use, a customized thank-you page can be displayed instead of a static page.
Once you have the basic replication working to your satisfaction, consider adding more features. I especially recommend an email every time the replication form is used. It can be an effective monitoring too.
Will Bontrager

