Demo:Links in values

From semantic-mediawiki.org

Instead of using in-text annotation to add links in values it is possible to use the #set parser function to avoid having to touch the $smwgLinksInValues configuration parameter.

NoteNote: Starting with Semantic MediaWiki 2.5.0 you may add the SMW_LINV_OBFU option to the $smwgLinksInValues configuration parameter which allows for doing this with in-text annotations.

Method 1[edit]

Step 1 - Annotate the data[edit]

This is done by using the #set parser function without utilizing the "template" parameter.
Syntax:

{{#set: Has text=This text contains an internal link to the [[Main Page]] of this wiki and an external link to the [http://sandbox.semantic-mediawiki.org/wiki/Main_Page Main Page] of another wiki.}}

Step 2 - Query the data[edit]

Using the #show parser function[edit]

Syntax:

{{#show:
 {{FULLPAGENAME}}
 |?Has text
}}

Result:
This text contains an internal link to the Semantic MediaWiki of this wiki and an external link to the Main Page of another wiki.

Using the #ask parser function[edit]

Syntax:

{{#ask:
 [[{{FULLPAGENAME}}]]
 |?Has text
}}

Result:

 Has text
Links in valuesThis text contains an internal link to the Semantic MediaWiki of this wiki and an external link to the Main Page of another wiki.

Method 2[edit]

Annotate and display the data[edit]

This is done by using the #set parser function and utilizing the "template" parameter.
Syntax of the annotation:

{{#set:
 Has text=This text contains an internal link to the [[Main Page]] of this wiki and an external link to the [http://sandbox.semantic-mediawiki.org/wiki/Main_Page Main Page] of another wiki.
 |template=BySetTemplateSimpleValueOutput
}}

Syntax of the BySetTemplateSimpleValueOutput template:

<includeonly>{{{value}}}</includeonly>

Result:
This text contains an internal link to the Semantic MediaWiki of this wiki and an external link to the Main Page of another wiki.

See also[edit]