Embedding your Ads

You have two Twig tags available to you...

# Show a single, specific Ad

# displayAd(id, options = {})

  • id - ID of specified Ad.
  • options - See options.

Specify the Ad by its ID number:

{{ craft.adWizard.displayAd(99) }}

Or if you're already working with an existing AdModel, you can skip the id parameter:

{{ ad.displayAd() }}

# Random Ad from a specific group

# randomizeAdGroup(handle, options = {})

  • handle - Handle of specified Ad Group.
  • options - See options.

Specify the group by its handle:

{{ craft.adWizard.randomizeAdGroup('rightSidebar') }}

Both methods will only show valid Ads.

It's also possible to retrieve Ads via an Element Query.