The login page type is fairly straightforward. It allows users of the Pixelsilk site to log in, and access Admin, protected pages, etc. It is functionally identical to the default login.aspx page, as well as adds a variety of additional features.
A standard login form may look like the following:
A login form simply takes a username and password, submits them, and the user is logged in. There are two main tokens for a login page type:
Additionally, there are four error message tokens which can appear:
To create a login page, first a page type must be created. Enter the
area of Admin and proceed to the Page Types tab. Click Add New Page Type, enter the name of the page type (such as "Login"), and select the base type as Login. Click
to create the new page type.
Next, click the pencil
of the new page type to edit it. Enter the skins tab, and enter the Content Skin. Note that although a token is present in the skin by default, a token has no behavior in an Login page type. If you would like an editable content area above or below the content skin, use an editable webbox.
In the content skin you may skin your page as desired. The above example is skinned as the following:
<div style="width: 400px; margin: 0 auto;">
<h1>Login</h1>
<p>To log in to the Pixelsilk website, please enter your login information:</p>
</div>
<div style="width: 200px; margin: 0 auto;">
<div>
<label>Username: </label>
[[Username]]
</div>
<div>
<label>Password: </label>
[[Password]]
</div>
<div>
<span style="font-size: 12px"><a href="/User/Lost-Password/">I lost my password</a></span>
</div>
<div>
<input type="submit" value="Submit" />
</div>
</div>
<p style="color: red">[[UsernameInvalidText]]</p>
<p style="color: red">[[PasswordInvalidText]]</p>
<p style="color: red">[[AuthenticationFailure]]</p>
<p style="color: red">[[UserIsLocked]]</p>
As with all pixelsilk forms, there is no <form> tag, but the is an <input type="submit"> tag present.
Finally, an actual page needs to be created with the Login page type chosen. The name of the page can be whatever you wish, and it behaves just like normal pages in Pixelsilk.
Login pages have a fixed behavior for where the user proceeds after using the login form and successfully logging in. A login page will always redirect to the path parameter in the query string which was used to access the page. That is, is you request the login page /login/?path=/logged-in/, then when you log in via the /login/ page, you will be redirected to /logged-in/.
Generally, the path parameter is populated when a user attempts to access a protected page. For example, when the user attempts to access protected page /protected-page/, they will be redirected to /your-login-page/?path=/protected-page/. Upon logging in with a valid account which can access the page, the user will be redirected to the page. If the account credentials are incorrect, or the account which the user logs in with does not have permission to view the page, then the user will remain on the login page.
Note that if a Custom Login Page has not been set (see below), all protected pages will instead redirect to the default login.aspx page, with behavior similar to the above flow.
Pixelsilk has the option for all logins on a site to be processed through a Login page type. This means that accessing admin, accessing protected pages, etc, will redirect to the custom login page, instead of the built-in Pixelsilk login.aspx page.
To enable this functionality, first make a Login page type and page described above. Next, enter the
area of Admin and proceed to the Config tab. Add a new Setting as defined below:
LoginUrlOnce this setting has been configured, it will be used as the default login page.