Difference between revisions of "NATS4 Join Page Variables"
Line 83: | Line 83: | ||
== Nostore == | == Nostore == | ||
− | If you name your field signup[nostore_XXX:1], [[NATS]] will check to make sure that field is entered, but will not try to save it into one of our database fields. This is useful for any field you want to require to be filled, such as checkboxes that are required to be checked. A common use of nostore is an "Agree with Terms" checkbox. Checkbox input fields are not submitted unless checked, so if they are not, the verification fails. To get this to work properly, you need to use a trick with having a hidden input field with the same name. In the example below, we have named the field "terms", but you may change the name to whatever you wish. | + | If you name your field ''signup[nostore_XXX:1]'', [[NATS]] will check to make sure that field is entered, but will not try to save it into one of our database fields. This is useful for any field you want to require to be filled, such as checkboxes that are required to be checked. A common use of nostore is an "Agree with Terms" checkbox. Checkbox input fields are not submitted unless checked, so if they are not, the verification fails. To get this to work properly, you need to use a trick with having a hidden input field with the same name. In the example below, we have named the field "terms", but you may change the name to whatever you wish. |
<pre><input type="hidden" name="signup[nostore_terms:1]" value="0"> | <pre><input type="hidden" name="signup[nostore_terms:1]" value="0"> | ||
Line 89: | Line 89: | ||
{if $errors.nostore_terms}<div class="error" style="padding-left:0"> You should agree with Terms </div>{/if}</pre> | {if $errors.nostore_terms}<div class="error" style="padding-left:0"> You should agree with Terms </div>{/if}</pre> | ||
− | This coding creates the checkbox and requires it to be checked. | + | This coding creates the checkbox and requires it to be checked. ''{if $vars.nostore_terms}checked{/if}'' also checks to make sure that the box remains checked if the member reloads the page, etc. The last line, ''{if $errors.nostore_terms}'' throws an error message to the member-- in this case, "You should agree with Terms"-- if the member did not check the box and the verification failed. |
== Editing Your Join Links == | == Editing Your Join Links == |
Revision as of 11:15, 13 June 2012
NATS4 offers a great deal of flexibility and customization to the NATS join form, as well as your link codes. For example, you can customize your join form to display options in different ways, or take the minimum information required by NATS. The following article describes some examples of customizing your join forms and link codes.
Editing Your Join Form
You can customize your NATS join forms by editing its template. To do so, go to the Sites Admin.
In the Sites Admin, locate the site you wish to edit your join forms for, and click the "Edit Site Templates" action icon.
On the Site Templates page, locate your "join" template. Once you have located it, duplicate your template by clicking the "Copy" action icon, marked by two sheets of paper. We recommend that you duplicate your join template so that you can retain your original form if you need to quickly revert to it.
Once you have duplicated your join template, click the "Edit" action icon, marked by a pencil, to begin customizing it.
Radio Buttons
You can choose between using radio buttons or drop-down menus to specify member payment types or membership join options.
To display your available join options as radio buttons instead of a drop-down menu, replace the following code:
<TR><TD class="join_name">Membership:</TD><TD class="join_value"> <select name="signup[optionid]" class="join_select"> {html_options options=$join_options selected=$vars.optionid} </select>{if $errors.optionid}<span class="join_error"><br>{$errors.optionid}</span>{/if} </TD></TR>
with
<TR><TD class="join_name">Membership:</TD><TD class="join_value"> {*<select name="signup[optionid]" class="join_select"> {html_options options=$join_options selected=$vars.optionid} </select>*} {html_radios name="signup[optionid]" options=$join_options selected=$vars.optionid separator="<br>"} {if $errors.optionid}<span class="join_error"><br>{$errors.optionid}</span>{/if} </TD></TR>
The join options you have made available to your members should now display as radio buttons.
Minimal Join Forms
NATS4 also allows you to edit your join forms to take the least amount of user information required by NATS-- the join option and cascade. You can also edit the join form to take any amount of information you wish, as long as the join option and cascade are defined.
For example, you can simply remove default code such as the following:
<TR><TD class="join_name">Password:</tD><TD class="join_value"> <input class="join_input" type="text" name="signup[password:1:6:16:::password_check]" value="{$vars.password}">{if $errors.password}<span class="join_error"><br>{$errors.password}</span>{/if} </TD></TR> <TR><TD class="join_name">E-Mail:</TD><TD class="join_value"> <input class="join_input" type="text" name="signup[email:1:1:128:::email_check]" value="{$vars.email}">{if $errors.email}<span class="join_error"><br>{$errors.email}</span>{/if} </TD></TR>
The above code puts a required Password and E-Mail field in your NATS join form.
If you wish to simply use a minimal join form, remove the code for each field in your template, so the required fields in your join form template should be the following:
<TR><TD class="join_name">Membership:</TD><TD class="join_value"> {*<select name="signup[optionid]" class="join_select"> {html_options options=$join_options selected=$vars.optionid} </select>*} {html_radios name="signup[optionid]" options=$join_options selected=$vars.optionid separator="<br>"} {if $errors.optionid}<span class="join_error"><br>{$errors.optionid}</span>{/if} </TD></TR> <TR><TD class="join_name">Payment Type:</TD><TD class="join_value"> <select name="cascade"> {html_options options=$payment_options selected=$cascade} {*{html_radios name="cascade" options=$payment_options selected=$cascade separator="<br>"}*} </select> {if $errors.cascade}<span class="join_error"><br>{$errors.cascade}</span>{/if} </TD></TR>
Note: If you choose to use a minimal join form, you should set the member's username to be automatically generated by NATS. You can do so by inputting the following code:
<input type="hidden" name="signup[random_userpass]" value="10:1:5">
Nostore
If you name your field signup[nostore_XXX:1], NATS will check to make sure that field is entered, but will not try to save it into one of our database fields. This is useful for any field you want to require to be filled, such as checkboxes that are required to be checked. A common use of nostore is an "Agree with Terms" checkbox. Checkbox input fields are not submitted unless checked, so if they are not, the verification fails. To get this to work properly, you need to use a trick with having a hidden input field with the same name. In the example below, we have named the field "terms", but you may change the name to whatever you wish.
<input type="hidden" name="signup[nostore_terms:1]" value="0"> <input type="checkbox" style="width:25px;" name="signup[nostore_terms:1]" value="1" {if $vars.nostore_terms}checked{/if}> {if $errors.nostore_terms}<div class="error" style="padding-left:0"> You should agree with Terms </div>{/if}
This coding creates the checkbox and requires it to be checked. {if $vars.nostore_terms}checked{/if} also checks to make sure that the box remains checked if the member reloads the page, etc. The last line, {if $errors.nostore_terms} throws an error message to the member-- in this case, "You should agree with Terms"-- if the member did not check the box and the verification failed.
Editing Your Join Links
NATS4 also allows for a great deal of customization regarding join form links. You can append various parameters to the end of an affiliate link code in order to skip the NATS join form and automatically define required information through the URL.
Bypassing the NATS Join Form
For example, you can create a join link that bypasses the NATS join form while creating a random username and password for the member, defining their first name, join option, and cascade.
http://demo.nats4.com/signup/signup.php?nats=MC4wLjEuMS4wLjAuMC4wLjA&step=2&signup[random_userpass]=10:1:5&signup[firstname]=Mike&signup[optionid]=4&cascade=3
&signup[random_userpass]=10:1:5 gives the member a random 10 character username that is all lowercase. This also sets NATS to attempt to generate a random username 5 times before failing. For more information on setting the "random_userpass" function, please see our Random Usernames and Passwords wiki article.
&signup[firstname]=Mike&signup[optionid]=4&cascade=3 defines the user's first name as "Mike", sets the join option ID as "4", and the cascade ID as "3".
This function can be useful for putting join links on a Free Hosted Gallery, for example. Instead of having to go through the standard NATS pre-join form, you can automatically direct surfers straight to the biller page.
Affiliate Link Codes
You can perform the above actions for any affiliate link codes. To do so, simply append your desired parameters to the URL after:
http://<linkdomain>/track/<track code>/join
Simply replace "<linkdomain>" in the above example with your site's linkdomain, and "<track code>" with your affiliate's NATS Code. For more information on NATS Codes, please see our Getting The NATSCode wiki article.
One Step Joins
NATS4 also supports one page joins for gateway forms, which combine required information for both NATS and the chosen biller. This allows members to only have to go through one step in order to join.
For more information on this feature, please see our Gateway One Step Join wiki article.