Introducing Search Ordering
Search results ordering can either be defined statically, by pre-setting the way that the search results are ordered, or dynamically, by allowing the end user to define how they want the search results listed. This manual shows you how to set up these two options.
Statically Defining Search Results Ordering
Search results ordering can be set in the "Configuration" options of your List and Search type, in the Global box. You can set the Default Order to "Alphabetical (based on Title)", "Most Recent First", "Most Popular", "Oldest First", or "Ordering" - which uses the ordering of the articles in the Joomla Article Manager. These configuration options can be overriden in your Menu Item options, or in the Module Options if your list is displayed using a Module.
Search results can also be ordered statically but in a customised way by using the Ordering view in your List & Search Type. Simply add your fields to this view, in order that you want them to be ordered, and then define the direction (Ascending or Descending) that you want the results to be ordered.
Dynamically Defining Search Results Ordering
Search ordering can be dynamically defined by including the Search Ordering field within your Search Form. This will add a field to your search form that users will be able to change in order to alter the way search results are ordered. Simply add each field that you wish to use as an ordering option to the list of fields. Then check the "Direction: asc or desc" box and enter the direction next to each field. The same field can be added twice in order to define ordering options in both directions.
Dynamic Table Header Ordering
Column headers in the seb_table template can be converted into clickable links that alter the ordering of a table by that column also by using the Search Ordering Field.
First, add the fields that will be used in the clickable columns as ordering options in your Search Ordering field. Remember to add each field twice and define the ordering in both the "asc" and "desc" directions.
Second, add your Search Ordering field to your Search Form and set it to the "Filter" variation.
NOTE: Make sure the "Mode" in your Search Ordering Field is set to "Text"
Third, add your fields that you added to the Search Ordering field in to your List View where the seb_table template is used.
Fourth, set the variation on each column to "heading" and click the "+"
- For the "Type", select "Ordering"
- For the "Search Ordering", select the name of you Search Ordering Field
- Set the "Direction" to the default direction you want the results to be ordered in when the column header is clicked for the first time
Save your List & Search Type. Your column headers will now become clickable links that will order the contents of the table by the column that was clicked.