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 many options for naming index pages and determining when it should make new ones. When making a single index page you can specify the name and the file extension. When making multiple pages, you can use the name of a specified field for the name, or serialize the base name, and more.
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.
Here's how these options work:
- All record on one 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.
- Mutiple pages
Select this option when you want WebMege to create multiple pages. You tell WebMerge when to make a new page with these:
- When the value of field changes
With this option checked, WebMerge will start a new index page whenever the value of the specified field 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.
Note: In most cases, when using this option you'll also want to sort the source data by the same field, using the built-in Sort option on the Sources tab. See the discussion on this in the Help section on the Sources tab.
- Max number of records per page
With this option checked, 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
You can use these options together, so you can have index pages broken up by category while still limiting the number of records on each page. But when making multiple index pages you must have at least one of these two options checked. Don't worry: if you forget WebMerge will remind you and set one of them for you.
WebMerge also provides flexible options for setting the name of the index pages it will create:
- Base name
This is where you enter the base name for your index files, used when generating a single page or when generating multiple serialized pages. You can enter any valid file name up to 250 characters. By default WebMerge uses "index".
- Extension
This is the file name extension added to the end of generated index files, which tells the web server what type of page it is. By default WebMerge uses "html", but you can change that to "php", "asp" or other type if you need to. In most cases the default "html" is what you'll want to use.
- Serialized names starting with #
When making multiple index pages, this option gives each page a unique name by adding a serial number to it. Whether you're using the base name or the contents of a field (see the next option below(), WebMerge will number each page starting with the number you enter in the box at the right of this option.
- Don't Number First Page
This chekbox governs whether the first serialized index page will be numbered. If checked, the first index page will not have a number, but all subsequent index pages will be numbered normally.
- Field contents
You can use the contents of a field as the base name for newly created index pages by checking this option and selecting the field containing the data you want to use for the name from the popup list on the right.
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 automatically alters data used as file names to be suitable for use on a Web server. Characters such as spaces, ampersands, 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.
Note: If you use this option and you've chosen the page break option labeled "When value of field changes" (see above), in most cases you'll want to have the same field chosen for each.
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".
For determining your index page names you can use both the Serialzed names and Field contents options together, which is recommended if you also have your page breaks set to use the Max number of records option. But when making multiple index pages you must have at least one of these two options checked. if you forget WebMerge will remind you and set one of them for you.
For details on creating your index templates, see the section Preparing Your Templates.