From Tetherless World Wiki
Description
- description: Add semantic tag (triple/triples) to a wiki page with display option
- module: SBP FIT
- version: SBP 0.2
- status: unstable
- author: Li Ding
Usage
function: print a SMW link with rendering option
syntax:
{{fit.tag|PROPERTY|VALUE|ns= |mode= |format= }}
notes:
- PROPERTY: property, reserved term "type" for type declaration.
- VALUE: value (excluding namespace)
options
| option | description
|
| ns= | namespace of value, unassigned by default. set to "Category" when "type" is used as PROPERTY
|
| mode= | parse mode option. possible values: unassigned (default), "list"
|
| format= | format option. possible values: ul(default), "hide","none", "ul', "ol", "tr"
|
Examples
Adding Typed Links
| description
| code
| result
|
| User may declare the type/category of a wiki page. (s, type, class)
| {{fit.tag|type|Test Category 1}}
|
|
| User may declare a regular triple about a wiki page. (s, p, o)
| {{fit.tag|test|Test Page 1}}
|
|
| User may still declare a regular wiki link
| {{fit.tag||Test Page 2}}
| Test Page 2
|
Using Parameters
using the ns and mode options
| description
| code
| result
|
| user can assert the namespace of the target page using "ns=" option
| {{fit.tag|test|Test Page 3 |ns=Image}}
|
|
| User can add multiple values using "mode=list' option
| {{fit.tag|type|Test Category 3,Test Category 4 |mode=list }}
|
|
| when using "mode=list' option, the deliminator could be a ';' or ','
| {{fit.tag|test|Test Page, 4;Test Page, 5 |mode=list }}
|
|
| when not using "mode=list' option, we will not process ';' or ','
| {{fit.tag|test|Test Page, 6 }}
|
|
using the format option
| description
| code
| result
|
| show a typed link with default format which is the same as "format=ul' option
|
{{fit.tag|type|Test Category 2 (hidden) }}
{{fit.tag|type|Test Category 2 (hidden) }}
|
|
| hide a typed link using "format=hide' option
| {{fit.tag|type|Test Category 2 (hidden) |format=hide }}
|
|
| show a typed link without format using "format=none' option
| {{fit.tag|type|Test Category 2 (hidden) |format=none}}
| Test Category 2 (hidden)
|
| show a typed link using "format=ol' option
|
<!--
-->{{fit.tag|type|Test Category 2 (hidden) |format=ol }}<!--
-->{{fit.tag|type|Test Category 2 (hidden) |format=ol }}<!--
-->
|
- type: Test Category 2 (hidden)
- type: Test Category 2 (hidden)
|
| show a typed link using "format=tr' option
|
{|- border=1
<!--
-->{{fit.tag|type|Test Category 2 (hidden) |format=tr }}<!--
-->{{fit.tag|type|Test Category 2 (hidden) |format=tr }}<!--
-->
|}
|
|