Context Ads

Stop messing with lengthy javascript code - use single EE tag to automatically display banner depending on what entry, category or channel is viewed.

Create a banner in Control Panel, associate it with certain entries, categories or channels and you will get appropriate banner(s) displayed depending on what entry/category/channel is viewed.

Concepts

Banners can be images (most common) or text. You can also append extra html to banner. The banner can be associated with one or several entries (displayed when entry is viewed), categories (displayed when entry in that category or category page is viewed) or channels (displayed when entry or entries in channel are viewed). The banner can also have no associations - in that case it is displayed if there is no matching context. The context is defined in this order: entry → category → channel → no association. I.e., if there is banner associated with the entry, it is displayed, if not - trying to display banner associated with one of entry categories, if there are none - trying to get channel-related banner; if there is still nothing to display, take one banner without associations.

Zones are "areas" on your pages used to display banners. The banner can belong to one or several zones.

Control Panel

Zones

Each zone reprezents the place on your site site's page where you want to display a banner (and where you will insert the appropriate template tag). When creating a zone, you need to specify:
• zone title (used to identify zone in Control Panel)
• zone name (can be used to referece zone in templates)

You can also specify extra html code that will be appended to each banner shown in zone. You can use it to add some tracking or analytics code, or just some static content.

Banners

Banner editing page consists of two main parts: banner data and associations.

Title is a descriptive name of your banner. It is for your own reference and used in Control Panel only.

While the banners can be deleted, it is not recommended to just hide them from site by setting Enabled to "no".

Banner image can be stored locally (use the "+" icon to upload and/or select the image) or you can also enter remove URL. Dimensions (width X height) are optional bu recommended.

Alt text is used at "alt" attribute for the image. If there is no image, text ad will be shown instead, "Alt text" will serve as the text of the link.

Link URL can be complete URL, or formatted as {path=/some/page}

You can append extra HTML code to the banner (for example, tracking or analytics code) using Extra HTML field

The banner can be automatically enabled/disabled based on check of following fields: Stop showing after views reach limit of (number), Stop showing after clicks reach limit of (number), Start showing on date , Stop showing on date.

After you specify banner data, you need to assoicate it with:
• zones; • entries; • categories; • channels.

If the banner is not associated with any zone, it is not displayed.

If the banner is not associated with any entry/category/channel, it is only displayed if there are no other banners that fit the context better.

Template tags

Show banner

{exp:contextad:show}

{exp:channel:entries limit="1" url_title="{segment_2}"}
<p>{title}</p>
{exp:contextad:show zone_id="1" entry_id="{entry_id}"}
{/exp:channel:entriess}
{exp:contextad:show zone="header" url_title="{segment_2}"}
{exp:contextad:show zone_id="3" channel="{segment_1}" category="{segment_2}" url_title="{segment_3}"}

Tag parameters:

Top of page