This page last changed on Feb 23, 2012 by jed.wheeler@involver.com.

Overview

The Get Satisfaction SML block allows you to integrate your GetSat account into your Involver SML tabs with full customizability of your front-end user experience. The tag is most powerful when used in conjunction with the Get Satisfaction Javascript API, which provides hooks for reading/writing to the API.

This Feature Block is only available to customers with an existing GetSat account. For more information on GetSat and their product you can visit http://getsatisfaction.com.


Configuration

To get started, enter your company name in the Company field.

Additionally, if your account has products, you can select a particular product from the drop-down. When a product is selected, both API reads and write will be scoped to that product. For more information on adding products, visit http://getsatisfaction.com/help/managing-products

Lastly, you can toggle the different sections of the default SML template.

Note: Section toggle attributes are exposed in SML and enforced by the default template. If the SML tag is overridden by custom code, please know that these settings will still appear in the settings form.


Considerations

Please note that, due to the stateless nature of our interaction with the Get Satisfaction API, this tag is not compatible with our Social Tags and paginate helper block.


Attributes

name type required description
name string false Name of the feature

Context Variables

The following variables are exposed for use on your SML template. They are sourced from the Get Satisfaction API.

name type description
id integer ID of the feature
signature string Unique hash for this feature
company string Company name this feature is assigned to
stats Hash of stats attributes Basic stats on community activity
topic_pages int Number of pages for landing page topics ('recent_activity')
topics Array of topics List of 'recent_activity' topics for the first page
newest_people Array of people Newest people who have engaged with community
featured_people Array of people Featured people who have used this application
latest_updates Array of topics of type 'update' Latest updates with their respective title and URLs
enable_question_submission
boolean Maps to 'Enable Question Submission?' toggle on settings page
enable_idea_submission
boolean
Maps to 'Enable Idea Submission?' toggle on settings page
enable_problem_submission
boolean
Maps to 'Enable Problem Submission?' toggle on settings page
enable_praise_submission
boolean
Maps to 'Enable Praise Submission?' toggle on settings page
display_latest_updates
boolean
Maps to 'Display Latest Updates?' toggle on settings page
display_featured_people
boolean
Maps to 'Display Featured People?' toggle on settings page
display_stats boolean
Maps to 'Display Stats?' toggle on settings page
maintenance_mode boolean Is GetSat's API in maintenance mode?
licensed boolean Is this account licensed to use GetSat on Facebook?

Default Template

The easiest way to get started with the tag is by including the get_satisfaction block in your template with an empty body like so:

{% get_satisfaction %}{% endget_satisfaction %}

This will render the default SML template, which encapsulates the Javascript, CSS, and subtags that power the self-serve Get Satisfaction on Facebook experience.


Subtags

The default template is comprised of the following subtags. Each component encapsulates the HTML and Javascript for that particular section of the application.

Subtags can be overridden with custom functionality by replacing the tag with its respective SML source.

Note: The SML source for a particular subtag is subject to change (i.e. bug fixes, feature additions). Please be aware that any updates to the source will have to be backported to previously customized applications.

getsat_new_topic

Renders a section where the user can submit a new topic.

{% getsat_new_topic %}

getsat_community_activity

Renders stats about the community including number of topics posted, number of people engaged, and number of employees.

{% getsat_community_activity %}

getsat_latest_updates

Renders the latest updates from the community.

{% getsat_latest_updates %}

getsat_topics

Renders the first page of most recent topics posted, including pagination links and tabbed pane for filtering by topic style.

{% getsat_topics %}

getsat_featured_people

Renders the list of three most recent featured people.

{% getsat_featured_people %}

getsat_newest_people

Renders the list of three most recent new people who have engaged with the community.

{% getsat_newest_people %}

Examples

Displays a list of stats

{% get_satisfaction %}
    <h2>Community Activity</h2>

    <table class="activity">
        <tr>
            <th>Topics Posted</th>
            <td id="num_topics">{{ get_satisfaction.stats.topics_posted | number_with_delimiter }}</td>
        </tr>

        <tr>
            <th>People</th>
            <td id="num_people">{{ get_satisfaction.stats.people | number_with_delimiter }}</td>
        </tr>

        <tr>
            <th>Employees</th>
            <td id="num_employees">{{ get_satisfaction.stats.employees | number_with_delimiter }}</td>
        </tr>
    </table>
{% endget_satisfaction %}

Javascript API Integration

You can do more powerful user experience integrations by using the Javascript APIs. These will let you develop widgets that can read/write to the Get Satisfaction API.

Examples

Renders a list of 'problem' style topics using the Get Satisfaction and Partial Javascript API

{% get_satisfaction %}
    <script type="text/javascript">
    // Initialize the Get Satisfaction Javascript API object
    var getSatisfaction = new sml.tag.GetSatisfaction({
      id: {{get_satisfaction.id}},
      signature: "{{get_satisfaction.signature}}",
      company: "{{get_satisfaction.company}}"
    });

    jQuery(document).ready(function() {
      // Attach the AJAX call and partial rendering on click unobtrusively
      jQuery('.problems').click(function(event) {
        event.preventDefault();
        getSatisfaction.getTopics({
          style: 'problem',
          page: 1,
          success: function(data) {
            // Render the partial with the topics response
            sml.tag.Partial.get('topics').render({
              locals: {topics: data.topics},
              success: function(html) {
                jQuery('.problems_wrapper').html(html);
              }
            });
          }
        });
      });
    });
    </script>

    {% comment %}Setup the topics partial{% endcomment %}

    {% partial name:"topics" %}
        <ul>
            {% for topic in topics %}
                <li>
                    <p>Subject: {{topic.subject}}</p>
                    <p>Author: {{topic.author.name}}</p>
                    <p>Content: {{topic.content}}</p>
                </li>
            {% endfor %}
        </ul>
    {% endpartial %}

    <p><a href="#_" class="problems">Render Problems</a></p>

    <!-- Rendered problems will be injected into here -->
    <div class="problems_wrapper"></div>
{% endget_satisfaction %}

Related Topics


getsat-settings.jpg (image/jpeg)
Document generated by Confluence on Feb 12, 2013 09:09