Help:内嵌格式

From semantic-mediawiki.org
内嵌格式
嵌入所选定的文章
进一步的信息
提供方: Semantic MediaWiki
最低版本: 0.7
最高版本: 依然支持
要求:
格式名称: embedded
作者: Markus Krötzsch
类别: misc
目录

内嵌格式embedded用于将查询结果之中的那些页面的内容嵌入到某个页面当中。 这种嵌入采用的是MediaWiki嵌入包含(transclusion)机制(就像插入模板时那样), 从而可以利用标签<includeonly>和<noinclude>来控制所要显示的内容。

参数[edit]

参数 类型 默认 说明
embedformat 文本 h1 用于定义标题的HTML标签
embedonly 布尔值 no 不显示标题

内嵌格式额外引入了下列参数:

  • embedformat(内嵌格式):用于指定当嵌入页面时所要使用的是哪些种类的标题,可以是标题级别,即h1h2h3h3h4h5h6当中之一,或者是列表格式的描述,即ulol当中的一个。
  • embedonly(无标题式嵌入):如果该参数具有任何取值的话(如«true»),对于所嵌入的那些页面将完全不使用标题。

示例[edit]

下列查询可创建一张发表在本网站之上的最新新闻的列表(就像在博客当中那样):

{{#ask: [[News date::+]] [[language code::zh-hans]]
| sort=news date
| order=descending
| format=embedded
| embedformat=h3
| searchlabel= 查看既往新闻
| limit=3
}}

该查询将产生下列输出:

Semantic MediaWiki 3.0.0 发行版本现已提供

Semantic MediaWiki 3.0 (SMW 3.0.0), the next feature version after 2.5 has now been released.

This new version brings many enhancements and new features such as most notably the reworked "list" and "template" formats, many user interface changes mostly for special pages, extended query syntax (conditions, markers, printouts), grouping of properties, the property create protection feature and new API modules ("smwbrowse" and "smwtask"). ElasticStore was added as a new query backend and not to forget special page "SemanticMediaWiki" was further extended and improved.

See also the version release page for information on further improvements and new features. Additionally this version fixes a lot of bugs and brings stability and performance improvements. Automated software testing was again further expanded to assure software stability. Please see the page Installation for details on how to install and upgrade.

Semantic MediaWiki 2.5.8 发行版本现已提供

Semantic MediaWiki 2.5.8 (SMW 2.5.8) has been released today as a new version of Semantic MediaWiki.

This maintenance release provides enhancements as well as bugfixes. Please refer to the help page on installing Semantic MediaWiki to get detailed instructions on how to install or upgrade.

Semantic MediaWiki 2.5.7 发行版本现已提供

Semantic MediaWiki 2.5.7 (SMW 2.5.7) has been released today as a new version of Semantic MediaWiki.

This maintenance release provides bugfixes and improves compatibility with MediaWiki 1.30.x and later. Please refer to the help page on installing Semantic MediaWiki to get detailed instructions on how to install or upgrade.
[查看既往新闻]

请注意:换行符(<br>)用来让指向进一步的结果链接单独占据一行。

评注[edit]

注意:如果所嵌入的页面具有任何类别的话,则页面的嵌入可能偶然会包含类别声明。要避免这种情况,请采用标签<noinclude>。比如,这样写:

<noinclude>[[Category:News feed]]</noinclude>

SMW将会负责保证所嵌入的文章不会导入其语义标注,因此对此无需进行特别处理。

另请注意:对于查询的嵌入,打印输出语句不起作用



本文档页面适用于SMW从0.7版到最新版本的所有版本。
      其他语言: defr

Help:Embedded format zh-hans 0.7