| the complete webmaster | ||||
| tutorials | reviews | reference | ||
|
Roll Your Own Web Templates with FrontPage 98 I'm sure you're familiar with using the Web Templates that come with FrontPage 98 to create new webs. The Web Templates can create anything from an empty web to a full-blown commercial web site, complete with Themes and Feedback forms, and a whole slew of ready-made FrontPage components. But did you know that you can create your own Web Templates, and even edit the existing ones? Hmmm... Could be fun! Here's how: FrontPage Web Templates are stored in the FrtontPage client directory. Usually, this is C:\Program Files\Microsoft FrontPage\Webs. Each template is in a folder called "<Theme Name>.tem." To create a new template, you just specify the name of the template, with the ".tem" extension in a new folder in this directory. The folder will also contain the various folders and files in the web itself, so, of course, the first task is to create the web which will be used as a template. In addition, the folder will contain a "<Theme Name>.inf" file, which contains information about the web. If the template is a frameset, there will be additional information necessary, but you can read all about the additional information in the FrontPage SDK Word document if you need to go further than this. The SDK document is found in the FrontPage 98 installation CD, in the SDK folder, and is named "FPDEVKIT.doc." For now, I am going to walk you through the creation of a fairly straightforward template, probably more than you need to create your own. To do this demonstration, I used my ASP Discussion web, a database-connective discussion web which I sell through my web site (http://www.takempis.com) , and is structured much like the discussion area at my web site. It has several images, a few files in the root folder, and a few in the _private folder. I began by opening Windows Explorer, location my C:\Program Files\Microsoft FrontPage\Webs folder, and creating a new folder called "discussion.tem." I then navigated to my C:\Webshare\WWWRoot\discussion folder, the folder where my Discussion web is located on my server, and copied all the files in the root folder of that web to the "discussion.tem" folder:
I repeated this step, copying the images and _private folders to the "discussion.tem" folder, resulting in the folder structure you see in the left-hand pane of the image above. I made sure to go into the "discussion.tem" folder and remove all the _"vti" folders and files afterwards, leaving just the folders and files from the web.This essentiall created a "copy" of the web in the folder. The next step was to create the "discussion.inf" file in the "discussion.tem" folder. This is done with NotePad, or any other text editor. The text of this file is duplicated below: [info] Note the 4 headings, which I have shown in bold letters. Of these, the [info] is the only one which is always necessary to include. The information here is used in FrontPage Explorer to give a title and description for the template. If you have files and folders in your web, the files must be identified and located in the [FileList] section. Files in the root folder are simply identified by their name followed by the "=" sign. files in subfolders are identified by their relative file path (<folder name>\<file name>), followed by the "=" sign, and their relative virtual path in the web (<folder name>/<file name>). Whatever your default home page file name is, be sure that in the template it is named "index.htm." When you create a new web from the template, the file name will be converted to your default home page file name. The [MetaInfo] section deals with information which is found in the Tools|Web Settings (Parameters tab) menu item of FrontPage Explorer. This can be useful when using Web Parameters with the Substitution component:
As you can see from the discussion.inf text above, you assign name/value pairs to the parameters you specify. The [TaskList] section is for creating the initial "To Do" list for the web. Each task is given the name "task<number>," followed by the "=" sign, and a definition for the task. The definition consists of six attributes separated by the pipe (|) character. These are described in the table below:
When an attribute has no value, just place the pipe delimter there, with nothing in between. You can see this in the example above. In every task definition, I have left out the "Cookie" aspect. And in the definition of the task for creating a System DSN, which has no file associated with it, it is also blank. Here is a screen shot of the resulting task list:
Once you've finished editing your .inf file, save it, and you're ready to go. Next time you open FrontPage Explorer, and elect to create a new FrontPage web, you'll see the web in the list of templates:
And that's the end of the story! Have fun, and hey, let's be careful out there! Author: Kevin Spencer More articles about Microsoft
FrontPage |
| write for us | about us | advertise |
Copyright 1997, 1998 A Big Lime. All rights reserved.