DotAdmin User Guide
The Sign-Up / Edit User Template
Note: This page is long because the template itself is quite complicated. The default template should be suitable for most applications, however, so developers should expect to only have to make minor alterations to it
This template has an ID of “signup” in the process templates folder, but performs double-duty for both the sign-up and edit user processes. Like the login template, this template uses lots of conditional instructions to output appropriate messages to the user depending on what action is being performed.

The Sign-Up / Edit User Template
BLOCK {header}
At the top of the template is BLOCK {header}, which is used to return an appropriate title for the page.
<!-- BLOCK {header} -->
<h1>
<!-- IF {newuser} -->
Create A New User
<!-- /IF {newuser} -->
<!-- IF {edituser} -->
Edit User: {input_username}
<!-- /IF {edituser} -->
<!-- IF {new_success} -->
Created New User: {input_username}
<!-- /IF {new_success} -->
<!-- IF {edit_success} -->
Edited User: {input_username}
<!-- /IF {edit_success} -->
</h1>
<!-- /BLOCK {header} -->
BLOCK {header} offers four alternative page titles.
The only placeholder available to this block is {input_username}, to make the title relevant to the user account we're editing.
After the header block, we have two conditions: IF {logged_in} and IF {not_logged_in}. These tell the user (where appropriate) that he cannot create a user account when he is logged in already, and that he cannot edit his user account if he isn't logged in.
BLOCK {report}
This block reports back the results of successful user registration and editing (error reporting is done in a later block - see below).
<!-- BLOCK {report} -->
<!-- IF {new_success} -->
<p>A new user has been created with the following details:</p>
<!-- /IF {new_success} -->
<!-- IF {edit_success} -->
<p><b>{input_username}</b> has been edited, here is a summary:</p>
<!-- /IF {edit_success} -->
<!-- BLOCK {reportlines} -->
(Any data which have changed are reported here.)
<!-- /BLOCK {reportlines} -->
<!-- /BLOCK {report} -->
Reporting success to the user.
BLOCK {reportlines} outputs a line for each record that the user has input or edited. You may wish to include each line within its own conditional instruction to avoid outputting lines with no value, as shown in the example below:
<p>
<!-- BLOCK {reportlines} -->
<!-- IF {input_name} -->
<b>Full Name: </b>
{input_salutation} {input_f_name} {input_l_name}<br>
<!-- /IF {input_name} -->
<!-- IF {input_screen_name} -->
<b>Screen Name: </b>{input_screen_name}<br>
<!-- /IF {input_screen_name} -->
<!-- IF {input_username} -->
<b>Username: </b>{input_username}<br>
<!-- /IF {input_username} -->
(...and so on).
<!-- /BLOCK {reportlines} -->
</p>
BLOCK {reportlines}
Note: The condition IF {input_name} checks for the existence of either the first or last name. Conditional instructions checking for the first and last name individually can be used if preferable.
There are three other specialist conditional instructions in the reportlines block. The first is IF {priv_requested}, which reports if the user has requested access to a privileged zone (The {priv_requested} placeholder will output the zone's title). IF {password_mailed} informs the user that a temporary password has been emailed following a successful user registration, and IF {password_changed} tells the user if he has successfully changed his password without outputting the new password to the page.
BLOCK {form}
The first template element inside the form block is BLOCK {errors}. This block informs the user if the form submission contains data that cannot be accepted. Six conditional instructions are used to cover each possible reason for rejection:
<!-- BLOCK {errors} -->
<!-- IF {missing_fields} -->
<p><b>Error: </b>One or more required fields were not
completed.</p>
<!-- /IF {missing_fields} -->
<!-- IF {pwd_mismatch} -->
<p><b>Error: </b>The two passwords you entered did not
match.</p>
<!-- /IF {pwd_mismatch} -->
<!-- IF {bad_username} -->
<p><b>Error: </b>The username you supplied ({bad_username})
is already in use.</p>
<!-- /IF {bad_username} -->
<!-- IF {illegal_username} -->
<p><b>Error: </b>The username you supplied ({illegal_username})
contains illegal characters. Please use only alphanumeric
characters (upper- and lowercase letters, digits, and the
underscore "_" character are all valid).</p>
<!-- /IF {illegal_username} -->
<!-- IF {bad_email} -->
<p><b>Error: </b>The email address you supplied ({bad_email})
belongs to an existing user.</p>
<!-- /IF {bad_email} -->
<!-- IF {malformed_email} -->
<p><b>Error: </b>Your email address: ({malformed_email}),
is not of the correct format. Please re-type it.</p>
<!-- /IF {malformed_email} -->
<!-- /BLOCK {errors} -->
Reporting errors to the user.
The registration/edit form itself has an action attribute of “/content/{process}”. This is because this template is used by both the sign-up and edit user processes, so the action URL must be added by the system.
The form also has two hidden fields.
<input type="hidden" name="ref" value="{ref}">
<input type="hidden" name="required"
value="input_f_name,input_l_name,input_username,input_email">
Hidden fields in the Sign-Up / Edit User Template.
The first hidden field shown above (“ref”) carries a referring ID (url) if the user arrived to register an account in order to access a protected zone. The second hidden field ({required}) is a comma-separated list of required fields. The form will not accept a submission unless all the fields specified in this list are completed.
BLOCK {editpwd}
Contained within BLOCK {form}, this block ensures that the password entry fields are not shown during user registration. Following a successful registration, a password is generated and emailed to the user, so during registration the password fields do not need to be displayed.
BLOCK {destinations}
Contained within BLOCK {form}, this block repeats to show a drop-down list of countries for the user to choose from. Its only feature is the IF {selected} condition, which pre-selects the user's country if it is already known (For example: during the Edit User process, or if the form is returned because the submission contained errors).
BLOCK {referer}
Contained within BLOCK {form}, this block is shown if the user arrives to register from a protected zone. This block offers a checkbox for the user to apply for permission to view the contents of that zone.
At the end of the form block, we have two simple conditional instructions. IF {newsubmit} and IF {editsubmit} allow you to change the appearance of the submit button, depending on which process is being used.
Below is a summary of all template instructions used in the Sign-Up / Edit User template:
|
Placeholder
|
Output
|
|
BLOCK {header}
|
Shows context-sensitive page headings.
|
|
IF {newuser}
|
BLOCK {header}: Displays a New User header.
|
|
IF {edituser}
|
BLOCK {header}: Displays an Edit User {input_username} header.
|
|
IF {new_success}
|
BLOCK {header}: Displays a Created User {input_username} header.
BLOCK {report}: Displays a Created User {input_username} message.
|
|
IF {edit_success}
|
BLOCK {header}: Displays an Edited User {input_username} header.
BLOCK {report}: Displays an Edited User {input_username} message.
|
|
IF {logged_in}
|
Informs the user that he cannot register a username because he is already logged in.
|
|
IF {not_logged_in}
|
Informs the user that he cannot edit his user details because he is not logged in.
|
|
BLOCK {report}
|
Contains all template elements used to report the successful completion of the Sign-Up and Edit User procedures.
|
|
IF {not_logged_in}
|
Informs the user that he cannot edit his user details because he is not logged in.
|
|
BLOCK {report}
|
Contains all template elements used to report the successful completion of the Sign-Up and Edit User procedures.
|
|
IF {priv_requested}
|
BLOCK {report}: Informs the user that his request for privileged access has been recorded.
|
|
IF {password_mailed}
|
BLOCK {report}: Informs the user that a password has been emailed following a successful account creation.
|
|
IF {password_changed}
|
BLOCK {report}: Informs the user that his password has been successfully edited.
|
|
{input_salutation}
|
BLOCK {reportlines} and BLOCK {form}: The user's title/salutation.
|
|
{input_f_name}
|
BLOCK {reportlines} and BLOCK {form}: The user's first name.
|
|
{input_l_name}
|
BLOCK {reportlines} and BLOCK {form}: The user's last name.
|
|
{input_screen_name}
|
BLOCK {reportlines} and BLOCK {form}: The user's chosen screen name.
|
|
{input_username}
|
BLOCK {reportlines} and BLOCK {form}: The user's username.
|
|
{input_email}
|
BLOCK {reportlines} and BLOCK {form}: The user's email address.
|
|
{input_comp_name}
|
BLOCK {reportlines} and BLOCK {form}: Name of the user's company/organisation.
|
|
{input_street}
|
BLOCK {reportlines} and BLOCK {form}: The user's street address.
|
|
{input_town}
|
BLOCK {reportlines} and BLOCK {form}: The user's town/city.
|
|
{input_state}
|
BLOCK {reportlines} and BLOCK {form}: The user's state/county.
|
|
{input_postcode}
|
BLOCK {reportlines} and BLOCK {form}: The user's postal code/zip code.
|
|
{input_destination}
|
BLOCK {reportlines} and BLOCK {form}: The user's country or area.
|
|
{input_tel}
|
BLOCK {reportlines} and BLOCK {form}: The user's telephone number.
|
|
{input_fax}
|
BLOCK {reportlines} and BLOCK {form}: The user's fax number.
|
|
BLOCK {form}
|
Contains the HTML form for user applictions / user editing.
|
|
BLOCK {errors}
|
BLOCK {form}: Contains conditional instructions to report errors in a form submission.
|
|
IF {missing_fields}
|
BLOCK {errors}: Reports that all required fields were not completed.
|
|
IF {pwd_mismatch}
|
BLOCK {errors}: Reports that the user entered two passwords which were not identical.
|
|
IF {bad_username}
|
BLOCK {errors}: Reports that the username entered is already in use by another user.
|
|
IF {illegal_username}
|
BLOCK {errors}: Reports that the username entered contains illegal characters.
|
|
IF {bad_email}
|
BLOCK {errors}: Reports that the email address entered is already in use by another user.
|
|
IF {malformed_email}
|
BLOCK {errors}: Reports that the email address supplied is not a valid email address.
|
|
{process}
|
BLOCK {form}: Contains either “signup” or “edituser”, denotes the process the form should be submitted to.
|
|
{ref}
|
BLOCK {form}: The referring document, in the case of a user who arrived to register for access to a protected area.
|
|
BLOCK {editpwd}
|
BLOCK {form}: Contains a pair of password-entry fields. This block ensures that these fields are only shown during the Edit User process.
|
|
BLOCK {destinations}
|
BLOCK {form}: Repeats to display a list of destinations (countries) for the user to choose from.
|
|
IF {selected}
|
BLOCK {destinations}: Pre-selects a destination option on future page loads if the user has already made a selection.
|
|
{destination}
|
BLOCK {destinations}: The ID of each individual destination. Used as both the value and name of each option in the list.
|
|
IF {newsubmit}
|
BLOCK {form}: Shows a submit button styled for the User Sign-Up process.
|
|
IF {editsubmit}
|
BLOCK {form}: Shows a submit button styled for the Edit User process.
|
|
BLOCK {returning}
|
Shows a link back to the last page the user was viewing.
|
|
{ref}
|
BLOCK {returning}: The ID (url) of the page the user arrived from.
|
|