• Skip to header bar
  • Skip to main navigation
  • Skip to page tools
  • Skip to work area
  • New process
  • Overview
    • Files
    • Processes
    • Ratings
    • Recommendations
    • WikiExplorer
    • Workflows
  • Login
Book navigation as tree structure
Main navigation
User manual
PreviousNext
Edit book
Main navigation contains tabs, main links and MediaWiki sidebar
To book navigation
Entrypoints
  • Main Page
  • Pages
  • Books
  • Blogs
  • Recent changes
Quick Links
  • All topics
  • Video-Tutorials
  • Templates download
Documentation
  • Security Advisories
  • Installation
  • Releases
  • Software catalog
  • Trust & Safety
Books
  • User manual
  • Admin manual
  • Semantic MediaWiki basics
Participate
  • BlueSpice community
You are viewing an old version of this page. Return to the latest version.
This is the version of 16 June 2025, 11:48 by Laetitia Huyghe
PreviousNext
  • Pages
  • SMW queries
  • Differences
Last edited 3 weeks ago
by Laetitia Huyghe

3.4 Page lists

  • Deutsch
  • English
Back to version history
Browse history interactively
← Older editNewer edit →
VisualWikitext
Revision as of 14:49, 27 July 2023 view source
Redaktion (talk | contribs)
ES_editors, Administrators
7,889 edits
No edit summary
Tag: Visual edit
← Older edit
Revision as of 11:48, 16 June 2025 view source
Laetitia Huyghe (talk | contribs)
Administrators
544 edits
No edit summary
Tag: Visual edit
Newer edit →
Line 18: Line 18:
}}
}}


<span><br /></span>
<span><br /></span>'''Notes:'''
'''Notes:'''


<span><br /></span>
* <code><nowiki>[[:+]]</nowiki></code>                      shows pages from the ''Main'' namespace.
<code><nowiki>[[:+]]</nowiki></code>                      shows pages from the ''Main'' namespace.  
* <code><nowiki>[[Myspace:+]]</nowiki></code>      shows pages from the namespace ''Myspace''.
 
* <code><nowiki>[[:+||Help:+]]</nowiki></code>  shows pages from both the ''Main'' namespace and the namespace ''Help''  (=OR argument)
<code><nowiki>[[Myspace:+]]</nowiki></code>      shows pages from the namespace ''Myspace''.
 
<code><nowiki>[[:+||Help:+]]</nowiki></code>  shows pages from both the ''Main'' namespace and the namespace ''Help''  (=OR argument)


===Output in category style===
===Output in category style===
Line 49: Line 45:
| format=ol  
| format=ol  
}}  
}}  
</syntaxhighlight>
</syntaxhighlight>Showing 4 results for pages in category Administration including pages from subcategories:{{#ask:  
{{#ask:  
[[Category:Administration]]  
[[Category:Administration]]  
| limit=4  
| limit=4  
Line 56: Line 51:
| format=ol
| format=ol
}}
}}


===Pages that start with the same page name string===
===Pages that start with the same page name string===

Revision as of 11:48, 16 June 2025

Here you can see some examples for simple queries using the properties of a wiki page. This functionality is provided by the bundled extension Semantic MediaWiki. You can add these queries to any wiki page.

Contents

  • 1 Creating page lists
    • 1.1 Show pages in a particular namespace
    • 1.2 Output in category style
    • 1.3 Show pages from a category
    • 1.4 Pages that start with the same page name string
  • 2 Results format: Table
    • 2.1 Format "broadtable"
    • 2.2 Format "table" with filter (datatable)
  • 3 Date queries
    • 3.1 Today
  • 4 Search operators
  • 5 Templates
    • 5.1 Suppressing the namespace prefix
  • 6 Related info
  • 7 Content droplet "Data query"  v4.3+

Creating page lists

If you need more flexible, customizable queries, you can add the queries directly in source edit mode. Below are a few examples to get you started.

Show pages in a particular namespace

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

Output example in list style format:


  • Accessibility
  • Accessibility/Extensions
  • Accessibility/Extensions/legacy list
  • Accessibility/Extensions/notchecked
... further results


Notes:

  • [[:+]] shows pages from the Main namespace.
  • [[Myspace:+]] shows pages from the namespace Myspace.
  • [[:+||Help:+]] shows pages from both the Main namespace and the namespace Help (=OR argument)

Output in category style

{{#ask:
[[:+]][[Modification date::+]]
|format=category
|limit=12
}}
Output example:
A
  • Accessibility
  • Accessibility/Extensions
  • Accessibility/Extensions/legacy list
  • Accessibility/Extensions/notchecked
  • Accessibility/VPAT BS4
A cont.
  • AccessibilityReport.form
  • Announcement/Log4Shell
  • Announcement/XSS attack
  • Apache license 2.0
  • Archiv:Reference:BlueSpiceSocialTags
A cont.
  • Attachments
B
  • BSD 3-Clause
  • ... further results

Show pages from a category

{{#ask: 
[[Category:Administration]] 
| limit=4 
| searchlabel=
| format=ol 
}}
Showing 4 results for pages in category Administration including pages from subcategories:
  1. Config manager
  2. Extended statistics
  3. Extension/AdhocTranslation
  4. Footer




Pages that start with the same page name string

{{#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 "table" with filter (datatable)

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



Date queries

Today

To ask for all pages that have been approved today:
{{#ask:
[[QM/Approval date::>>{{#time:Y-m-d|now -1day}}]]
}}

Search operators

If you want to look for results in a particular range, you can use search operators. See: https://semantic-mediawiki.org/wiki/Help:Search_operators#comparators

Templates

Customized output formats can be created using templates. The documentation for this can be found at semantic-mediawiki.org.

Here we show you some useful tips when working with templates.

Suppressing the namespace prefix

By default, the namespace prefix of a page is suppressed in the output formats "ul", "ol" (and other formats). However, if you are working with a template and therefore use the link=none parameter in the ask query, because you generate the link in the template yourself, then the page name is displayed with the namespace prefix. Sample query of all pages in the QM namespace:
{{#ask: QM:++Property "Modification date" has a restricted application area and cannot be used as annotation property by a user.
|format=plaintext
|template=mytemplate
|link=none
 }}
The output here is in the format QM:My Page. To remove the namespace prefix, use the following syntax in the template, e.g. to generate an unordered list:
*[[{{FULLPAGENAME:{{{1}}}}}|{{PAGENAME:{{{1}}}}}]]
In this example, the full page name is linked via the "magic word" {{FULLPAGENAME}} and the page name without namespace prefix {{PAGENAME}} is used as the link label. The resulting output is My Page.

Related info

  • SMW "ask" queries
  • SMW result formats
  • Using templates to create output formats




Content droplet "Data query"  v4.3+

Starting with BlueSpice 4.3, basic SMW data queries can be added directly with the Content droplet "Data query":

  1. Click on the Content droplets menu item in the visual editor.
  2. Select Data query under Lists.
    Screenshot of the Content droplet selection for "Lists"
    Content droplet "Data query"
  3. Click Insert. This opens the droplet inspector.
  4. Fill in the query options (parameter). Each setting has a tooltip that explains exactly what values you can enter.
    Data query parameters
    Data query parameters
  5. Click Save.


PDF exclude - start

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

PDF exclude - end


Retrieved from "https://en.wiki.bluespice.com/w/index.php?title=SMW_queries&oldid=12213"
  • Organization
Edit
Page actions and tools navigaiton contains tabs, toolbox and actions
Actions
  • Refresh
  • Copy URL
  • E-Mail
  • QR code
Details
  • View history
  • Page information
  • Browse properties
  • ... all actions
  • Privacy policy
  • Terms of service
  • Disclaimer
  • Imprint
  • Accessibility
  • About
  • Analysis service
  • Powered by MediaWiki
  • Powered by BlueSpice
  • Powered by Semantic MediaWiki
  • Creative Commons License