When planning your FirstClass system, you should be aware of how your users log in and where you want them go once they arrive on your site. On a standard web site, you will have Mac OS X users, Windows users, Linux users and those using different versions of both Netscape® and Microsoft® Internet Explorer (and perhaps other browsers, such as Opera or Safari). If you are running the default template set (.templates) in standard mode that is shipped with FirstClass, your users will get the same web view of their Desktops using any browser.
Note
You can also run the default template set in an enhanced mode, see Displaying different web site interfaces.
Browser steering for different template sets
Say you want to point all Microsoft Explorer versions 5-9 users to a set of custom templates because your custom template set contains that can only be seen using higher version browsers. Using the HeaderMatch syntax, you could add this line into your HeaderMatch document:
*: IF User-Agent == "MSIE [5-9]\..+Win" SET .templates = .customtemplates
where
• * is universal for all web sites on your web server
• User-Agent sets the specific browser (in this case Microsoft Internet Explorer versions 5 to 9)
• \..+Win backslash is an escape character that removes the special meaning for + and turns [] and 0 - 9 into special characters
• .templates = points users to the default template set on your system (in this case .customtemplates).
To create customized templates, see Customizing templates.
Setting Internet Services script variables
If you want to set a particular interface format for users on more space-limited platforms, such as handheld devices, you can use Internet Services script variables to accomplish this task. Here is an example of adding script variables to your HeaderMatch document:
*: IF User-Agent == "Windows CE" VAR ROWS = 10
where
• * applies to all sites
• IF is the keyword that initializes an action if a condition is met
• User-Agent is the HTTP header name
• == tests if a pattern is contained in the HTTP header value
• "Windows CE" is the pattern to match
• VAR ROWS = 10 sets the row number to ten
Adding HeaderMatch SET variables
When testing User-Agent strings, it is best to test for the shortest string that uniquely identifies the browser or device that you are trying to match. For example, many handheld-device browsers send their display dimensions as part of the User-Agent string. Testing the entire string prevents otherwise compatible handheld devices from matching the test. Here is an example of adding SET variables to your HeaderMatch document:
*: IF User-Agent == "AppleWebKit" SET calendarview = 158
where
• * applies to all sites
• IF is the keyword that initializes an action if a condition is met
• User-Agent is the HTTP header name
• == tests if a pattern is contained in the HTTP header value
• "AppleWebKit" is the pattern to match
• SET sets one or more internal variables if the HTTP header contains the pattern to match
• calendarview is an internal variable that tells Internet Services which form to use to display the calendar
• = is the assignment operator
• 158 is the form number to display the calendar in month view. The default view is week view, which is form number 159.
|