Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

ASP Content Rotator Component Content Schedule File

The Content Schedule file contains information that the ContentRotator object uses to manage and display the specified content. In this file you include any number of HTML content string entries. Each entry consists of two parts: a line that begins with double percentage signs (%%) and contains both the relative weight and any comments, and a second part that contains the HTML content string itself.

Syntax: ASP Content Rotator Component Content Schedule File

%% [#Weight] [//Comments]

ContentString

Parameters: ASP Content Rotator Component Content Schedule File
ASP Content Rotator Component Content Schedule File Weight Parameter

This optional parameter specifies a number between 0 and 10000 that indicates the relative weight of the HTML content string. The probability of a particular content string being displayed by the ContentRotator object can be expressed as the Weight of that content string divided by the sum of Weight values for all entries in the Content Schedule file.

For example, if a Content Schedule file contained three content strings with respective weights of 1, 3, and 4, the Content Rotator displays the first content string one-eighth of the time, the second string three-eighths of the time, and the third string half of the time.

A Weight of 0 will cause a content entry to be ignored.

If Weight is not specified, the default value is 1.

If the sum of all weight values exceeds 10000, an error will be generated when the schedule file is accessed by a call to either the GetAllContent or ChooseContent methods.

ASP Content Rotator Component Content Schedule File Comments Parameter

This optional parameter contains comments about the entry. These comments are for development use only and are not displayed to the user. If you require more than one line of comments, you must start each additional comment line with a line delimiter (%%) followed by a comment delimiter (//).

ASP Content Rotator Component Content Schedule File ContentString Parameter

The HTML content that the ContentRotator object displays. For example, you can present a line of text, an image, or a sound.

ContentString may include one or more lines. The ContentRotator object treats everything between blocks of double percent signs (%%) as a single HTML content string.

Examples: ASP Content Rotator Component Content Schedule File Parameters

The following is an example of a Content Schedule file.

Note

Because the content strings can contain HTML tags, you can display any type of content that can be represented with HTML, including text, images, and hyperlinks.

-------------Content.txt--------------------

%% // Because no value is set for Weight, the default value is 1.

Don't run with scissors.

%% #2 // Content can be more than one line long.

%% // Additional line of comments.

%% // Yet another line of comments.

<FONT FACE="ARIAL,HELVETICA" SIZE="2">

Let a 

<H1>smile</H1> 

be your umbrella. 

</FONT>

%% #3 // This is our favorite image, so show it most often.

<IMG SRC="/images/happy.gif">

%%

Here's the <A HREF="secret.asp">secret link.</A>

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.