Involver Developer Network : facebook_like_gate
This page last changed on Jan 18, 2012 by jed.wheeler@involver.com.
The facebook_like_gate allows SML developers to gate apps by user's fan status. This allows your page to serve custom contents to users who liked your page. For most use cases we recommend using the is_page_fan ?Global Context Variable with our ?if logic system instead of using this feature block because it's lighter weight and easier to implement. Attributes
Basic example{% facebook_like_gate %} I'm a fan! {% endfacebook_like_gate %} This is the most simplistic fan gate that can be created via SML. In this view, custom partial for non-fans aren't provided. A default view will display to users who did not yet like the page, prompting them to do so. Allowed contentYou can place any SML tags and/or HTML inside the facebook_like_gate tags. All the syntax/tags currently supported in SML is supported here. Just remember one golden rule, the only limitation is your mind. Using with non_fans_partial{% partial name:"like_us" %} Like us! You shall be rewarded! {% endpartial %} {% facebook_like_gate non_fans_partial:"like_us" %} Congratz! You just became a fan! {% endfacebook_like_gate %} The above snippet will output "Like us! You shall be rewarded!" if they aren't your fan. Likewise, if they are your fan. They will see "Congratz! You just became a fan!" This will work as long as all rules for partials have been followed. Just to recap, they are: - Partial must be declared before use. i.e. the partial block must be above the facebook_like_gate tag that calls it. A fully configured example<style> #custom_partial { width: 90%; margin: auto; padding: 0 15px 10px; border: 1px solid #999; box-shadow: 0 0 5px #999; border-radius: 5px; } #fan_partial { width: 90%; margin: auto; padding: 0 15px 15px; border: 1px solid #999; box-shadow: 0 0 5px #999; border-radius: 5px; } </style> {% partial name:'custom_partial'%} <div id="custom_partial"> <h3>Sorry</h3> <p>Only fans can send gifts.</p> </div> {% endpartial %} {% facebook_like_gate non_fans_partial:"custom_partial" %} <div id="fan_partial"> <h3>Click below to send a gift to your Facebook friend!</h3> {% gifts name:"gifts" %} {% endgifts %} </div> {% endfacebook_like_gate %} ![]() ![]() ![]() ![]() |
![]() |
Document generated by Confluence on Feb 12, 2013 09:09 |