How Does the Index Template Work ?
Index Templates are used by WebMerge to generate all higher level hierarchy pages. These are pages that have links to detail pages, or other (lower level) index pages. See figure 1. below.
Figure 1- Examples of Index Pages in the Hierarchy
WebMerge can generate a set of pages using a built-in default Index Template, however to be effective at all, a custom template should be designed and used.
As with the Detail Template, lot of time can be saved by utilizing a blank page that already has all of the formatting for the web site where you are going to publish the data feed driven web pages. For example, your logo, navigation, banner/text ads, and anything else that is particular to your web site will have already been created by you. All you have to do is insert the WebMerge Tags in the right places to complete the Index Template.
WebMerge Tags (WM-Tags) used with standard HTML or PHP are used in the Detail and Index Templates in order for WebMerge to put information into the pages it builds. When WebMerge builds Index Pages, it reads the Index Template you have created, and looks specifically for whatever WM-Tags that have been inserted into the HTML code.
Once WebMerge finds the fields in the data feed that match the WM-Tags in the Index Template, WebMerge acts depending on how you have configured the items on the Index Pages tab in WebMerge. For example, WebMerge may be configured to place a new link on the index page only after the "Main Category" in the feed changes from "Cleaners" to "Boxes" to "Brushes" and so on (see figure 2). WebMerge examines every record one-at-a-time, accordingly it my go through many records before it adds the next link on the index page. See the "Main Category (Index) Page" in figure 2, below.
The lowest tier Index Page will contain links to individual Detail Pages. In this case, a link will be placed on the index page for every record listed in the last (or lowest) category in the data feed file. See the "Sub-Category (Index) Page" in figure 2, below.
As an example, this works well for a three-tier web-site that might have ten or twenty Main Categories ("Cleaners," "Boxes," "Brushes" etc.) found on the Main Category Index Page. These link to the index pages called Sub-Category Index Pages and contain sub-category links (for example "FRS-300," FRS-301," "FRS-302" etc.), these final links point to individual detail pages. See figure 2 below.
Figure 2 - Link relationships in Index Pages
Laying Out Your Index Template
As mentioned above, once the basic Index Template (with your web-site's basic formatting) has been completed, you need to add the appropriate WM-Tags. The most important tags for an Index Template are the [WM-Record] and [/WM-Record] tags. Each time WebMerge looks at a record in the data feed file, it matches the data you specified between these Record tags. An example of this code follows:
[WM-Record]
<a href="http://www.yoursite.net/betty_mills/[WM-Field: Product_ID nolink].htm" title="[WM-Field: Description nolink]">[WM-Field: Product_Name nolink]</a>
[/WM-Record]WM-Tags Between Record Tags
The above code includes Record tags, with the other WM-Tags placed between them. The field names chosen for the WM-Tags above link to individual product pages.
In the example above, file names for the product pages will be based on the Field Name "Product_ID." Link text (what gets displayed in the browser), are based on the Field Name "Product_Name." Lastly, the "title" (HTML tag) has also been included, and is based on the Field Name "Description."
These WM-Tags are the same ones used in the Detail Template, except that we will be adding more options to the tags placed in the template. For example, the "noindex" option is mandatory for all WM-Tags (except "Record" and "Index Label" tags) in all index pages. Leaving that tag out usually results in odd links and code being displayed in the browser window after loading the completed Index Page. If you see these, re-check the "noindex" option in your tags.
What you see between the Record tags is a standard HTML HREF tag, similar to what is used in the Detail Template. The Title tag is optional on your part, but including it is good practice.
TIP: The title HTML tag can be read by text-readers (used by the visually impaired). If you put the right information in it, everyone can benefit from it. For example, you can put the product description in the title tag. This will allow a visitor to your bottom level Index Page to hover their mouse over the product link, and see the product description. Could it also be a benefit if several of your product descriptions, loaded with keywords were included in every index page too?
The Topmost level Index Page is the place where many visitors can start drilling down into product categories, looking for what they need. It is also a great place for a landing page, for a particular merchant. Adding a little flair, and ad-copy to this page is also a pretty good idea.
The Top-Level Index Page tags are a little different than those for other Index Pages. First, you are not building a page that will lead visitors to individual product pages, but other index pages. More specifically, Sub-Categories. Additionally, you will only build one top-level Index Page.
The WM-Record Tags are still required (as for any Index Page), however an additional tag needs to be added - the "IndexLabel" tag.
The [WM-IndexLabel] tag lets you write a portion of an index page only when the value in the specified field changes between records. In the example below, we've used "All_Products" as the value for the IndexLabel tag. FYI, "All_Products" is the field name for the Main Category
Using Figure 2 (above), All_Products will produce links on the Index Page such as Cleaners, Boxes, Brushes and so on. For example, on the completed Index Page there will be a link to "Cleaners.html" Let's take a look at the code used in the tags for this Top Level Index Page:
[WM-Record]
[WM-IndexLabel: All_Products]
<a href="http://www.yoursite.net/betty_mills/[WM-Field: All_Products nolink].htm" title="[WM-Field: All_Products nolink]">[WM-Field: All_Products nolink]</a>
[/WM-IndexLabel]
[/WM-Record]The above code includes Record tags, with the other WM-Tags placed between them - just like the bottom level Index Page. Please remember to place the IndexLabel tags just like the example above, and preferably without any carriage returns.
The field names chosen for the WM-Tags above link to a lower-level (Sub-Category Index Page). Please notice these Field Names don't link to a product detail page, but link to a page based on the Sub-Category, in this case "Cleaners." Because we are making the Top-Level Index Page (we will only have one of these), WebMerge needs to be set to only build one page. On the Index Page Tab, click the radio button for "Make Only One Index Page," and type a name in the box that you want to use.
TIP: You may want to name it the same as the merchant or similar ("bettymills.htm" for example).
Remember, the "noindex" option is mandatory for all WM-Tags (except "Record" and "Index Label" tags) in all index pages. Leaving that tag out usually results in odd links and code being displayed in the browser window after loading the completed Index Page. If you see these, re-check the WM-Tags in your Index Template.
What you see between the Record tags is a standard HTML HREF tag, similar to what is used in the Detail Template. The Title tag is optional on your part, but including it is good practice. The title tag can be read by text-readers (used by the visually impaired).
Other places for WM-Tags in the Index Template
WM-Tags used to build links from the Index Pages, are not the only use of WM-Tags in your Template. WM-Tags can also be used in the header, for example to add the name of the category between the <title></title> HTML tags. Remember, there are lots of creative ways in which you can use the information in the data feed. Another example, might be where the category name is inserted at the top of the HTML code displayed in the user's web browser between <h1> tags. This is another way to help one's search engine rankings.
Once the Detail and Index templates are designed, and saved, you can then begin saving the settings for WebMerge.
TIP: Please see the Files and Categories Requirements Matrix for files and categories required for multi-Tier design...
NEXT SECTION - Setting Up WebMerge
Home :: About Us :: Privacy :: Web Design :: Graphics :: Links :: Purchase WebMerge