4.6. banner

Implements random or rotating banner ads. See also Banner/Ad rotation.

4.6.1. Summary

    [banner category]
    [banner category=my_category other_named_attributes]
Parameters Description Default
category   default
Attributes Default
table banner
r_field (unweighted) rotate
b_field banner
separator (unweighted) ':'
delimiter (unweighted) '{or}'
weighted No
once (weighted) No
c_field (weighted) category
w_field (weighted) weight
interpolate (reparse) No
Invalidates cache No
Container tag No

Tag expansion example:

    [banner category=my_category]

ASP-like Perl call:

    $Tag->banner(  { category => $key, } );

or similarly with positional parameters,

    $Tag->banner($category, $attribute_hash_reference); See Also

Banner/Ad rotation

4.6.2. Description

Implements random or rotating banner ads. See Banner/Ad rotation in the Interchange Template documentation.

You will need a banner ad table (typically called 'banner') which contains banner data. The following is an example:

code category weight rotate banner
m_3 cat1 7 0 my banner 3
m_1 cat1 1 0 my banner 1
default     1 Default 1{or}Default 2{or}Default 3
m_2 cat1 2 0 my banner 2
t_1 cat2 4 0 their banner 1
t_2 cat2 1 0 their banner 2 category

Default: category="default"

This specifies the category for weighted ad, or the table row (i.e., code value) for an unweighted ad. table

Default: table="banner"

Setting 'table="my_banner_table"' forces the tag to refer to 'my_banner_table' rather than the default 'banner' table for banner ad information. r_field

Default: r_field="rotate"

Unweighted ads only.

A table row may include multiple banners in the 'banner' column. The column specified by r_field contains a boolean that determines whether to rotate banners. In the above table example, 'Default 1', 'Default 2' and 'Default 3' would rotate. b_field

Default: b_field="banner"

This specifies the column containing the banner descriptor(s). The default is 'banner'. Note that an entry might be a delimited list of banner descriptors to rotate (see delimiter below). separator

Default: separator=":"

Unweighted ads only.

This sets the separator within the table key (i.e., code) for multi-level categorized ads. See Banner/Ad rotation. delimiter

Default: delimiter="{or}"

Unweighted ads only.

This specifies the delimiter between rotating banner descriptors in the 'banner' column. weighted

The banner tag will not apply weighting from the table unless you set weighted=1. Note that the tag will behave as if you gave it a standard unweighted entry -- it will look for a matching row rather than a matching category. once

Weighted ads only.

If the option once is passed (i.e., [banner once=1 weighted=1], then the banners will not be rebuilt until the total_weight file is removed. See Banner/Ad rotation. c_field

Default: c_field="category"

Weighted ads only.

This specifies the column containing the banner category for weighted ads. The banner tag will display ads from rows in the table whose category matches the category given in the tag, with frequency corresponding to the weights in the table. w_field

Default: w_field="weight"

Weighted ads only.

This specifies the column containing the banner weight.