The Filter view template adds a flexible filter to a page which contains another view displaying multiple rows from a table. For example, a list or feed - or kanban board or maps from plug-ins.
To filter is to narrow down the set of rows shown, according to some criteria chosen by the user.
For example, for a clothes shop page, there is page showing all clothes for sale in a long list. You add a filter button labelled "Hats". When selected, the list shows only the hats. The filter is not a link to a different page, but a switch that restricts the view on the current page.
In Saltcorn, you filter using the view state. This is the part of the URL after the ?
. You can set up different view templates to change the view state. For example, the visualize
plug-in can modify the view state by clicking on wedges in pie charts. Drill down dashboards are implemented like this.
The Filter view template only controls the view state. It does not show any rows from the table itself, so it is quite useless as a stand-alone view. You combine it with other views on pages, where it will control what is shown in the other views.
Choose which parts of the view state to control. Note that you can have more than one Filter on a page, as long as they are based on the same table. If you include two filters of different tables, or a filter of one table and the view of another table, you are likely to get errors.
A Filter-based view is built using the drag-and-drop builder. You can lay out the filter in a flexible manner based on columns and containers. The drag-and-drop builder has a few elements that are specific to Filter views: