$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

Starting with Semantic MediaWiki 7.0.0Released on 4 June 2026 and compatible with MW 1.43.x - 1.46.x. this parameter accepts an array of plain string keys instead of the SMW_FACTBOX_* constants. The constant form still works but is deprecated and will be removed in Semantic MediaWiki 8.0.0Released on an unknown date and compatible with unknown versions of MediaWiki..3

Default setting[edit]

$smwgFactboxFeatures = [ 'cache', 'purge-refresh', 'display-subobject', 'display-attachment' ];

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

Available options[edit]

The options enabled by default are highlighted in bold.
  • 'cache' (formerly 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..
  • 'purge-refresh' (formerly SMW_FACTBOX_PURGE_REFRESH) – Sets that the factbox 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..
  • 'display-subobject' (formerly SMW_FACTBOX_DISPLAY_SUBOBJECT) – Sets that the subobjects stored on a page should also be displayed when showing the factbox
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 options listed above, see the documentation pages of the respective deprecated configuration parameters.

Changing the default setting[edit]

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

Disable the display of subobjects

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

$smwgFactboxFeatures = [ 'cache', 'purge-refresh', 'display-attachment' ];
Removing all factbox-related features

To remove all factbox-related features, set the parameter to an empty array:

$smwgFactboxFeatures = [];

Legacy constant form (deprecated since 7.0.0)[edit]

The constant form below is deprecated since Semantic MediaWiki 7.0.0Released on 4 June 2026 and compatible with MW 1.43.x - 1.46.x. and will be removed in Semantic MediaWiki 8.0.0Released on an unknown date and compatible with unknown versions of MediaWiki.. Use the string-array form shown above instead. It is documented here for wikis still running the constant form.

The default expressed with constants:

$smwgFactboxFeatures = SMW_FACTBOX_CACHE | SMW_FACTBOX_PURGE_REFRESH | SMW_FACTBOX_DISPLAY_SUBOBJECT | SMW_FACTBOX_DISPLAY_ATTACHMENT;

A specific feature can be removed with a bit-operation, e.g. to disable the display of subobjects:

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

To remove all factbox-related features with the constant form, set the parameter to 0:

$smwgFactboxFeatures = 0;

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:6791
  4. ^  Bitwise Operators to use parentheses to ensure the desired precedence ...