v3.0.0+
Status: | effective |
Progress: | 100% |
Version: | 3.0.0+ |
帮助:有序列表格式
From Linux Web Expert
Template:Interlanguagelink: en
有序列表格式 | |
---|---|
以有序列表的形式输出结果,额外输出在括号内展示。 | |
更多信息 | |
提供者: | Semantic MediaWiki/zh-hans |
添加版本: | 0.7 |
移除版本: | 仍支持 |
需求: | 无 |
格式名称: | ol |
启用?表明安装相应扩展时是否默认启用该结果格式。 | 是 |
作者: | Markus Krötzsch |
分类: | 杂项 |
目录 | |
结果格式ol(有序列表)用于把查询结果以有序列表格式展示。它与结果格式“Plainlist”未提供描述。、结果格式“List”逗号分隔型列表,且带有括在英文圆括号当中的额外输出和结果格式“Ul”项目符号列表,且带有括在英文圆括号当中的额外输出非常相似。
参数
- 格式特有
⧼validator-describe-header-parameter⧽ | ⧼validator-describe-header-aliases⧽ | ⧼validator-describe-header-type⧽ | ⧼validator-describe-header-default⧽ | ⧼validator-describe-header-description⧽ |
---|---|---|---|---|
propsep | - | ⧼validator-type-string⧽ | , | 结果条目内属性之间的分隔符 |
valuesep | - | ⧼validator-type-string⧽ | , | 结果属性的值之间的分隔符 |
template | - | ⧼validator-type-string⧽ | ⧼validator-describe-empty⧽ | 用于展示打印输出的模板的名称 |
named args | namedargs | ⧼validator-type-boolean⧽ | no | 命名传递给模板的参数 |
userparam | - | ⧼validator-type-string⧽ | ⧼validator-describe-empty⧽ | 当使用模板时传递给每个模板调用的值 |
class | - | ⧼validator-type-string⧽ | ⧼validator-describe-empty⧽ | 给列表设置的额外CSS类 |
introtemplate | - | ⧼validator-type-string⧽ | ⧼validator-describe-empty⧽ | 当有查询结果时显示在结果前的模板的名称 |
outrotemplate | - | ⧼validator-type-string⧽ | ⧼validator-describe-empty⧽ | 当有查询结果时显示在结果后的模板的名称 |
prefix | - | ⧼validator-type-string⧽ | none | 控制打印输出内命名空间的显示 |
Starting with Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki this result format was overhauled and the following changes were made to the parameters provided:1
- The "
columns
" parameter was removed. Use the "class
" parameter and CSS instead. - The "
class
" parameter was introduced to allow setting an additional CSS class for the output. - The "
template arguments
" parameter was removed. It served no longer any purpose since the "?
" prefix for arguments was removed, too. - The "
propsep
" and the "valuesep
" parameter were introduced to supplement the "sep
" parameter.
See the help page on result format "Plainlist"Outputs results in a comma separated list, with additional outputs shown in parentheses. The output does not provide class attributes to HTML elements (default for queries without printout statements). (formerly result format "Template"No description was provided.) in case a template is used for formatting the query output.
示例
标准输出
- 查询
{{#ask: [[Category:City]] [[Located in::Germany]] |?Population=人口 |?Area#km²=面积(km²) |format=ol }}
- 结果
多栏输出
Starting with Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki the "
columns
" parameter is no longer available.1 Instead the "class
" parameter and CSS have to be used to generate two or more columns. CSS in turn allows for even more formatting options.2 The examples shown below provide examples for a two column layout.
语义MediaWiki版本 ≥ 3.0.0
- 独立查询(推荐)
{{#ask: [[Category:City]] [[Located in::Germany]] |format=ol |class=exampleclass }}
- 独立CSS(推荐)
ol.smw-format.ol-format.exampleclass {
column-count: 2;
}
- 结果
It is preferred to use the "
class
" parameter to allow for a fine-grained control of the columns appearance for individual queries.
- 全局查询
{{#ask: [[Category:City]] [[Located in::Germany]] |format=ol }}
- 全局CSS
ol.smw-format.ol-format {
column-count: 2;
}
- 结果
This is discouraged since it does not allow for fine-grained control of the appearance of individual queries using this result format. All queries would be affected by the CSS.
语义MediaWiki版本 < 3.0.0
- 查询
{{#ask: [[Category:City]] [[Located in::Germany]] |format=ol |columns=2 }}
- 结果
References
- a b gh:smw:3130
- ^ | CSS Multiple Columns