Meryam Sahin (talk | contribs)
Created page with "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. == Content droplet "Data query" == Starting with BlueSpice 4.3, basic SMW data queries can be added directly with the ''Content droplet'' "Data query": # '''Click''' on the ''Content droplets'' menu item in the visual editor. # '''Select''' ''Data query'' under ''L..."
 
Meryam Sahin (talk | contribs)
No edit summary
Line 1: Line 1:
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.
{{DISPLAYTITLE:Page lists}}
 
Page lists help display related pages and page information in a structured way. BlueSpice provides three '''Content droplets''' for this purpose: '''Page list''', '''Metadata report''', and '''Subpages'''.
== Content droplet "Data query" ==
== Page list ==
Starting with BlueSpice 4.3, basic SMW data queries can be added directly with the ''Content droplet'' "Data query":
The '''Page list'''Content droplet displays pages as a hierarchical tree. The list can be limited to a namespace, a specific base page, and a defined number of subpage levels.
 
=== Insert a page list ===
# '''Click''' on the ''Content droplets'' menu item in the visual editor.
To insert a page list:
# '''Select''' ''Data query'' under ''Lists.''[[File:Droplet Data query.png|alt=Screenshot of the Content droplet selection for "Lists"|center|thumb|500x500px|Content droplet "Data query"]]
# Open a page in the [[Extension:VisualEditor|VisualEditor]].
# '''Click''' ''Insert''. This opens the droplet inspector.
# Open the '''Content droplets''' menu.
# '''Fill in''' the query options (parameter). Each setting has a tooltip that explains exactly what values you can enter.[[File:Droplet Data query parameter.png|alt=Data query parameters|center|thumb|Data query parameters]]
# Select '''Page list'''.
# '''Click''' ''Save''.
# Configure the page list.
The list of filtered pages is then displayed on the wiki page.
# Save the changes.
 
=== Page list options ===
==Creating page lists manually==
{| class="wikitable"
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.
! Option
 
! Description
=== Show pages in a particular namespace ===
|-
<syntaxhighlight lang="text">
| '''Namespace'''
{{#ask:
| Selects the namespace from which pages are displayed.
[[:+]]  <!-- find all pages in the main namespace -->
|-
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| '''Base page'''
|format=ul
| Shows subpages of the specified page. Leave the field empty to show all pages in the selected namespace.
|limit=4
|-
}}
| '''Number of shown levels'''
</syntaxhighlight>Output example in list style format:<span /><br />{{#ask:
| Specifies the number of subpage levels to display. A maximum of 6 levels can be displayed.
[[:+]][[Modification date::+]]
|-
|format=ul
| '''Show base'''
|limit=4
| Shows the base page or namespace as the top level of the tree.
}}
|}
 
== Metadata report ==
<span><br /></span>'''Notes:'''
The '''Metadata report''' Content droplet generates a report based on page metadata. The report can be configured by selecting metadata to display and defining filters and output options.
 
=== Insert a metadata report ===
* <code><nowiki>[[:+]]</nowiki></code>                      shows pages from the ''Main'' namespace.
To insert a metadata report:
* <code><nowiki>[[Myspace:+]]</nowiki></code>      shows pages from the namespace ''Myspace''.
# Open a page in the [[Extension:VisualEditor|VisualEditor]].
* <code><nowiki>[[:+||Help:+]]</nowiki></code>  shows pages from both the ''Main'' namespace and the namespace ''Help'' (=OR argument)
# Open the '''Content droplets''' menu.
 
# Select '''Metadata report'''.
===Output in category style===
# Configure the report.
<syntaxhighlight lang="text">
# Save the changes. <br>
{{#ask:
The Metadata report provides the following tabs:
[[:+]][[Modification date::+]]
* '''Data'''
|format=category
* '''Options'''
|limit=12
* '''Preview'''
}}
=== Data ===
</syntaxhighlight>Output example:{{#ask:
The '''Data''' tab defines which metadata is included in the report and which pages are considered.
[[:+]][[Modification date::+]]
{| class="wikitable"
|format=category
! Option
|limit=12
! Description
}}
|-
 
| '''Data to show'''
===Show pages from a category===
| Select the metadata properties to display. Select '''+ Add property''' to add a property.
<syntaxhighlight lang="text">
|-
{{#ask:
| '''Filters'''
[[Category:Administration]]  
| Add metadata filters to restrict the results. Select '''+ Add metadata filter''' to add a filter.
| limit=4
|-
| searchlabel=
| '''Only pages that have subjects of the following type(s)'''
| format=ol
| Restricts the report to pages whose subjects have the selected type or types.
}}
|-
</syntaxhighlight>Showing 4 results for pages in category Administration including pages from subcategories:{{#ask:
| '''Only pages in following namespace(s)'''
[[Category:Administration]]
| Restricts the report to pages in the selected namespace or namespaces.
| limit=4
|-
| searchlabel=
| '''Only pages in following category(ies)'''
| format=ol
| Restricts the report to pages in the selected category or categories.
}}
|}
 
=== Options ===
==== Combine categories ====
The '''Options''' tab controls the sorting and display of the report.
Different arguments can be linked using the <code>OR</code> operator:<syntaxhighlight lang="text">
{| class="wikitable"
{{#ask:
! Option
[[Category:Administration]] OR [[Category:Bearbeiten]]
! Description
| limit=10
|-
| searchlabel=
| '''Sort'''
| format=ol
| Defines how the report results are sorted. Select '''+ Add sort''' to add a sorting criterion.
}}
|-
</syntaxhighlight>
| '''Limit'''
 
| Limits the number of results displayed.
==== Pages from main category (without subcategories) ====
|-
<syntaxhighlight lang="text">
| '''Main label'''
{{#ask:
| Defines the main label used for the report.
[[Category:Administration|+depth=0]]
|-
| limit=10
| '''Page display format'''
| searchlabel=
| Defines how page names are displayed. Available options are '''page name''', '''page name with namespace prefix''', and '''subpage name only'''.
| format=ol
|-
}}
| '''Show page link'''
</syntaxhighlight>Here 10 pages from the category Administration are displayed exclusively pages from the subcategories:{{#ask:
| Displays links to the listed pages. This option is selected by default.
[[Category:Administration|+depth=0]]
|}
| limit=10
=== Preview ===
| searchlabel=
The '''Preview''' tab shows the information available based on the selected data, filters, and display options. Use the preview to check the report before saving the page.
| format=ol
== Subpages ==
}}
The '''Subpages''' Content droplet lists the subpages of a wiki page. The list can be limited to a specific namespace and parent page and can be displayed as a simple list or in a three-column layout.
 
=== Insert a list of subpages ===
==== Subcategories of a page ====
To insert a list of subpages:
<syntaxhighlight lang="text">
# Open a page in the [[Extension:VisualEditor|VisualEditor]].
{{#ask:
# Open the '''Content droplets''' menu.
[[Subcategory of::Administration]] [[Modification date::+]]<!-- nötig um gelöschte Seiten u. Redirects zu filtern -->
# Select '''Subpages'''.
|format=ul
# Configure the subpage list.
}}
# Save the changes.
</syntaxhighlight>
=== Subpage list options ===
Output of the subcategories of the category "Administration"
{| class="wikitable"
{{#ask: [[Subcategory of::Administration]] [[Modification date::+]]
! Option
|format=ul
! Description
}}
|-
===Pages that start with the same page name string===
| '''Namespace of page'''
<syntaxhighlight lang="text">
| Defines the namespace in which the parent page is located. Leave the field empty to use the '''Main''' namespace.
{{#ask:
|-
[[~Visu*]][[:+||Manual:+]]
| '''Parent page'''
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| Specifies the page whose subpages should be listed.
| limit=5
|-
| searchlabel=
| '''Use column layout'''
| format=ol
| Displays the subpages in three columns instead of a simple list.
}}
|-
</syntaxhighlight>List of pages in the ''Main '' namespace and in the namespace ''Manual'' that begin with "Visu".
| '''Use bullet points'''
{{#ask:
| Displays the subpages as a bulleted list.
[[~Visu*]][[:+||Manual:+]]
|}
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=ol
}}
 
==Results format: Table==
 
===Format "broadtable"===
<syntaxhighlight lang="text">
{{#ask:
[[~Visu*]][[:+||Manual:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=broadtable
}}
</syntaxhighlight>
 
{{#ask:
[[~Visu*]][[:+||Manual:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=broadtable
}}
 
<span><br /></span>
===Format "table" with filter (datatable)===
<syntaxhighlight lang="text">
{{#ask:
[[~Visu*]][[:+||Handbuch:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=table
| class=datatable
}}
</syntaxhighlight>
 
{{#ask:
[[~Visu*]][[:+||Manual:+]]
[[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:<syntaxhighlight lang="text">
{{#ask:
[[QM/Approval date::>>{{#time:Y-m-d|now -1day}}]]
}}
 
</syntaxhighlight>
 
=== Before or after ===
Shows all pages in the main namespace that were last edited before 2024 with the year of the last edit:<syntaxhighlight lang="text">
{{#ask:
[[Modification date::<{{#time:Y|2024}}]] [[:+]]
|?Modification date#-F[Y]
|format=ul
|headers=hide
}}
 
</syntaxhighlight>Date formatting: https://www.semantic-mediawiki.org/wiki/Help:Type_Date
 
== 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
 
== <span class="mw-headline">Templates</span> ==
Customized output formats can be created using templates. The documentation for this can be found at [https://www.semantic-mediawiki.org/wiki/Help:Using_templates 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: <div>
<nowiki>{{#ask: </nowiki>[[QM:+]][[Modification date::+]]
<nowiki>|</nowiki>format=plaintext
<nowiki>|</nowiki>template=mytemplate
<nowiki>|</nowiki><nowiki>link=none
}}</nowiki>
</div>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:<div>
*<nowiki>[[{{FULLPAGENAME:{{{1}}}}}|{{PAGENAME:{{{1}}}}}]]</nowiki>
</div>In this example, the full page name is linked via the "magic word" <nowiki>{{FULLPAGENAME}}</nowiki> and the page name without namespace prefix <nowiki>{{PAGENAME}}</nowiki> is used as the link label. The resulting output  is  '''''My Page'''''.{{Box Links-en|Topic1=[https://www.semantic-mediawiki.org/wiki/Help:Inline_queries SMW "ask" queries]|Topic2=[https://www.semantic-mediawiki.org/wiki/Help:Result_formats SMW result formats]|Topic3=[https://semantic-mediawiki.org/wiki/Help:Using_templates Using templates to create output formats]}}
[[Category:Organization]]
[[de:SMW-Abfragen]]
[[en:{{FULLPAGENAME}}]]

Revision as of 14:54, 26 August 2026

Page lists help display related pages and page information in a structured way. BlueSpice provides three Content droplets for this purpose: Page list, Metadata report, and Subpages.

Page list

The Page listContent droplet displays pages as a hierarchical tree. The list can be limited to a namespace, a specific base page, and a defined number of subpage levels.

Insert a page list

To insert a page list:

  1. Open a page in the VisualEditor.
  2. Open the Content droplets menu.
  3. Select Page list.
  4. Configure the page list.
  5. Save the changes.

Page list options

Option Description
Namespace Selects the namespace from which pages are displayed.
Base page Shows subpages of the specified page. Leave the field empty to show all pages in the selected namespace.
Number of shown levels Specifies the number of subpage levels to display. A maximum of 6 levels can be displayed.
Show base Shows the base page or namespace as the top level of the tree.

Metadata report

The Metadata report Content droplet generates a report based on page metadata. The report can be configured by selecting metadata to display and defining filters and output options.

Insert a metadata report

To insert a metadata report:

  1. Open a page in the VisualEditor.
  2. Open the Content droplets menu.
  3. Select Metadata report.
  4. Configure the report.
  5. Save the changes.

The Metadata report provides the following tabs:

  • Data
  • Options
  • Preview

Data

The Data tab defines which metadata is included in the report and which pages are considered.

Option Description
Data to show Select the metadata properties to display. Select + Add property to add a property.
Filters Add metadata filters to restrict the results. Select + Add metadata filter to add a filter.
Only pages that have subjects of the following type(s) Restricts the report to pages whose subjects have the selected type or types.
Only pages in following namespace(s) Restricts the report to pages in the selected namespace or namespaces.
Only pages in following category(ies) Restricts the report to pages in the selected category or categories.

Options

The Options tab controls the sorting and display of the report.

Option Description
Sort Defines how the report results are sorted. Select + Add sort to add a sorting criterion.
Limit Limits the number of results displayed.
Main label Defines the main label used for the report.
Page display format Defines how page names are displayed. Available options are page name, page name with namespace prefix, and subpage name only.
Show page link Displays links to the listed pages. This option is selected by default.

Preview

The Preview tab shows the information available based on the selected data, filters, and display options. Use the preview to check the report before saving the page.

Subpages

The Subpages Content droplet lists the subpages of a wiki page. The list can be limited to a specific namespace and parent page and can be displayed as a simple list or in a three-column layout.

Insert a list of subpages

To insert a list of subpages:

  1. Open a page in the VisualEditor.
  2. Open the Content droplets menu.
  3. Select Subpages.
  4. Configure the subpage list.
  5. Save the changes.

Subpage list options

Option Description
Namespace of page Defines the namespace in which the parent page is located. Leave the field empty to use the Main namespace.
Parent page Specifies the page whose subpages should be listed.
Use column layout Displays the subpages in three columns instead of a simple list.
Use bullet points Displays the subpages as a bulleted list.