$smwg­Factbox­Features

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgFactboxFeatures
Description Sets the behaviour of features related to the factbox
Default setting See below
Software Semantic MediaWiki
Since version
Until version still available
Configuration Facts display · Interface settings
Keyword factbox


$smwgFactboxFeatures is a configuration parameter that sets the behaviour of the features related to the factbox. 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. It was further expanded in Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x..2

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 23 September 2019 and compatible with MW 1.31.0 - 1.33.x. in 2019.3

Default setting[edit]

$smwgFactboxFeatures = SMW_FACTBOX_CACHE | SMW_FACTBOX_PURGE_REFRESH | SMW_FACTBOX_DISPLAY_SUBOBJECT | SMW_FACTBOX_DISPLAY_ATTACHMENT;

This means that the three respective features as explained in the following sections on available options are enabled.

Available options[edit]

The options enabled by default are highlighted bold.
  • SMW_FACTBOX_NONE – Disables all factbox related features
  • SMW_FACTBOX_CACHE – Sets that the main cache should be used to avoid reparsing the content on each page view
NoteNote: This option replaces configuration parameter $smwgFactboxUseCacheSets whether or not a factbox content should be stored in cache..
  • SMW_FACTBOX_PURGE_REFRESH – Sets that the faxtbox content should be refreshed when purging a page
NoteNote: This option replaces configuration parameter $smwgFactboxCacheRefreshOnPurgeSets whether or not a cached factbox should be invalidated on an "action=purge" event..
NoteNote: This option was introduced in Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x..1
NoteNote: This option was introduced in Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x..2
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[edit]

To modify the setting to this configuration parameter, add one of the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Disable the display of subobjects

To disable a specific feature e.g. that subobjects should be shown just redefine the configuration parameter by defining it without including the corresponding constant as shown in the above section on available options:

$smwgFactboxFeatures = SMW_FACTBOX_CACHE | SMW_FACTBOX_PURGE_REFRESH | SMW_FACTBOX_DISPLAY_ATTACHMENT;

or alternatively remove the option from the existing definition of the configuration parameter like e.g.

$smwgFactboxFeatures = ( $smwgFactboxFeatures & ~SMW_FACTBOX_DISPLAY_SUBOBJECT );
NoteNote: Please use parentheses4 when combining different bit-operations to avoid a possible mismatch.
Removing all factbox related features

To remove all factbox related features just replace all constants with the one as shown below:

$smwgFactboxFeatures = SMW_FACTBOX_NONE;

See also[edit]

References

  1. a b  Semantic MediaWiki: GitHub pull request gh:smw:3474
  2. a b  Semantic MediaWiki: GitHub pull request gh:smw:3643
  3. ^  Semantic MediaWiki: GitHub pull request gh:smw:2802
  4. ^  Bitwise Operators to use parentheses to ensure the desired precedence ...