This page last changed on Nov 22, 2011 by jed.wheeler@involver.com.

Overview

Objects returned by the contest feature block


Displaying Contest Entries

Context Variables

name type description
contest_entry.registration.<field name>
string registration-related information supplied in the entry from
contest_entry.submission.<field name> string submission-related information supplied in the entry from
contest_entry.contest_user
string The contest_user who submitted this entry
contest_entry.contest_entry_canvas_page_url
string A unique URL for viewing this entry in a Canvas Page
contest_entry.submission String This is contains a hash of all the input fields defined in the contest_entry_form block with the submission[inputname] format* *
contest_entry.registration String This is contains a hash of all the input fields defined in the contest_entry_form block with the registration[inputname] format* *
contest_entry.like_count Integer Total number of likes that the entry has received. Read more.
contest_entry.published_at Date String When the contest entry was published/approved.
contest_entry.published_relative_time
Date String Returns the time ago in words. eg. "2 days ago"
contest_entry.status String Returns status of the contest entry ("winner" / "approved")

Displaying video submissions

The following attributes are available when capturing UGC videos using the video_upload_field tag:

name type description
contest_entry.submission.'your_video_entry_field_name'_ encoding_status
string Returns status of the encoded video('error'/'done')
contest_entry.submission.'your_video_entry_field_name'_encoded_video_url string Returns URL for the encoded video.
contest_entry.submission.'your_video_entry_field_name'_ thumbnail_url
string Returns URL for the thumbnails of the uploaded video.

You may want to display only entries that were successfully encoded. You can put the following code in the contest block:

<h3>Entries</h3>

{% paginate contest.contest_entries order:"created_at DESC" per_page:4 %}
  <table>
  {% for entry in contest_entries %}
    <tr>
      <td>Name: {{ entry.registration.name }}</td>
      <td>Added: {{ entry.published_at | date: "%m/%d/%y" }}</td>
      <td>{{ entry.submission.video_encoding_status }} Like: {% content_like entry %}</td>
      <td><img src="{{ entry.submission.video_thumbnail_url | resize_to:'150' }}" alt=""></td>
    </tr>

    {% if entry.submission.video_encoding_status == 'done' %}
      <tr>
        <td colspan="4">{% video_player video_url:entry.submission.video_encoded_video_url imgsrc:entry.submission.video_thumbnail_url %}</td>
      </tr>
    {% endif %}
  {% endfor %}
  </table>

  {{ pagination_links }}
{% endpaginate %}

Displaying photo submissions

Assuming you are using submission[before_photo] as your image_upload_field attribute:

<h3>Entries</h3>

{% paginate contest.contest_entries order:"created_at DESC" per_page:4 %}
  <table>
  {% for entry in contest_entries %}
    <tr>
      <td>Name: {{ entry.registration.name }}</td>
      <td>Added: {{ entry.published_at | date: "%m/%d/%y" }}</td>
      <td><img src="{{ entry.submission.before_photo | resize_to:'150' }}" alt=""></td>
    </tr>
  {% endfor %}
  </table>

  {{ pagination_links }}
{% endpaginate %}

Scoping to only winning entries

<h3>Entries</h3>

{% paginate contest.winning_contest_entries order:"created_at DESC" per_page:4 %}
    <table>
      {% for entry in contest_entries  %}
        <tr>
          <td>Name: {{ entry.registration.name }}</td>
          <td>Added: {{ entry.published_at | date: "%m/%d/%y" }}</td>
          <td><img src="{{ entry.submission.before_photo | resize_to:'150' }}" alt=""></td>
        </tr>
      {% endfor %}
    </table>

    {{ pagination_links }}
{% endpaginate %}

Contest Entry Moderation

The contest entry moderation process should be done through AMP. Administrator should add his/her Facebook fan page with contest to the AMP's Social Apps Section; after the process is complete, the administrator should be able to see "Contest" tab under Monitor tab in the AMP - a section where submitted entries are displayed and can be approved, disproved or marked as winners.

Contest Entry Sharing

When using a ?share tag, you have the option to pass in a link attribute that is used as the target link of the content that is posted to the end-user's newsfeed. This link will take the end-user back to the Facebook Fan Page Tab url by default, but you also have the option to take the end-user to a dedicated canvas page. To use this option, there are two steps:

1. Configure the canvas page SML that you'd like to use on the contest feature block settings page under the "Contest Entry Canvas Page SML" text area, and save. You have access to the context variable 'contest_entry' and the following social tags: ?share, ?content_like, and ?content_comments.

2. Use the contest_entry.contest_entry_canvas_page_url context variable for the 'link' and/or 'image_link' attributes for the ?share tag.


FAQ

There are currently no FAQ questions for this item.


Related Topics

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