This page last changed on Oct 18, 2011 by jed.wheeler@involver.com.

DEPRECATION NOTICE: This tag will no longer work with new SML application instances on Facebook fan page tabs from March 10th, 2011 onward. This is due to Facebook's migration of tabs from FBML to HTML iframes with XFBML, along with the fact that there is no support for this tag in XFBML. For more details please visit our blog post on this topic: http://blog.involver.com/2011/02/facebook-drops-fbml-in-favor-of-iframes-advantages-challenges/

What to use instead:
content_vote http://developers.involver.com:8080/display/IDN/content_vote
or
facebook_like http://developers.involver.com:8080/display/IDN/facebook_like


Notes

This tag is intended for casual "Liking" and should NOT be used as part of a voting mechanism for anything with high security requirements like a contest. There are ways to get multiple "Likes" per user registered, though they are not easy. It is extremely effective for normal "Like" use, but is inappropriate if there are security concerns. If you want to do something with higher security, use the contest infrastructure.


Attributes

name type required description
action_text string no This is text of the link to like the content (ie, Like)
like_noun string no This is the singular noun for the description (ie, person).
like_noun_plural string no This is the plural noun for the description (ie, people)
like_verb string no This is the singular verb for the description (ie, likes this)
like_verb_plural string no This is the verb to use with the plural noun (ie, like this)
success_callback string no JS function that takes an AJAX response object.
       

Examples

Below is an example of adding liking around each tweet item of a Twittter Feed feature block.

<div class="twitter-box">
    <h2>Tweets from Involver, Follow us<br />
    @<a href="http://www.twitter.com/involver">Involver</a></h2>

    {% twitter_feed %}
        {% paginate twitter_feed.tweets per_page:5 %}
            {% for story in tweets %}
              <div class="tweet">
                <h3>{{ story.title | twitter_link | auto_link }}</h3>
                <p>{{ story.published_relative_time }}</p>
              </div>
            {% endfor %}
        {% endpaginate %}
    {% endtwitter_feed %}
</div>

Will output:

Now let's add in the {% content_like %} tag:

<div class="twitter-box">
   <h2>Tweets from Involver, Follow us<br>
   @<a href="http://www.twitter.com/involver">Involver</a></h2>

   {% twitter_feed %}
      {% paginate twitter_feed.tweets per_page:5 %}
         {% for story in tweets %}
            <div class="tweet">
               <h3>{{ story.title | twitter_link | auto_link }}</h3>
               <p>
                  {{ story.published_relative_time }} -
                  {% content_like story %}
               </p>
            </div>
         {% endfor %}
      {% endpaginate %}
   {% endtwitter_feed %}
</div>

Save and reload the tab and you'll now see the Like links:


After a user clicks "Like" and the page is reloaded, the view will change:


FAQ

  1. Does this tag work with the Facebook Open Graph Like?
    Currently, the SML 'content_like' tracks works on an Involver content item, which is not related to the Facebook Open Graph.
  1. How do I use an anonymous function with the success_callback attribute?
    You can use anonymous functions in the success_callback attribute. You must return your inline code as a function from a self-invoking anonymous function. For example:
{% content_like [item] success_callback:"(function(){ return function(resp){ console.log(resp) }})()" %}

Related Topics


Document generated by Confluence on Feb 12, 2013 09:09