Adding the Banner Module to a Skin

The Banner module displays entries defined under Admin/Vendors. It is usual to add it to a page content area. If the results are to appear on each page, why not add it directly to the skin?

Adding the DotNetNuke Banner module to a DNN skin follows the usual method of adding a reference and an instance at the point where it is to show, in the .ascx file for the skin.

Open the .ascx file for the skin to be modified. It will be located under the skins directory in either the portals directory for the site (number specific) or the default set (if it was uploaded under the host extensions).

/portals/0/skins/skinname/skinvariation.ascx
/portals/default/skins/skinname/skinvariation.ascx

In the skin file a reference is required, at the top, to the banner control:

<%@ Register TagPrefix="dnn" TagName="BANNER" Src="~/Admin/Skins/Banner.ascx" %>

Elsewhere within the file where the banners are to appear add a reference which includes the banenr type and the number of items. the example given below will show 3 items which have a BanenTypeId of 3 (button):

<dnn:BANNER ID="dnnBanner" runat="server" BannerTypeId="3" BannerCount="3" />

The banner module parameters may be used when referencing the module, these are:

  • GroupName
  • BannerTypeId
  • BannerCount
  • Width
  • Orientation
  • BorderWidth
  • BorderColor
  • RowHeight
  • ColWidth

The full list of banner types, together with the ID values is given in the following table:

  1. Banner
  2. MicroButton
  3. Button
  4. Block
  5. Skyscraper
  6. Text
  7. Script

To display banners on the website the source must be selected, either site or host. This is set on the Admin/SiteSettings page, in the Site Marketing section.

For reference the above check is governed by an if statement within the file /admin/skins/banner.ascx.cs (or .vb if looking at an earlier version of DotNetNuke.

if  (PortlaSettings.bannerAdvertising != 0 && Visible)

A summary of administering the vendors associated with the banners module is given in the article DotNetNuke Admin Vendors.