Involver Developer Network : get_satisfaction
This page last changed on Feb 23, 2012 by jed.wheeler@involver.com.
OverviewThe 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. ConfigurationTo 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. ConsiderationsPlease 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
Context VariablesThe following variables are exposed for use on your SML template. They are sourced from the Get Satisfaction API.
Default TemplateThe 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. SubtagsThe 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_topicRenders a section where the user can submit a new topic. {% getsat_new_topic %} getsat_community_activityRenders stats about the community including number of topics posted, number of people engaged, and number of employees. {% getsat_community_activity %} getsat_latest_updatesRenders the latest updates from the community. {% getsat_latest_updates %} getsat_topicsRenders the first page of most recent topics posted, including pagination links and tabbed pane for filtering by topic style. {% getsat_topics %} getsat_featured_peopleRenders the list of three most recent featured people. {% getsat_featured_people %} getsat_newest_peopleRenders the list of three most recent new people who have engaged with the community. {% getsat_newest_people %} ExamplesDisplays 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 IntegrationYou 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. ExamplesRenders 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 |
![]() |
Document generated by Confluence on Feb 12, 2013 09:09 |