When FotoStation (or FotoWeb) is connected to an index, the fields that it can sort content by are limited to File name and Modification date, in ascending or descending order.
However, it is possible to enable clients to sort by the content of additional metadata fields by changing the properties of the index. This is done on the Fields tab in the propeties of each individual index. Simply tick the Sort checkbox for the fields you would like users to be able to sort by and then click on Save in the lower right corner.
The index has to be rebuilt to incorporate the changes when you add new sort fields.
Enabling sorting has performance impacts, especially on fields with large content and unique values. Consider carefully when choosing the fields and indexes where sorting is enabled.