RealCart UNIVERSITY
Courses [Home]  [Search]  [Index]  [Help]  [Help]

Higher Learning for the Internet’s most effective shopping cart - Attend On-line.

<<prev | 1 | 2 | 3 | 4 | 5 | 6 | next>>

RealCart Tag Syntax - Character replacement

Swapping Characters with Tag Syntax

RealCart stores your product pages in files consisting of the stock number for the filename. The same is true of department names. Since UNIX web servers are CaSe SeNsItIvE it is important to be able to convert department names, stock numbers and other user entered values into legal filename characters for and other uses. For example, if you entered your stock numbers in RealCart’s Product Wizard with uppercase alpha characters it could pose a problem with filename case. Here is an example of what we mean. Let’s say that you have entered the following stock numbers:
  • SP1000 A
  • SP1000 B
  • SP1000 C

When RealCart creates your product pages it needs to switch the UPPER CASE letters to lower case. Normally the square tag for stock number is [Products_ItemStockNumber], however, this tag if used as a hyperlink:

<a href="[Products_ItemStockNumber].html">
[Products_ItemStockNumber]
</a>
This will product the following href once it has been parsed:
<a href="SP1000 A.html">
SP1000 A
</a>
This could cause problems with UNIX (or Linux) servers because RealCart forces all characters to lowercase when it encounters (or creates) any filename. This is true whether RealCart is adding an image to the database or publishing your store pages to your web server.

Another potential problem is with spaces in department names and stock numbers. Older Netscape browsers have difficulty with spaces. For this reason we must convert all spaces to some other legal filename character like the underscore (_).

To get RealCart to switch spaces to underscores we add a little something to the end of the tag:

<a href="[Products_ItemStockNumber|^:_].html">
[Products_ItemStockNumber]
</a>
The “pipe” character (|) tells RealCart’s parser to convert any special characters that it finds to a different character. In the case of converting spaces to underscores we tell RealCart to look for spaces (represented by the carat (^) and to replace it (:) with an underscore (_). The tag receives these additional characters at the end (|^:_) and now looks like this:
[Products_ItemStockNumber|^:_]
Now when the stock number “SP1000 A” is encountered it will be formatted like this:
SP1000_A
Finally we add one more character to the tag to change all characters to lower case. The tilde (~) character accomplishes this for us by adding it after the character swapping sequence like this: (|^:_~.) The complete filename compatible tag now looks like this:
[Products_ItemStockNumber|^:_~].html
This code produces the following output:
sp1000_a.html
Similarly a department called “Factory Fresh Widgets” will be converted properly to a filename using the following code.
[DepartmentDesc_DepartmentDesc|^:_~].html
This code produces the following output:
factory_fresh_widgets.html
Remember: All filenames are converted to lower case and spaces are converted to underscores when parsed by RealCart.

<<prev | 1 | 2 | 3 | 4 | 5 | 6 | next>>


About RealCart U | Courses | Admissions | Administration | Alumni | Directories | Case Studies | Help

Contact the Webmaster staff
Copyright information
Privacy statement

Copyright © 1995-2002, RealCartUniversity.com