Help:筛选型格式

此结果格式用于将查询结果显示为可切换型视图（switchable views），并提供客户端筛选功能（基于JavaScript）.

此结果格式计划最终取代exhibit格式. 当前，仅提供有列表视图list. 目前，还不能在不同的视图之间切换. 另外，当前只有取值筛选器value可用.

解析器函数#ask调用的语法如下（这只是一个语法示例. 对于当前可用的功能特性，请参见各个类的文档）：

取值
Display and AND/OR switch. When OR is checked, clicking >1 filter value will show results containing value1 OR value2 etc. If AND is selected clicking >1 filter value will show results containing value1 AND value2 etc.
 * +value filter switches=and or

Allows the filter to be collapsed. You can specify whether to default to collapsed or uncollapsed
 * +value filter collapsible=collapsed,uncollapsed

Allows you to specify the height of each filter. If the number of values exceeds the specified height, you then get a scrollbar. This is especially useful for filters with large sets of values.
 * +value filter height=xxxpx

Provides a distance slider for the result set based upon a geographic coordinate type property. Additional parameters:
 * +filter=distance
 * +distance filter origin= e.g. start point or lat/long geographic coordinate
 * +distance filter unit= e.g. km
 * +distance filter initial value=x (does not need unit) e.g 100

It should be noted that if Google geocoding is used, this funtionality will result in a lot of API calls. Google has set a limit for the number of free geocodes per day of 2500. It is best to work using lat/long as this currently has no limit.

列表
Allows you to specify a template to format the results. This is the same as format=template in standard SMW queries See here for details.
 * list view template=

示例查询
This will show a result set with Job Title, City and Country properties set as filters. Job Title filter will start collapsed and will have a scrollbar. City will start uncollapsed and will have a scrollbar. Country will have the AND/OR selector switched on and no scrollbar.

示例距离查询
This will show a result set with Job Title, City and Country properties set as filters. There will be a distance slider visible that allows you to filter the results based on the distance from London, UK. This assumes each page has a geographic coordinate property set for each person.

示例CSS
可为筛选器设定皮肤. 默认CSS包含在此扩展的皮肤文件夹当中. 默认CSS将在下方带有结果集的页面之中，采取水平横跨的方式呈现筛选器.

如下CSS示例在呈现时将把筛选器堆放在左侧，而将结果集放在右侧：

如下是关于折叠控件的CSS示例：

滚动条所需的CSS示例：

启用
默认情况下，维基站点上并不启用此结果格式. 要启用此格式，必须在文件当中，在包含Semantic Result Formats（语义结果格式） 扩展的下方添加如下一行：

赞助方
此扩展由Prescient Software赞助.