This page last changed on May 25, 2011 by steve.hull@involver.com.

topic

Topic that comes back from the Get Satisfaction API. Topics do not load initially with responses, but responses can be acquired from the sml.tag.GetSatisfaction Javascript library.

Error handling

If topics fail to load from the Get Satisfaction API, the entire {{ get_satisfaction.topics }} attribute will be the word "error" instead of an array.

Attributes

name type description
topic.at_sfn string URL of topic on Get Satisfaction site
topic.author person Author of the topic
topic.company_id integer Company ID
topic.content string Content of the topic
topic.created_at string The date and time the topic was created (GMT)
topic.employee boolean Whether or not the author is an employee
topic.flag_count integer Count of how many users have flagged the topic
topic.follower_count integer How many users are following the topic
topic.has_promoted_replies boolean Whether or not the topic has replies that have been promoted, either by the company or by stars
topic.id integer Topic ID
topic.last_active_at string The date and time the topic was last active (GMT)
topic.me_too_count integer Count of users who have clicked "Me Too"
topic.most_recent_activity string Type of latest activity on the topic (eg, "create")
topic.reply_count integer Count of how many users have replied to the topic
topic.slug string topic slug
topic.status string or null Status of topic (eg, "rejected", "complete", etc)
topic.style string Style of topic (eg, "problem", "question", "idea", or "praise")
topic.subject string The subject of the topic
topic.url string Get Satisfaction API URL for this topic

Examples


{% partial name: "topics" %}
  {% partial name: "topic" %}
    <div class="topic_wrapper">
      <div class="topic">
        {% if topic.author.facebook_id %}
          <fb:profile-pic uid="{{ topic.author.facebook_id }}" size="q" class="avatar-img"></fb:profile-pic>
        {% else %}
            <a href="{{ topic.author.at_sfn }}" class="avatar-img" ><img src="{{ topic.author.avatar }}" alt="{{ topic.author.name }}" /></a>
        {% endif %}

        <div class="entry {{ topic.style }}">
          <p class="title">{{ topic.subject }}</p>
          <p id="topic_content_container_{{ topic.id }}" class="message">
            {% if topic.content.size > 0 %}
              {{ topic.content }}
            {% endif %}
          </p>
        </div>
        <span id="{{ topic.id }}_me_too">{{ topic.me_too_count | pluralize: 'person has', 'people have' }}</span> this {{ topic.style }} &#183;
      </div>
    </div>
  {% endpartial %}

  {% for topic in topics %}
    {% render partial: "topic" topic: topic %}
  {% endfor %}

  {% if topics.size == 0 %}
    <p><div align="center"><h1>No Topics found</h1></div></p>
  {% endif %}
{% endpartial %}

<div id="topics">
  {% unless get_satisfaction.topics == "error" %}
    {% render partial:"topics" get_satisfaction:get_satisfaction style:'recent_activity' topics:get_satisfaction.topics %}
  {% else %}
    <p><div align="center"><h3>There was a problem retrieving the topics from this community. Please try hitting "Refresh" in your browser.</h3></div></p>
  {% endunless %}
</div>
Document generated by Confluence on Feb 12, 2013 09:09