Code Snippets: Banner Advertisements
The banner advertisement module can be used by the website owner to manage a set of images. Each image can be associated with a web address. The module can display one image (advertisement) at a time, or flip through a stack of images using a timer. When an image is clicked by a normal web surfer, the associated web address is loaded.
- Random or ordered image rotation.
- Images can load once when the page is loaded, or rotate on a timer.
- Images can be de-activated without being deleted from the list.
- Images (advertisements) can appear throughout the site, or be restricted to certain pages.
<clearsite:hidden module="rotateimage" name="rotateimage1" sitewide="1"
method="random" changewhileloaded="1" refreshdelay="15" ></clearsite:hidden>
- The "sitewide" attribute allows you to dictate weather the advertisements that are uploaded into this module appear throughout the site (whenever the module is present on a page) or only current section of the site (wherever you happen to be when you upload the banner image). For example, if the site is an online electronics store - there may be a section on TVs and a section on Computers. Obviously you will want separate sets of advertisements, so you would set sitewide="0".
- "changewhileloaded" and "refreshdelay" work in conjuction. If changewhileloaded is set to 1 then the current advertisment will be replaced by a new one ever few seconds. The number of seconds is set in the "refreshdelay" attribute. Alternatively, if "changewhileloaded" is set to 0 the advertisement will be set when the page is loaded, and will not change until the next time the page is loaded.