| |||||||||||
This illustrates a simple Freeway Action that uses cookies in JavaScript. It forces anyone that uses your site to enter a login name, which you can then use in text fields for your own amusement. To use this Freeway Action you will have to download the "User Login" Action and put it in your Freeway Actions folder that is next to your copy of Freeway. Introduction The user login is written as a single Action that is inserted into a run of HTML text. If this action appears on a page and the user has logged in then the users name will be inserted in the text. If the user has not logged in then the user will be prompted to login. This means that you can use the action on any page on your site and if a user goes to that page they will be asked for a name if they have not logged in. If the user fails to log in then - i.e. provides a blank user name then they will be directed to a 'Fail' page. There is an optional 'OK' (success) page that you can set. If you do not set it the user will just remain where they are after login. If you do set it on logging in they will be sent to this page. You can use this if you want to prevent an unsuccessful login from seeing the page that they can't go to from flashing before their eyes briefly. i.e. you can put the action on it's own on a blank page. Adding the Action to your page. This Freeway Action is intended to be inserted into the text in an HTML item. To use it you should do the Following. Click in the HTML item where you want the login inserted.
Select the User Login action from the Insert > Action Item menu This will insert the item into your text.
Setting the Parameters.
OK Page - Page that the user will be sent to if they enter a user name (optional). Fail Page - Page that a user will be sent to if they fail to enter a user name. Cookie - Name of the cookie that is used to store this information - you should not have to change this. | ||
Styling the User Login text. As the User Login is inserted into the text it will assume whatever style the text surrounding it is. However for this to work there must be text either side of the item. If you have problems with this you can always put an extra space before or after the item. | ||