$49

Ad Wizard

Documentation  •  Changelog

Documentation

Image transforms

Ad Wizard now supports image transforms! Simply pass in your transform as the second parameter:

{{ craft.adWizard.randomizeAdGroup('rightSidebar', 'large') }}
{{ craft.adWizard.displayAd(42, 'large') }}

Complete Transform Support

Ad Wizard utilizes the native transform technology. Follow the same patterns when entering transforms here.

{% set thumb = {
    mode: 'crop',
    width: 100,
    height: 100,
    quality: 75,
    position: 'top-center'
} %}

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

Retina Support

When using an image transform, it's also possible to specify a retina output. Simply pass in "true" as the third parameter:

{{ craft.adWizard.randomizeAdGroup('rightSidebar', 'large', true) }}

If your image is using retina, you'll want to double the Image Transform size. For example, these two snippets will render the exact same image:

As a retina ad

{{ craft.adWizard.displayAd(42, 'small', true) }}

As a normal asset

<img src="{{ asset.url('small') }}" width="{{ asset.width('small')/2 }}" height="{{ asset.height('small')/2 }}" />