$smwgParserFeatures

From Linux Web Expert


Template:Interlanguagelink: en
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


__NOBREADCRUMBLINKS__

$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 an unknown date unknown versions of MediaWiki1 and deprecated the configuration parameters as indicated in the section on available options below.

The deprecated configuration settings as indicated in the section on available options should be migrated to this configuration parameter in "LocalSettings.php" since they will be removed with the release of Semantic MediaWiki 3.1.0Released on an unknown date unknown versions of MediaWiki in 2019.1

Default setting

$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

The options enabled by default are highlighted bold.
  • SMW_PARSER_NONE – Disables query features related to the parsing of annotations on pages
  • SMW_PARSER_STRICT – Sets that strictness should be enforced during the parsing of annotations on pages
  • SMW_PARSER_INL_ERROR – Sets that warnings are displayed in wikitext right after the problematic input in annotations
This option replaces configuration parameter $smwgInlineErrorsNo description was provided..
  • SMW_PARSER_HID_CATS – Sets that categories marked with the __HIDDENCAT__ behaviour switch are omitted from the annotation process.
This option replaces configuration parameter $smwgDecodeTextAnnotationWithStripMarkerNo description was provided..
This option replaces configuration parameter $smwgLinksInValuesNo description was provided..
For further information on the available options listed above see the documentation pages of the respective deprecated configuration parameters as stated above.

Changing the default setting

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 );
Please use parentheses2 when combining different bit-operations to avoid a possible mismatch.
Adding or removing the SMW_PARSER_HID_CATS option of this configuration parameter requires maintenance script "rebuildData.php"No description was provided. 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;
Adding or removing the SMW_PARSER_HID_CATS option of this configuration parameter requires maintenance script "rebuildData.php"No description was provided. to be run. This requirement is not applicable to all other options to this configuration parameter.

See also

#scite could not render a citation text for reference "gh:smw:2802" because type "pullrequest" was not assigned to a template.

References

  1. a b gh:smw:2802 
  2. ^  Bitwise Operators to use parentheses to ensure the desired precedence ...