SMW queries: Difference between revisions

No edit summary
No edit summary
Tag: 2017 source edit
Line 103: Line 103:
</syntaxhighlight>
</syntaxhighlight>


{{Box Note|boxtype=important|Note text=The format declaration  <pre>|format=datatable </pre> currently does not work with the BlueSpice skin. Instead, use the following syntax:  
{{Messagebox|boxtype=important|Note text=The format declaration  <pre>|format=datatable </pre> currently does not work with the BlueSpice skin. Instead, use the following syntax:  
<pre>
<pre>
|format=table
|format=table

Revision as of 10:06, 21 December 2021

Here you can see some examples for simple queries using the metadata of a wiki page. You can add these queries to any wiki page.

Creating page lists

{{#ask:
[[:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
|format=ul
|limit=4
}}


... further results

Notes:

[[:+]] show Pages in the Main namespace. [[Myspace:+]] shows pages in the namespace Myspace.

[[:+||Help:+]]shows pages in the Main namespace and in the namespace Help.

Output in category style

{{#ask:
[[:+]][[Modification date::+]]
|format=category
|limit=12
}}

Show pages from a category

{{#ask: 
[[Category:Administration]] 
| limit=4 
| searchlabel=
| format=ol 
}}
  1. Config manager
  2. Footer
  3. Main navigation
  4. Extended statistics

Seiten mit gleichem Namensanfang

{{#ask: 
[[~Visu*]][[:+||Manual:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5 
| searchlabel=
| format=ol 
}}

List of pages in the Main namespace and in the namespace Manual that begin with "Visu".


Results format: Table

Format "broadtable"

{{#ask: 
[[~Visu*]][[:+||Manual:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5 
| searchlabel=
| format=broadtable
}}



Format "datatable"

{{#ask: 
[[~Visu*]][[:+||Handbuch:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5 
| searchlabel=
| format=table
| class=datatable
}}
Important!The format declaration
|format=datatable 
currently does not work with the BlueSpice skin. Instead, use the following syntax:
|format=table
|class=datatable



Related info




To submit feedback about this documentation, visit our community forum.

Discussions