Case Study - How to Customize the Text in "login.asp"

The Goal

The Case: http://library.davesabine.com/login.asp. You can refer to that page to understand "Who's Dave?" and "What are we talking about?"

Dave operates a sheet music library at his web site and wanted to implement 20/20 DataShed to manage that inventory. It'll work great! Dave also wants to invite other musicians to sign up and contribute information to the library. In this case, there are various ways that people can be involved:

In short, Dave collaborates with a variety of people who each have different interests in the content at his web site and some of the text used in the login form (in "login.asp") was a little too stiff for Dave's web site or was irrelevant, so he wanted to spice it up, change a few sentences, and give the page his own flavour.

The Process

If you visit Dave's login page, you'll notice that the text in the login form is quite different than the default text provided in 20/20 DataShed's download. So, Dave's process is finished...but how did he do it?

Dave's goal was achieved by changing portions of the text found in the languages.xml file. That file contains "strings" (like words or sentences) which 20/20 DataShed uses to write labels, instructions, prompts, and other textual information to the pages.

Dave's Process - A Step-by-Step Walkthrough

  1. Step 1: Getting Ready (Arranging the Windows)
  2. Step 2: Copy and Open the languages.xml File
  3. Step 3: Change a "<string>", then Upload the Changes and Update the Server's Cache
  1. Step 4: Repeat Step #3 Until You're Finished. Read the section below for a complete discussion about each line that Dave altered.

Dave's Customizations - A Line-by-Line Discussion

<string>[fieldUsername]:</string>
Dave chose not to change this line. 20/20 DataShed will replace this token with an appropriate value...on Dave's web site it will be "Username".
If you are altering the text for multiple languages, then you might choose to change it like this:
French example: <string>Nom d'Utilisateur:</string>
<string>[fieldPassword]:</string>
Dave chose not to change this line. 20/20 DataShed will replace this token with an appropriate value...on Dave's web site it will be "Password".
If you are altering the text for multiple languages, then you might choose to change it like this:
French example: <string>Mot de Passe:</string>
<string>Save my password on this computer.</string>
Dave changed this line to:
French example: <string>Remember me on this computer.</string>
<string>Instructions:</string>
Dave chose not to change this line.
<string>If you already signed up on our site, enter your [fieldusername] and [fieldpassword] in the form on the left.</string>
Dave changed this line to:
<string>If you are already a member of my site then enter your [fieldusername] and [fieldpassword] in the form on the left.</string>
<string>Please Note:</string>
Dave changed this line to:
<string>What's this?</string>
<string>You do not need to log in to use our site.</string>
Dave changed this line to:
<string>This is the page that members can use to login to their account. You do not need to log in to browse my site -- you only need to login to contribute new information or if you are involved as a &quot;contributor&quot; to my site.</string>
Note the use of the &quot; entity. This HTML entity will produce a quotation mark (") and helps ensure compatibility with web page document types.
<string>Not Registered?</string>
Dave changed this line to:
<string>Not Registered?<![CDATA[<br /><br />]]>Are you a composer? A publisher? Or are you a musician and would like to tell me about your favourites? Please consider signing up and contributing to the library...it's free.<![CDATA[ <a href="contribute.asp">Click here to discover all the ways you can get involved.</a>]]></string>
Dave has altered the layout of the page a little (by changing the CSS file slightly) so that this text is given sufficient horizontal space to look like a proper paragraph.
Note the use of the <![CDATA[]]> sections. HTML markup must be contained in a <![CDATA[]]> section in any XML document -- otherwise, the < and > characters will cause syntax errors in the XML parser.
<string>Please click here to sign up!</string>
Dave changed this line to:
<string></string>
A-ha! Neat trick! 20/20 DataShed will ignore empty strings. By making this change, Dave has instructed 20/20 DataShed not to write this particular string to the page.
<string>Forget Your [fieldPassword]?</string>
Dave changed this line to:
<string>Did you Forget Your [fieldPassword]?</string>
<string>Please click here for a reminder.</string>
Dave changed this line to:
<string>Click here for a reminder.</string>
<string>Use this form to login to the administration area.</string>
Dave changed this line to:
<string>Use this form to login to the administration area and access your account information and options.</string>
<string>Click here to submit your [fieldusername] and [fieldpassword].</string>
Dave did not alter this line.
<string>Enter a [fieldusername].</string>
Dave did not alter this line.
<string>Enter a [fieldpassword].</string>
Dave did not alter this line.
<string>Check this box if you would like this web page to remember your login information. Your [fieldusername] and [fieldpassword] will be remembered using a cookie that only this web site can read.</string>
Dave did not alter this line.
<string>This login form is only for administrators and users of this web site.</string>
Dave changed this line to:
<string>This login form is only for administrators and [user_plural] of this web site.</string>
Note that the [user_plural] token will produce, in Dave's case, the word "contributors" because that's the value that he's defined in the 20/20 DataShed Options » "General Options" tab. Also, by writing this token is lowercase characters, 20/20 DataShed will write the word "Contributors" in lowercase also: as in "contributors".
<string>New users should click here to set up a new account on this web site.</string>
Dave changed this line to:
<string>New [user_plural] can click here to set up a new account on this web site.</string>
Note that the [user_plural] token will produce, in Dave's case, the word "contributors" because that's the value that he's defined in the 20/20 DataShed Options » "General Options" tab. Also, by writing this token is lowercase characters, 20/20 DataShed will write the word "Contributors" in lowercase also: as in "contributors".
<string>Click here if you forgot your [fieldpassword] and need to have it emailed to you.</string>
Dave did not alter this line.
<string>You have successfully logged out.</string>
Dave changed this line to:
<string>You have successfully logged out. I'll miss you.</string>
<string>Please sign in before proceeding.</string>
Dave did not alter this line.
<string>Sorry, your account has not been authorized yet by the administration. You will receive an email message when your account is authorized.</string>
Dave changed this line to:
<string>Sorry, I haven't authorized your account yet. You will receive an email message when your account is authorized.</string>
<string>Sorry, the [fieldusername] and/or [fieldpassword] you typed was incorrect. Please try again.</string>
Dave did not alter this line.

Instructions

The discussion above demonstrates in great detail how to alter the text in the languages.xml file, but here are some brief instructions that you should be familiar with:

  1. Access your web site with an FTP application such as CuteFTP, FTP Explorer, or Windows "My Network Places".
  2. Download languages.xml from the templates folder to your local computer.
  3. Open languages.xml in a text editor such as Notepad. We recommend that you do not use a WYSIWYG editor like Frontpage or Dreamweaver for this purpose. Also note that we do not recommend that you open this file in an XML editor (like Altova XML Spy or Visual Studio).
  4. Locate the text, sentence, word, or paragraph that you would like to alter (perhaps use the "Find..." tool in Notepad.
  5. Change the text, sentence, word, or paragraph as necessary.
  6. Save the file.
  7. Upload the file to your web site using the FTP application and overwrite the existing languages.xml file.
  8. The process is now complete. The new languages.xml file will be loaded the next time the web servers cache (Application Cache) is refreshed. You can refresh the application cache manually so that your changes are implemented immediately: visit the objApplication=RemoveAll section in _globals.asp.
  9. Note: At this point, if you have created a syntax error in the XML file, you will see an error message on any/every page produced by 20/20 DataShed. Fix the error, or undo your changes, or upload the original (working) copy immediately -- then refresh the application cache again.

Notes

One Language? Or Multiple Languages?

Dave's web site is published in English only so this article demonstrates how the text is changed for one language. However, if your web site is published in more than one language, then you should customize the appropriate <string> tags in each of the <language> nodes.

What's the Worst That Can Happen?

What Should You Do If You Cause an Error?

Well, the best advice we can give you is to prevent the error in the first place:

Related topics


© 2005 - 2007 20/20 Applications. All rights reserved.