How will my filter values sort on the website?
When you create an attribute as a "Filter" or "Both" (meaning both a Filter and a Spec), the values you assign to your items for that attribute will appear as a filterable list on the left side of the category page on your website. WebAlliance uses a set of rules to determine the sort order of those values in the filterable list.
Numbers appear at the top of the list, sorted numerically. Then, you'll see values that the system recognizes as non-numeric, sorted alphanumerically.
Numbers appear first
WebAlliance views "numbers" not only as values that are strictly numbers; there are exceptions that allow values that are not purely numbers to be analyzed as numerical values. Examples of numbers would be:
- 1
- 200
- 75100
- 1/4
- 1-1/4
- 2 x 4
- 1000 - 1500
- 12 degree
- 1500 RPM
- +200
Here are some rules for how the system sorts numbers:
- After they're analyzed, numbers sort low-to-high.
- Fractional numbers (1/4) and mixed numbers (1-1/4) are converted to decimal numbers for sorting purposes. They're still displayed on the site as 1/4 or 1-1/4 but the sort will be based on 0.25 and 1.25. This holds true for any number that has a / character in it.
- Numbers formatted like # - # or # x # are sorted according to the leading number. So 4 x 2 comes lower than 2 x 4.
- Values of different formats will not be mixed together in the final sort results. Meaning 2, 4, 2 x 4, and 4 x 4 would sort as:
2
4
2 x 4
4 x 4
- Numbers that are trailed by any of the following labels are sorted numerically. The label displays on the page, but it's ignored for sorting purposes:
kelvin
degree
meter
lb-ft
lb-in
foot
inch
psi
rpm
hp
ft
nm
ma
yd
yard
kilo
kilogram
kg
cm
mm
in
m
"
#
'
TIP: If you have a filter with values of similar data and different formats, it displays best when you split that into multiple filters - one filter for each format. For example, if you have a "Size" filter with some values in inches, and some values in centimeters, create 2 filters instead of just one - "Size in Inches" and "Size in Millimeters". If you combine both into one filter, the values displayed online will look mixed and almost random.
Non-numbers are sorted alpha-numerically
Non-numbers include anything that is not strictly a number and doesn't meet one of the exceptions above. Examples of non-numbers would be:
- Blue
- Large
- 1000, 1200
- 900/1200-1500
- 100 / 120
Values considered non-numbers are sorted alpha-numerically. A list of values like:
- 900-750
- 900-1200/1500
- 1000/1200-200
would sort this way:
- 1000/1200-200
- 900/1200-1500
- 900-750
because the system doesn't recognize those values as numbers, it sorts starting with the first character (1 is before 9), then moves left to right in order to put the values in order.
Can I check the sorting of my values on my website?
Yes, you can! Logged in as a SuperAdmin or Admin with Settings authorization, go to:
www.yourDomain.com/Admin2/AdminFacetSortInfo/ShowFacetSort
There you'll find a tool to enter your desired attribute values and immediately see their sort order, rather than entering them into Attribute Manager and waiting for the site to update. It's a quick, easy way to test your data and get it in the right format before you apply it to your items via Attribute Manager.