Help:Configuration parameter "$smwgLinksInValues"

Jump to: navigation, search
edit with form (experimental)

Title $smwgLinksInValues
Description Sets whether internal links may be stored within property values
Default setting
Software Semantic MediaWiki
First version supported
Last version supported still available
Configuration Installation
Keyword property

$smwgLinksInValues is a configuration parameter that sets whether internal links within property values of datatype "Text" such as e.g. [[Property::Some [[internal link]] in property value.]] may be resolved. The setting was introduced in Semantic MediaWiki 1.3.0. Starting with Semantic MediaWiki 2.5.01 the settings to this configuration parameter and the underlying behaviour of the wiki was changed to eliminate the deficiency caused by the earlier PCRE approach as described below as legacy behaviour.

Default setting

$smwgLinksInValues = false;

Available options

  • SMW_LINV_OBFU - Allows for extended use cases2, better performance3 and avoids crashes 1 as described below as legacy behaviour.
    NoteNote: This is the recommended setting for this configuration parameter.
  • SMW_LINV_PCRE - Allows to avoid breakages for existing wikis by retaining the behaviour formerly set with "true" retained as a legacy setting.
    NoteNote: Setting "true" is still supported as a legacy setting and identical to setting this option.


The SMW_LINV_OBFU option further supports resolving of in-text annotations within a text element such as e.g. [[Has text::[[Lorem ipsum]] dolor sit amet, [[Has page::consectetur adipiscing elit]]]].

Changing the default setting

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

Enable extended use cases, better performance and less issues
$smwgLinksInValues = SMW_LINV_OBFU;
NoteNote: This is now the recommended setting for this configuration parameter.
Retain the depreciated PCRE approach as described below
$smwgLinksInValues = SMW_LINV_PCRE;

Legacy behaviour

The results of a query displayed on special page "Ask" are not parsed further even if this setting is enabled. This means that results for properties of datatype "Text" containing links will be displayed as-is, i.e. links like SMW Project within the data value will be displayed as [[Help:SMW Project|SMW Project]].

Important noteImportant Note: If enabled, this may lead to PHP crashes (!) when very long texts are used as values. This is due to limitations in earlier versions of the library PCRE that PHP uses for pattern matching. The provoked PHP crashes will prevent requests from being completed - usually clients will receive server errors like e.g. "invalid response" or be offered to download "index.php". In later versions this may cause the maintenance script "rebuildData.php" to fail.4 It might however be okay to enable this if such problems are not observed in your wiki.
NoteNote: Probably starting with Semantic MediaWiki 1.9.0 it is possible to use the #set parser function to annotate links in values without the need to change this configuration parameter. See also the demo page on how to do this. - Use the SMW_LINV_OBFU option instead starting with Semantic MediaWiki 2.5.0.

See also