Note that this module has been deprecated and users should migrate to the Advertisement Module instead.
Starting with version 4.7 of the module, Banners have their very own node type. To add a graphic banner, you need to have the Upload module enabled (graphics are attached to the banner nodes). Also, you will need to add them to a taxonomy term. Click administer » categories and either create a new vocabulary with the "banner" node type or add the "banner" node type to an existing vocabulary. Once you're done, click create content » banner to create a banner.
As listed on the Banner module info page, the banners module provides an interface to manage banners. To actually display the banners on your site, you need to add a small snippet of PHP code in either a block or directly to your theme template.
If you are not comfortable with editing your theme, adding a custom PHP block is the easiest method, but you will only be able to display banners in the sidebar. To add, for example, a banner to your header, you will need to edit your theme.
banner_display(42,1) function is what is needed to display banners.
The number in parentheses refers to the taxonomy term ID from which you would like to show banners. Banners belong to taxonomy terms, so you will need to know the term ID for which they belong. You can usually find this out by going to administer » categories, then click the "list terms" link in your banner vocabulary to find the IDs for the category you use.
Displaying banners in a custom block
- Click administer » blocks then the add tab.
- Type in a title. This will be shown to the user as the heading for the block.
- Choose "PHP code" as the input filter
- Paste in the following code:
<?php return banner_display(42, 1); ?>
- Note: replace 42 with the taxonomy term ID from the category you assigned the block(s) you want to rotate through in this block
See the Blocks section for more information on working with the placement and setup of blocks.
Displaying banners directly as part of your PHPTemplate-based theme
- In your theme's page.tpl.php file where you want the banner to appear, paste in the following code:
<?php print banner_display(42,1); ?>
As noted above, the number indicates from which taxonomy term ID to display banners. You may add this code in multiple places in your theme, with either the same or different banner group numbers.
Important note: the code is slightly different than that for a block, in that it uses 'print' instead of 'return'.
- Save your page.tpl.php file.
See the PHPTemplate section of the theme developer's guide for more information on theming.
This was adapted from Bryght's banner configuration guide.