4W WebMerge Settings
Index Pages Tab
The Index Pages tab lets you assign a folder for the pages to be generated into, assign a template for your index pages, and define how you want the generated index pages to be named.
Assigning a Destination Folder
If you want to generate index pages, check the box labeled "Create Index Pages in" to activate the features in the Index Pages tab. If you have not already assigned a folder in which to generate the pages, setting that checkbox will trigger to "Folder..." button next to it, which presents a dialog to let you select the target folder.
Assigning Templates for your Index Pages
WebMerge provides three ways to assign templates for your index page, which can be selected by clicking the appropriate radio control:
- Auto-Create New Template
WebMerge creates a simple index page template on the fly during generation, which contains a single column showing the data from the field you specify with the popup list to the right of this control.
- Use one template file for Index Pages
WebMerge will make your index page(s) from one template you prepare as an HTML document. You can select your HTML index template using the "File..." button to the right of this option.
- Use Template file specified in Field
If you need a different template file for each record, you can specify the path to that template in a field in your source file, and assign that field using the popup list to the right of this option. The path specified in field data can be either a full path, or relative to the destination folder.
Naming Generated Index Pages
WebMerge provides three options for determining the names of your generated index pages, with additional options for naming multiple index pages. The names of generated files consist of a base name and an extension. Multiple pages may also use serial numbers to distinguish them.
You set the base name for your generated index pages in the field labeled "Base name", and the file extension is set in the field labeled "Extension". By default WebMerge uses "index" as the base name and ".html" as the extension, but you can change these as needed for your setup.
As you change options in these controls, WebMerge updates an example name in the upper right of this group showing you what the name of the first generated file will look like.
The three main options for naming index pages are:
- Make only one Index page
If you want all entries shown on a single index page, use this option. Since only one index page will be generated, its name is simply the base name appended with the extension.
- Name based on contents of field
If you want to create multiple index pages, you can include a field in your database which contains the name of the index file you want that record shown in. You specify that field using the popup list to the right of this option.
WebMerge will use the first 255 characters of data in the specified naming field, so be sure you choose a field which is not likely to contain duplicated data across records. If the same data appears in your specified naming field in more than one record, each page generated with that name will overwrite any previously generated ones with the same name.
WebMerge alters data used as file names to be suitable for use on a Web server. Characters such as quotes, spaces, question marks, forward slashes, and others have special significance on a server, and such characters are converted to hyphen ("-") when the page is generated.The data in this field can also specify sub-folders for generated HTML pages.
Creating Subfolders
If the field you specify for the file name contains a standard UNIX folder name (separated by "/") before the file name (e.g., "myfolder/filename") it will create the specified subfolder as it creates the file. These can even be several levels deep if you like, using something like this:
subfolder/anotherfolder/page001
That data will generate a file named "page001.html" inside of a folder named "another folder", inside of a folder named "subfolder".
- Serialized names starting with #
If you want multiple index pages but do not have a field which defines their file names, WebMerge can create a series of index pages with serial numbers appended to them. You assign the starting number for the series in the field to the right of this option.
When creating multiple index pages, WebMerge provides additional features to let you define when a new page will be created. Next to the label "Make new Index page when" is a popup list with these options:
- value in this Field changes
WebMerge will create a new index page whenever the value in the field specified in the list at the right of this option changes. This lets you group index page entries into categories. For example, if you were using the US Congress source file provided in the WebMerge tutorial, you could create two index pages, once for each political party, by choosing this option and specifying the "Party" field.
- first character in this Field changes
WebMerge will create a new index page whenever the first character in the field specified in the list at the right of this option changes. This lets you group index page entries into more refined categories, and is especially useful for creating alphabetized groupings. For example, if you were using the US Congress source file provided in the WebMerge tutorial, you could create an index page for members of Congress whose name begins with the same letter by choosing this option and specifying the "Name" field.
- first word in this Field changes
This is similar to the previous option but creates a new page only when the first work of the data in the specified field changes.
- a number of records is reached
WebMerge will create a new index page when a maximum number of records have been written to the current index page. For example, if you want your index pages to list no more than 50 entries on each page, just select this option and type "50" into the field that appears to the right of it.
For details on creating your index templates, see the section Preparing Your Templates.