$smwgCategoryFeatures
Configuration parameter details: | |
Name | $smwgCategoryFeatures |
Description | Sets the behaviour of the query features related to category handling |
Default setting | See below |
Software | Semantic MediaWiki |
Since version | |
Until version | still available |
Configuration | Query settings |
Keyword | category |
$smwgCategoryFeatures
is a configuration parameter that sets the behaviour of the query features related to category handling. The configuration parameter was introduced in Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x.1 and deprecated the configuration parameters as indicated in the section on available options below.
Default setting[edit]
$smwgCategoryFeatures = SMW_CAT_REDIRECT | SMW_CAT_INSTANCE | SMW_CAT_HIERARCHY;
This means that the three respective features as explained in the following sections on available options are enabled.
Available options[edit]
SMW_CAT_NONE
– Disables query features related to the handling of categoriesSMW_CAT_REDIRECT
– Set that redirects on categories should be detected and used as annotation values
- Note: This option replaces configuration parameter
$smwgUseCategoryRedirect
Set whether redirects on categories should be detected and used as annotation value.
SMW_CAT_INSTANCE
– Sets that a category statement should be treated as an element of the category
- Note: This option replaces configuration parameter
$smwgCategoriesAsInstances
Sets whether a category statement should be treated as an element of the category.
SMW_CAT_HIERARCHY
– Sets that MediaWiki's subcategory hierarchy should be considered as hierarchy elements in the annotation process
- Note: This option replaces configuration parameter
$smwgUseCategoryHierarchy
Sets whether elements of the subcategory hierarchy are considered as hierarchy elements in the annotation process.
Changing the default setting[edit]
To modify the setting to this configuration parameter, add one of the following lines to your "LocalSettings.php" file after the enableSemantics()
call:
- Removing a specific query feature related to category handling
To disable a specific feature e.g. that redirects on categories should be detected and used as annotation values just redefine the configuration parameter by defining it without including the corresponding constant as shown in the above section on available options:
$smwgCategoryFeatures = SMW_CAT_INSTANCE | SMW_CAT_HIERARCHY;
or alternatively remove the option from the existing definition of the configuration parameter like e.g.
$smwgCategoryFeatures = ( $smwgCategoryFeatures & ~SMW_CAT_REDIRECT );
- Disabling all query features related to category handling
To disable all features related to category handling just remove all constants as shown in the above section on available options:
$smwgCategoryFeatures = '';
or add the constant for disabling all category handling features
$smwgCategoryFeatures = SMW_CAT_NONE;
See also[edit]
- Help page on configuration parameter
$smwgUseCategoryHierarchy
Sets whether elements of the subcategory hierarchy are considered as hierarchy elements in the annotation process - Help page on configuration parameter
$smwgCategoriesAsInstances
Sets whether a category statement should be treated as an element of the category - Help page on configuration parameter
$smwgUseCategoryRedirect
Set whether redirects on categories should be detected and used as annotation value
References
- a b Semantic MediaWiki: GitHub pull request gh:smw:2806
- ^ Bitwise Operators to use parentheses to ensure the desired precedence ...