Involver Developer Network : coupon
This page last changed on Oct 07, 2011 by adam.kane@involver.com.
OverviewProvides the ability to display coupons for a given campaign. ConfigurationNo special configuration requirements. Caching ConsiderationsNo special caching considerations.
Attributes
Context Variables
ExamplesBasic UsageThis 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 CouponsHere 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 %} FAQThere are currently no FAQ questions for this item. Related Topics |
![]() |
Document generated by Confluence on Feb 12, 2013 09:09 |