Previous page | Site security - users and permissions | Next page |
Customising the login forms |
The default behaviour described in Managing profile forms for users, which shows all the fields from the profile tables, is often not what you need, as there are many scenarios where you need to have some profile fields visible to the user, while others are hidden for administrators to maintain. In these cases you need to define some custom surfaces for the login component, and then switch the login component to use them. The custom surfaces can also be used even when you don’t want to use extra fields, but just want finer control over the layout of the login forms. MethodOn the Login component / Behavior Editor / Settings / Options, set the “Log-in form”, “Registration form” and “Update details form” to Custom. This will switch the system to use the custom surfaces we are about to define. Note: You don’t need to switch all the forms over, but it would be unusual to only do some. Still on the login component, go to Toolbox / Configure Log-in. The Configuration tab should show the profile table specified earlier. (If it is blank, follow the Managing profile forms for users - Method section to create and link in your profile table here) Now go to the “Text surfaces” tab. This shows a tree of all the surfaces available for us to configure. At first glance this seems a complex list, but it is actually straightforward: Below the “Default Log-in” section, which we can ignore, there are three sections we need to configure:
Each of these has one or more sub-surfaces, typically to define how error messages should be displayed. The sub-surfaces can be embedded in the parent surfaces where you want them to appear. Note: when designing and testing these surfaces use two different browsers (for example Chrome and FireFox), as this enables you to be logged in as an administrator on one, whilst logging in and out to test on the other. Note: if you make a mistake, for example by not including the fundamental username and password fields on the “Custom log-in” surface, the system will protect your ability to login and recover the situation, by displaying these fields anyway (it might not look as pretty as you want, but it will allow you to login and fix the problem) On the tree of surfaces, right-click on each of the surfaces to open them in an editor. You can then insert any layout and formatting you like. Use the Embed dialog to insert the fields you need: both fields from the login system and fields from the profile table. Note: you may choose to show just a few of the profile fields on the “Custom registration” surface, and show more of them on the “Custom update” surface. That way user will benefit from a simple registration process, while having more control when they update their details. Specific information about the custom surfacesCustom log-inThis surface is shown to people when they attempt to log-in. The following special embeds are available:
Custom RegistrationThis surface is shown to people registering to become users on the site.
Custom UpdateThis surface is shown to users updating their existing details on the site. This has the exact same special embeds as the Custom Registration surface - see above. |