This page last changed on Jun 07, 2012 by louis.salin@involver.com.

contest_form_link


Attributes

name type required description
entry_form_partial

string yes Name of the partial that contains the Entry Form SML
success_partial string yes Name of the partial that contains the Success SML
exceeded_partial string no Name of the partial that contains customized SML displayed when the number of entries for a user is reached
div_id string no Use this attribute to open the contest entry form inside a div with an id set to the value of div_id. You will need to add an empty div in your SML template.
form_height int
no
Adjusts the contest form dialog size height.
form_width
int
no
Adjusts the contest form dialog size width.
dialog_title
string
no
If a dialog is used, then this will override the default title of the dialog "Submission".
class string no The class attribute of the contest form link
style string no The style attribute of the contest form link
onclick string no The handler for javascript code on every click of the contest form link
onfirstclick string no Same as onclick, except the javascript is only executed on the first click of the contest form link
authorization_timing
string no When to show the Facebook authorization dialog. Set the value to "on_submit" to ask for user authorization when submitting the contest form, or set the value to "on_show_form" to ask for user authorization when the contest form is displayed on the screen. If this attribute isn't present, it will default to "on_show_form".
Waiting until form submission to show the Oauth means that user data from the contest_user context variable (which is populated by the info requested from the Open Graph by the OAuth) will not be available to pre-populated form values.

The contest_form_link is used to create a link that calls the contest entry form partial and, on completion of the form, loads the success partial. It is a critical piece of the contest Feature Block without which the block will not function.

Our system is built so that if you change the fields in your contest part way through the contest the data fields being exported will intelligently update to the new form configuration. In order to make that work our system scans the entry form in your tab before running export. This means that all contest feature blocks must have a contest_form_link tag properly configured and in place in order for data export of the contest entries to work. Without it our system won't be able to recognize the form and thus won't able to scan and complete the data export.

Typical Use-Case

In most scenarios the contest_form_link is used very straightforwardly.

{% contest_form_link entry_form_partial:'entry_form' success_partial:'success' %}
    Text of Link goes Here
{% endcontest_form_link %}

Will launch the entry form in a Jquery dialog box and is the default configuration. The contest_form_link tag simply replaces the anchor tag that you would normally wrap around your link text.

If you want the form to appear inline in a div instead of in a popup, add the div_id attribute like so:

{% contest_form_link entry_form_partial:'entry_form' success_partial:'success' div_id:'entry_form_display' %}
    Text of Link goes Here
{% endcontest_form_link %}

<div id="entry_form_display"></div>

Firing Javascript from the contest_form_link

The contest_form_link tag does not currently include an onclick attribute that would allow you to hook javascript onto it directly. Instead, you can wrap the link in a css id and fire your javascript remotely when someone clicks on the link.

<div id="contestlink">
    {% contest_form_link entry_form_partial:'entry_form' success_partial:'success' %}
        Text of Link goes Here
    {% endcontest_form_link %}
</div>

<script type="text/javascript">
$(document).ready(function() {
	$("#contestlink").click(function() {
            Function Goes Here
         };
};
</script>

Related Topics

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