Demo:Links in values
From semantic-mediawiki.org
Help page · Ask questions · Post feedback
Please consider adopting examples to fit your environment since simple duplication may not create appropriate results.
Data presented on this page are for educational and demonstration purpose only.
Please consider adopting examples to fit your environment since simple duplication may not create appropriate results.
Data presented on this page are for educational and demonstration purpose only.
Table of Contents | |
---|---|
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.
Note: 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 values | This 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]
- Help page on links in values