Reviews filter

This section describes the configurables that can be set for the reviews filter.

Tip

If you make a configuration change, Swarm will not use it until the configuration cache has been reloaded, this forces Swarm to use the new configuration. You must be an admin or super user to reload the Swarm config cache. Navigate to the User id dropdown menu, select System Information, click the Cache Info tab, and click the Reload Configuration button.

Swarm review sorting on the Reviews list page is customized by using the following configuration block in the SWARM_ROOT/data/config.php file:

<?php
// this block should be a peer of 'p4'
'reviews' => array(
'filters' => array( 'filter-max' => 15,
'result_sorting' => true,
'date_field' => 'updated', // 'created' displays and sorts by created date,'updated' displays and sorts by last updated
),
),

filter-max

When you visit the Reviews list page, reviews are displayed incrementally x reviews at a time until the white space on the page is filled with reviews or there are no more reviews to display. This process continues as you scroll down the page. The filter-max configurable sets this number.

Default value is 15.

result_sorting

Controls whether the Result order button is displayed on the Reviews list page.

  • Set result_sorting to true to display the Result order button on the Reviews list page, this is the default setting.
  • Set result_sorting to false to remove the Result order button from the Reviews list page, reviews are sorted based on the date_field setting.

date_field

If result_sorting is set to true (default), the date_field sets the initial setting for the Result order button on the Reviews list page.

If result_sorting is set to false, the date_field sets the order reviews are displayed in on the Reviews list page.

  • created: reviews are sorted by when they were created. This is the default setting.
  • updated: reviews are sorted by when they were last updated.

When a user starts a new session the Result order button is set to the initial sort order set in date_field. The review sort order can be changed by the user from the Result order button. This setting is remembered even if the user navigates away from the Review list page. When the user starts a new session, the Result order button is reset back to the setting in date_field.