First, the basic URL. You may decide which separator to use for the name/value pairs. We have the default set to use a "/", meaning you cannot pass any empty values. Some people prefer to use : or - which will allow you to pass names with no values. This may be set in the file named ses_url.cfm in the ezcart folder. The variable to change is request.ses_namevalueseparator on line 1.
On line 2 you will see our little trick. It is a variable named "ses_". We figured there was little chance this variable name would be in use by anything else, but you may change it if you like. Here's how it works.
There are 6 variables we will always use to check which page we're loading and what items to show. These are also the variables we set in the search engine safe files.
Looking closely, you'll see that we did not pass "man" in the first example because we want to show all manufacturers. We can't pass a blank value for man (as in /action/list/man//cat/20/) because we're using a "/" for our name/value separator. We also didn't pass product_id just because it isn't needed here. Since ColdFusion does not recognize empty values in a list, we have to fill it in with something when passing our ses_ value. If we didn't, ColdFusion would read 20 (the value of cat) as the 3rd item in the list as set man to that value. Instead we use a x. You'll see a x in list elements 3 (man) and 6 (product_id) of our list (c,list,x,20,10,x). This tells our template to set the values of man and product_id to empty values.
So, always pass a 6 item list, using x's for empty values.
Lastly, in addition to cutting down on some of the "junk" in the URL, this "ses_" variable also tells the
template we use to parse the search engine safe name/value pairs (ses_url.cfm) to STOP parsing. This allows us
to append keyword information to the rest of the URL. We use the manufacturer names, category names, etc., for
this in our product map and any other areas where we use this copnvention. So for example, back to our example
at Avon, our search engine safe URL would look something like this, with what will appear to search engines to
be usable directory names:
http://www.yoursite.com/ses_/c,list,2,20,10,x/Avon Products/Beauty Products/Lip Makeup/
The names will be URL encoded Avon%20Products to the sight, but search engines will read them beautifully.
Remember, since we stop parsing the URL after hitting ses_, if you use this in your own URLs, be sure to add any of your own name/value pairs BEFORE the ses_ variable or they will be ignored.