Index  Up  >>  


Body and Buttonbar Control

MiniVend provides centralized page color and imagemap control through use of the [body n] and [buttonbar n] elements. It also can place a random message from a series of messages with the [random] element, and embed help messages with the [help item] element.

The [body n] element selects a color scheme -- numbered from 1 to 15 -- that is set by the Mv_Background, Mv_TextColor, Mv_BgColor, Mv_LinkColor, and Mv_VlinkColor directives. Each can contain up to 15 parameters, after an opening BEGIN. Here is an example:

    Mv_Background  BEGIN /images/blue_pap.gif
    Mv_BgColor     BEGIN none steelblue white
    Mv_LinkColor   BEGIN none white black
    Mv_TextColor   BEGIN none ltgreen blue
    Mv_VlinkColor  BEGIN none orange purple

The above sequence set in the catalog.cfg file, defines three color schemes, accessed with [body 1], [body 2], and [body 3] elements in MiniVend pages. The first scheme uses the file /images/blue_pap.gif as the background pattern, and keeps the user's default colors for everything else. It is called by a [body 1] element, which when expanded becomes <BODY BACKGROUND=``/images/blue_pap.gif>.

NOTE: To be compatible with HTML editors, it is recommended you use the HTML syntax for this tag:

        <BODY MV="body 1">

All references to [body N] can be assumed to mean this call.

If an extra bit of text is included after the scheme number, then it will be appended to the body tag. This allows JavaScript and other things to be inserted. It is appended, and for most browsers this means that previous definitions made by the numbered scheme will be overridden.

The second scheme defines no background pattern (there is only one file in the Mv_Background directive), but defines a background color of steelblue, with a text color of white, a link color of light green, and a visited link color of orange. It is accessed by the [body 2] element, which when expanded becomes <BODY BGCOLOR=``steelblue'' TEXT=``white'' LINK=``ltgreen'' VLINK=``orange''>.

The third color scheme is similar to the second, except defines white-black-blue-purple for the four colors. It is accessed with a [body 3] element.

If there is no defined scheme for a body element (as there wouldn't be if you put [body 4] in a page with the above schemes defined) MiniVend simply outputs a standard <BODY> tag.

NOTE: [buttonbar] is deprecated in favor of Variable.

Image maps can be supplied and similarly controlled with the [buttonbar n] series of tags. They are defined with the ButtonBars directive in catalog.cfg, and take the form of a series of file names in MiniVend format -- i.e., relative to the PageDir and without a .html extension. To use the buttonbars, create a file with an IMG directive set with the USEMAP element and an associated client-side image map (defined with < MAP> < /MAP>. The [areatarget page frame] or [area page] tags are used to set the URLs. An example:

    <IMG SRC="/sample/images/artbar0.gif" USEMAP="#ARTBAR0">
    <MAP NAME=ARTBAR0>
    <AREA COORDS="198,0,278,20" HREF="[areatarget fr_sel search]">
    <AREA COORDS="303,0,363,20" HREF="[areatarget fr_search search]">
    <AREA COORDS="388,0,442,20" HREF="[areatarget fr_greet main]">
    <AREA COORDS="473,0,537,20" HREF="[areatarget control main]">
    <AREA COORDS="0,0,560,20" NOHREF>
    </MAP>

If the above were saved in the file PageDir/bars/artbar0.html (where PageDir is your MiniVend pages directory), you would be able to access this imagemap in your pages with a [buttonbar 0] tag, at least after MiniVend read this line in the configuration file:

    ButtonBars  bars/artbar0 bars/artbar1 bars/artbar2

The above entry allows you to define three imagemaps and access them in your pages simply as [buttonbar 0], [buttonbar 1], and [buttonbar 2]. The advantage of this scheme is central definition of a series of button bars with only a few tags -- if you change your page colors or mapping, you need only change one file and the change will roll over to all of your catalog pages. Since some installations can number in the thousands of catalog pages, using the pre-defined buttonbars can save a lot of editing. (Server-side includes cannot be used to achieve the same thing with MiniVend, since they wouldn't have the proper URLs.)


Index  Up  >>