Frequently Asked Questions

Jul 22, 2024 - 05:40am

 [F] Frequently Asked Questions  / Appearance  /

How can I include rotating ads using WCTL?

Rate This FAQ
 (Not yet rated)

Created On: 12 Dec 1997 10:30 am
Last Edited: 9 Feb 2005 12:54 am

Question Printer Friendly

Web Crossing sites often wish to include rotating advertisements in Web Crossing pages.


Rotating ads for static web pages are often done via server-side includes but we're not aware of any web server that supports SSI for CGI applications. Fortunately, there are several other ways to accomplish ad rotation. Web Crossing releases after 2.0.1 support the WCTL "exec" command that calls an external script or application such as NetGravity and a number of Web Crossing sites use that. A few sites use a java applet. A relatively simple level of ad rotation can be done entirely in WCTL, using code something like this:

%% if site.BannerCount == 0 %%
        <h1>This site partly sponsored by the Apple Grower's Association</h1>
%% endif %%
%% if site.BannerCount == 1 %%
        <h1>This site partly sponsored by the Global Orange Society</h1>
%% endif %%
%% if site.BannerCount == 2 %%
        <h1>This site partly sponsored by the International Banana Federation</h1>
%% endif %%
%% set site.BannerCount site.BannerCount + 1 %%
%% if site.BannerCount == 3 %
        %% set Site.BannerCount 0 %%
%% endif %%