Involver Developer Network : gifts
This page last changed on Feb 23, 2012 by jed.wheeler@involver.com.
OverviewNote: Gifts tag is now supported in Facebook iframes. Currently only the default view for gifts is supported. This can be obtained with the following sml code: {% gifts name:"your_custom_name" %}{% endgifts %}
The Gifts feature allows a user to select a gift and post the selected gift to a friend's wall. A gift is defined as a gift icon image, caption, and description. Additionally, the gift must have an action link text and URL. ConfigurationTo use this feature, you must add gifts. Gifts can be added on the settings page. To get to the settings page, paste the following default SML code into the Template Editor and save: {% gifts name:"your_custom_name" %}{% endgifts %}
You will see the 'gifts' feature appear in your "Feature" table. Click the 'Configure' link in the 'gifts' feature row and you should the following: Clicking the 'Add A New Gift' button will open the form: The following illustration shows where each gift's attributes map on the wall post, as well as their validation constraints. Cannot resolve external resource into attachment. Caching ConsiderationsNo special caching considerations. Attributes
Context Variables
ExamplesSimple ExampleCreate a call to action to the gifts dialog: {% gifts name:"pizza_gifter" %}
{% gifts_form_link %}Share a Pizza{% endgifts_form_link %}
{% endgifts %}
This will wrap "Share a Pizza" with an anchor, turning it into a call to action. Note: The form automatically validates that the user selected a gift and recipient. Now, the user can post the gift to the friend's wall through Facebook's publish feature: The story will appear on the friend's feed, like so: Cannot resolve external resource into attachment. Complex ExampleShow the gifts:{% gifts name:"pizza_gifter" %} <ul> {% for gift in gifts.gift_items %} <li> <p><img src="{{gift.image_url}}" alt=""></p> <p>{{gift.title}}</p> </li> {% endfor %} </ul> {% endgifts %} Specify a custom CSS class name for the anchor:{% gifts name:"pizza_gifter" %} {% gifts_form_link class:"pizza-share-cta" %}Share a Pizza{% endgifts_form_link %} {% endgifts %} Specify the title of the gifts dialog:{% gifts name:"pizza_gifter" %} {% gifts_form_link dialog_title:"Share a Pizza" %}Share a Pizza{% endgifts_form_link %} {% endgifts %} FAQ
Related Topics |
![]() |
Document generated by Confluence on Feb 12, 2013 09:09 |