This page last changed on Oct 07, 2011 by adam.kane@involver.com.

Overview

Provides the ability to display coupons for a given campaign.


Configuration

No special configuration requirements.


Caching Considerations

No special caching considerations.


Attributes

name type required description
name string false This is a name to identify the specific feature instance that you are using in your template code. This is useful if you have multiple instances of the same feature on the same page. Note: By default, the SML will look for a nick name of "default" if you do not specify one in the tag definition.

Context Variables

name type description
coupon_items Array Returns an Array of coupon_items.
links_open_new_window boolean Make links open a new window (default layout only).

Examples

Basic Usage

This code will render the default layout which displays each coupon and a link below the coupon to print the coupon.

If you have more than one coupon configured, it will output each coupon vertically on a page.

<h2>Check out our specials!</h2>

{% coupon name:"fingerhut" %}{% endcoupon %}

Iterating Through Coupons

Here is an example of iterating through each coupon item in the inner SML block definition. This assumes each coupon item has a destination url configured.

{% coupon %}
    {% for current_coupon in coupon.coupon_items %}
        <p>
        <a href="{{current_coupon.destination_url}}"><img src="{{current_coupon.image_url}}" alt=""></a><br>
        <a href="{{current_coupon.print_url}}">Print Coupon</a></p>
    {% endfor %}
{% endcoupon %}

Coupon With Print Button And Share Link

{% coupon %}
    {% for current_coupon in coupon.coupon_items limit:1 %}
        <p>{% share current_coupon description:"Get FREE Cards!" %}</p>

        <p><a href="{{current_coupon.print_url}}">Print Coupon</a></p>
    {% endfor %}

    <h2>Hot Deals</h2>

    {% for current_coupon in coupon.coupon_items limit:1 %}
        <p><img src="{{current_coupon.image_url}}" alt="Get 2 free cards!"></p>
    {% endfor %}
{% endcoupon %}

FAQ

There are currently no FAQ questions for this item.


Related Topics


coupon_example.jpg (image/jpeg)
coupons_example_2.jpg (image/jpeg)
Document generated by Confluence on Feb 12, 2013 09:09