Frequently Asked Questions

Nov 12, 2019 - 03:28pm

 [F] Frequently Asked Questions  / Appearance  /

How can I include rotating ads using WCTL?

Rate This FAQ
 (Not yet rated)

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

Question Email This Printer Friendly

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

Answer

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:




Example
%% 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 %%