Plugin: Faceted navigation categories - custom sort order

Purpose

Use this plugin if you need to define a custom sort order for the categories listed beneath a facet.

This plugin enables you to define the order of specified categories to display at the start and at the end of the category sort order, with any unspecified categories being sorted by the standard sort options.

When configuring this plugin ensure that the Parameter 1 values exactly match the Name value of the facet that you are configuring, and don’t forget that you need to edit your facet configuration to select custom sort for the plugin to take effect.

Usage

Enable the plugin

  1. Select Plugins from the side navigation pane and click on the Faceted navigation categories - custom sort order tile.

  2. From the Location section, select the results page to which you would like to enable this plugin from the Select a results page select list.

The plugin will take effect as soon as you finish running through the plugin setup steps.

Configuration settings

The configuration settings section is where you do most of the configuration for your plugin. The settings enable you to control how the plugin behaves.

The configuration key names below are only used if you are configuring this plugin manually. The configuration keys are set in the results page configuration to configure the plugin. When setting the keys manually you need to type in (or copy and paste) the key name and value.

Categories to list first

Configuration key

plugin.facets-custom-sort-position.config.*.order.first

Data type

string

Required

This setting is optional

Defines the order of a set of categories to place first when listing out the categories for the facet with a name matching the parameter 1 value (case-sensitive). The listed categories should be delimited using a vertical bar (pipe) character.

Any matching categories that are returned by faceted navigation will be listed in the configured order before all other non-matching categories. Only the categories returned will be listed. Any values that do not match will be listed below in the order speficied by other sort options.

Categories to list last

Configuration key

plugin.facets-custom-sort-position.config.*.order.last

Data type

string

Required

This setting is optional

Defines the order of a set of categories to place last when listing out the categories for the facet with a name matching the parameter 1 value (case-sensitive). The listed categories should be delimited using a vertical bar (pipe) character.

Any matching categories that are returned by faceted navigation will be listed in the configured order after all other non-matching categories. Only the categories returned will be listed. Any values that do not match will be listed above in the order speficied by other sort options.

Applying the custom sort to your facet

After you have configured this plugin you need to apply the custom sort to your facet. This is applied in the similar manner to other sort options. From your results page configuration screen:

  1. Edit the faceted navigation configuration.

  2. Select the facet to which you wish to apply this custom sorting.

    Your plugin configuration must have been configured for the matching facet.
  3. In the category sort options for the facet select 'custom' as the sort type.

  4. Publish your changes. The sorting should take effect as soon as the changes are published.

Examples

Example: Define a custom sort order

Consider the State facet, which contains categories consisting of Australian states and territories: NT NSW WA Vic ACT Tas SA Qld. You wish to order these by population.

Configure the plugin to sort the categories for the State facet:

Configuration key name Parameter 1 Value

Categories to list first

State

NSW|Vic|Qld|WA|SA|Tas|ACT|NT

After you update your State facet configuration to select custom sorting, this results in the categories being listed in the following order: NSW Vic Qld WA SA Tas ACT NT.

Example: Provide and A-Z facet with an all option

Consider you have a facet that provides and A-Z filter with an all option. You wish to present the A-Z options in alphabetical order followed by numbers, and place an All option as the first option.

Configure the plugin to sort the categories for the AZ facet:

Configuration key name Parameter 1 Value

Categories to list first

AZ

All

Categories to list last

AZ

0-9

After you update your AZ facet configuration to select custom sorting, this will result in the following order: All A B C …​ X Y Z 0-9

If you wish the All option to be presented last then you can set:

Configuration key name Parameter 1 Value

Categories to list last

AZ

0-9|All

which will result in the following order: A B C …​ X Y Z 0-9 All

Change log

[1.1.0]

Changed

  • Updated to the latest version plugin framework (Funnelback shared v16.20) to enable integration with the new plugin management dashboard.