Description
Details
Related Objects
- Mentioned In
- T188622: Refactor Namespace handling
rEASRba5d6b3e72bd: namespace presets: make configurable
rEASR15b9ba60ef45: namespace presets: make configurable
rEASRb4aeef5d40ac: namespace presets: make configurable
rEASR5400c7e59294: [WIP] namespace presets: make configurable
rEASRa2fecd313ee0: [WIP] namespace presets: make configurable
rEASRc72ebe992c69: [WIP] namespace presets: make configurable
rEASRd0af550e56aa: [WIP] namespace presets: make configurable
rEASRf046c14d7b6d: extension.json: bump manifest version
rEASRfccc4ee47278: extension.json: bump manifest version - Mentioned Here
- T173734: Create a namespace checkbox for "Discussion"
T173736: Create a namespace checkbox for "General Help"
Event Timeline
Put the following into docs/settings.md:
Namespace presets
AdvancedSearch supports namespace presets, groups of namespaces that are offered for batch selection via dedicated checkboxes. By default three presets are offered - discussion, generalHelp, and all.
Which namespaces are contained in a preset can be configured
- statically, through the namespaces key containing an array of namespace ids,
- or programmatically through the provider key containing a reference to a JavaScript function returning the aforementioned namespace id array. The available provider functions are implemented in NamespacePresetProviders.
You can use $wgAdvancedSearchNamespacePresets to modify the default configuration or add your own presets.
Add a namespace preset
// in your LocalSettings.php wfLoadExtension( 'AdvancedSearch' ); $wgAdvancedSearchNamespacePresets = [ 'my-custom-preset' => [ 'enabled': true, // indication that this preset should be shown to the user 'namespaces' => [ '1', '11' ], // list of namespaces to include in this preset 'label' => 'my-custom-preset-label-id' // id of the translation to use to label the preset checkbox ] ];
Disable a default namespace preset
// in your LocalSettings.php wfLoadExtension( 'AdvancedSearch' ); $wgAdvancedSearchNamespacePresets = [ 'generalHelp' => [ 'enabled' => false ] ];
Change 415349 had a related patch set uploaded (by Pablo Grass (WMDE); owner: Pablo Grass (WMDE)):
[mediawiki/extensions/AdvancedSearch@master] extension.json: bump manifest version
Change 415541 had a related patch set uploaded (by Pablo Grass (WMDE); owner: Pablo Grass (WMDE)):
[mediawiki/extensions/AdvancedSearch@master] [WIP] namespace presets: make configurable
Change 415349 merged by jenkins-bot:
[mediawiki/extensions/AdvancedSearch@master] extension.json: bump manifest version
Add a section to https://www.mediawiki.org/wiki/Extension:AdvancedSearch
Configuration
The configuration options of AdvancedSearch are documented in the file {{git file|project=mediawiki/extensions/AdvancedSearch|branch=HEAD|file=docs/settings.md|text=docs/settings.md}}.
Change 415541 merged by jenkins-bot:
[mediawiki/extensions/AdvancedSearch@master] namespace presets: make configurable