$smwgParserFeatures
Configuration parameter details: | |
Name | $smwgParserFeatures |
Description | Sets the behaviour of features related to text and annotation parsing |
Default setting | See below |
Software | Semantic MediaWiki |
Since version | |
Until version | still available |
Configuration | Interface settings |
Keyword | annotation · displaying values · interface |
$smwgParserFeatures
is a configuration parameter that sets the behaviour of the features related to the parsing of annotations on pages. 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]
$smwgParserFeatures = SMW_PARSER_STRICT | SMW_PARSER_INL_ERROR | SMW_PARSER_HID_CATS;
This means that the three respective features as explained in the following sections on available options are enabled.
Available options[edit]
SMW_PARSER_NONE
– Disables query features related to the parsing of annotations on pagesSMW_PARSER_STRICT
– Sets that strictness should be enforced during the parsing of annotations on pages
- Note: This option replaces configuration parameter
$smwgEnabledInTextAnnotationParserStrictMode
Sets whether strictness should be enforced during the annotation parsing process.
SMW_PARSER_INL_ERROR
– Sets that warnings are displayed in wikitext right after the problematic input in annotations
- Note: This option replaces configuration parameter
$smwgInlineErrors
Sets whether warnings should be shown right after problematic annotations.
SMW_PARSER_HID_CATS
– Sets that categories marked with the__HIDDENCAT__
behaviour switch are omitted from the annotation process.
- Note: This option replaces configuration parameter
$smwgShowHiddenCategories
Sets whether to omit categories marked with the HIDDENCAT behaviour switch from the annotation process.
SMW_PARSER_UNSTRIP
– Sets that strip markers for properties of datatype "Text"Holds text of arbitrary length may be stored within property values
- Note: This option replaces configuration parameter
$smwgDecodeTextAnnotationWithStripMarker
Sets whether strip markers for properties of datatype "Text" may be stored within property values.
SMW_PARSER_LINV
– Sets that parsing of links in values for properties of datatype "Text"Holds text of arbitrary length is supported
- Note: This option replaces configuration parameter
$smwgLinksInValues
Sets whether internal links in values for properties of datatype "Text" may be stored within property values.
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 feature related to the parsing of annotations on pages
To disable a specific feature e.g. that hidden categories should not be shown just redefine the configuration parameter by defining it without including the corresponding constant as shown in the above section on available options:
$smwgParserFeatures = SMW_PARSER_STRICT | SMW_PARSER_INL_ERROR;
or alternatively remove the option from the existing definition of the configuration parameter like e.g.
$smwgParserFeatures = ( $smwgParserFeatures & ~SMW_PARSER_HID_CATS );
SMW_PARSER_HID_CATS
option of this configuration parameter requires maintenance script "rebuildData.php"Allows to rebuild all the semantic data for a selected data backend/store to be run.
- Adding a specific feature related to the parsing of annotations on pages
To enable a specific feature e.g. that strip markers for properties of datatype "Text"Holds text of arbitrary length may be stored within property values just redefine the configuration parameter by defining it including the corresponding constant as shown in the above section on available options:
$smwgParserFeatures = SMW_PARSER_STRICT | SMW_PARSER_INL_ERROR | SMW_PARSER_HID_CATS | SMW_PARSER_UNSTRIP;
or alternatively add the option to the existing definition of the configuration parameter like e.g.
$smwgParserFeatures = $smwgParserFeatures | SMW_PARSER_UNSTRIP;
- Disabling all features related to the parsing of annotations on pages
To disable all browse features just remove all constants as shown in the above section on available options:
$smwgParserFeatures = '';
or add the constant for disabling all features related to the parsing of annotations on pages
$smwgParserFeatures = SMW_PARSER_NONE;
SMW_PARSER_HID_CATS
option of this configuration parameter requires maintenance script "rebuildData.php"Allows to rebuild all the semantic data for a selected data backend/store to be run. This requirement is not applicable to all other options to this configuration parameter.
See also[edit]
- Help page on configuration parameter
$smwgEnabledInTextAnnotationParserStrictMode
Sets whether strictness should be enforced during the annotation parsing process - Help page on configuration parameter
$smwgInlineErrors
Sets whether warnings should be shown right after problematic annotations - Help page on configuration parameter
$smwgShowHiddenCategories
Sets whether to omit categories marked with the HIDDENCAT behaviour switch from the annotation process - Help page on configuration parameter
$smwgDecodeTextAnnotationWithStripMarker
Sets whether strip markers for properties of datatype "Text" may be stored within property values - Help page on configuration parameter
$smwgLinksInValues
Sets whether internal links in values for properties of datatype "Text" may be stored within property values
References
- a b Semantic MediaWiki: GitHub pull request gh:smw:2802
- ^ Bitwise Operators to use parentheses to ensure the desired precedence ...