7.1. On-the-fly Catalog Pages

If an item is displayed on the search list (or order list) and there is a link to a special page keyed on the item, Interchange will attempt to build the page "on the fly." It will look for the special page flypage.html, which is used as a template for building the page. If [item-field fieldname], [item-price] and similar elements are used on the page, complex and information-packed pages can be built. The [if-item-field fieldname] HTML [/if-item-field] pair can be used to insert HTML only if there is a non-blank value in a particular field.

Important note: Because the tags are substituted globally on the page, [item-*] tags cannot be used on the default on-the-fly page. To use a [search-region] or [item-list] tag, change the default with the prefix parameter. Example:

   [item-list prefix=cart]
   [cart-code] -- title=[cart-data products title]

To have an on-the-fly page mixed in reliably, use the idiom [fly-list prefix=fly code="[data session arg]"] [/flylist] pair.

[fly-list code="product_code" base="table"] ... [/fly-list]

            prefix=label     Allows [label-code], [label-description]
           [fly-list code="[data session arg]"]
            (contents of flypage.html)
            [page 00-0011] One way to display the Mona Lisa </a>
            [page flypage2 00-0011] Another way to display the Mona Lisa </a>

If the directive PageSelectField is set to a valid product database field which contains a valid Interchange page name (relative to the catalog pages directory, without the .html suffix), it will be used to build the on-the-fly page.

Active tags in their order of interpolation:

[if-item-field field]    Tests for a non-empty, non-zero value in field
[if-item-data db field]  Tests for a non-empty, non-zero field in db
[item-code]              Product code of the displayed item
[item-accessories args]  Accessory information (see accessories)
[item-description]       Description field information
[item-price quantity*]   Product price (at quantity)
[item-field field]       Product database field
[item-data db field]     Database db entry for field