Difference between revisions of "Template:Generate concept formlinks from SMW import page"
From TDWG Terms Wiki
m (plain text) |
m (+ check for type) |
||
Line 23: | Line 23: | ||
-->| Type = <!-- | -->| Type = <!-- | ||
+ | |||
Property pages | Property pages | ||
− | --> | + | -->{{#vardefine: thisFullPageName|{{ns:property}}:{{{ns prefix|}}}:{{#explode: §|!|0}}}}<!-- |
+ | -->{{#vardefine: thisPrefixedVocab|{{{ns prefix|}}}:{{#explode: §|!|0}}}}<!-- | ||
+ | -->{{#vardefine: thisVocabNoPrefix|{{#explode: §|!|0}}}}<!-- | ||
+ | -->{{#vardefine: thisHasTypeImport|{{#replace:{{#explode: §|!|1}}|Type:|}}}}<!-- | ||
+ | -->{{#vardefine: thisHasType|{{#ask: [[{{#var: thisFullPageName}}]] | mainlabel=-|link=none|?Has type#=|format=list}}}}<!-- | ||
+ | |||
+ | page link always | ||
+ | -->[[{{#var: thisFullPageName}}|{{#var: thisVocabNoPrefix}}]] <!-- | ||
+ | |||
+ | check Has type (create a warning if mismatch) and existance (use different icons) | ||
+ | -->{{#ifexist: {{#var: thisFullPageName}}<!-- | ||
+ | |||
+ | then-->|{{#formlink: | ||
form=Property setting<!-- | form=Property setting<!-- | ||
-->|link text=[[File:Pencil.png|x16px|link=]]<!-- | -->|link text=[[File:Pencil.png|x16px|link=]]<!-- | ||
-->|query string=<!-- | -->|query string=<!-- | ||
− | -->Property setting[imported from]= | + | -->Property setting[imported from]={{#var: thisPrefixedVocab}}<!-- |
-->&Property setting[has type]={{#replace:{{#explode: §|!|1}}|Type:|}}<!-- | -->&Property setting[has type]={{#replace:{{#explode: §|!|1}}|Type:|}}<!-- | ||
-->{{#if: {{{title|}}} |&Property setting[title]={{{title|}}}}}<!-- | -->{{#if: {{{title|}}} |&Property setting[title]={{{title|}}}}}<!-- | ||
− | -->|target= | + | -->|target={{#var: thisFullPageName}}<!-- |
− | -->|tooltip=Create | + | -->|tooltip=Edit this property page<!-- |
− | -->}}<!-- | + | -->}}<!-- |
+ | |||
+ | check Has type (create a warning if mismatch) | ||
+ | -->{{#ifeq: {{#var: thisHasType}}|{{#var: thisHasTypeImport}}|<!-- then-->|<!-- else-->{{#info: message=“Type:{{#var: thisHasTypeImport}}” on import page [[MediaWiki:Smw_import_{{{ns prefix|}}}]] does not match “Has type:{{#var: thisHasType}}” on page “{{#var: thisFullPageName}}”!}}}}<!-- | ||
+ | |||
+ | else-->|{{#formlink: | ||
+ | form=Property setting<!-- | ||
+ | -->|link text=[[File:Pencil add.png|x16px|link=]]<!-- | ||
+ | -->|query string=<!-- | ||
+ | -->Property setting[imported from]={{#var: thisPrefixedVocab}}<!-- | ||
+ | -->&Property setting[has type]={{#replace:{{#explode: §|!|1}}|Type:|}}<!-- | ||
+ | -->{{#if: {{{title|}}} |&Property setting[title]={{{title|}}}}}<!-- | ||
+ | -->|target={{#var: thisFullPageName}}<!-- | ||
+ | -->|tooltip=Create this property page<!-- | ||
+ | -->}}<!-- | ||
+ | -->}}<!-- ifexist end | ||
+ | |||
Category pages | Category pages | ||
-->| Category | Class | #default = <!-- Category pages | -->| Category | Class | #default = <!-- Category pages | ||
− | --> | + | -->{{#vardefine: thisFullPageName|{{ns:category}}:{{{ns prefix|}}}:{{#explode: §|!|0}}}}<!-- |
+ | -->{{#vardefine: thisPrefixedVocab|{{{ns prefix|}}}:{{#explode: §|!|0}}}}<!-- | ||
+ | -->{{#vardefine: thisVocabNoPrefix|{{#explode: §|!|0}}}}<!-- | ||
+ | |||
+ | --><span title="A class">[[File:Folder-silk.png|link=]]</span> <!-- | ||
+ | -->[[:{{#var: thisFullPageName}}|{{#var: thisVocabNoPrefix}}]] <!-- | ||
+ | |||
+ | -->{{#ifexist: {{#var: thisFullPageName}}<!-- | ||
+ | then-->|{{#formlink: | ||
form=Concept collection<!-- | form=Concept collection<!-- | ||
-->|link text=[[File:Pencil.png|x16px|link=]]<!-- | -->|link text=[[File:Pencil.png|x16px|link=]]<!-- | ||
-->|query string=<!-- | -->|query string=<!-- | ||
− | -->Concept collection[imported from]= | + | -->Concept collection[imported from]={{#var: thisPrefixedVocab}}<!-- |
-->{{#if: {{{title|}}} |&Concept collection[title]={{{title|}}}}}<!-- | -->{{#if: {{{title|}}} |&Concept collection[title]={{{title|}}}}}<!-- | ||
− | -->|target= | + | -->|target={{#var: thisFullPageName}}<!-- |
− | -->|tooltip= | + | -->|tooltip=Edit this {{lc:{{ns:category}}}} page<!-- |
-->}}<!-- | -->}}<!-- | ||
− | -->}}<!-- | + | else-->|{{#formlink: |
+ | form=Concept collection<!-- | ||
+ | -->|link text=[[File:Pencil add.png|x16px|link=]]<!-- | ||
+ | -->|query string=<!-- | ||
+ | -->Concept collection[imported from]={{#var: thisPrefixedVocab}}<!-- | ||
+ | -->{{#if: {{{title|}}} |&Concept collection[title]={{{title|}}}}}<!-- | ||
+ | -->|target={{#var: thisFullPageName}}<!-- | ||
+ | -->|tooltip=Create this {{lc:{{ns:category}}}} page<!-- | ||
+ | -->}}}}<!-- | ||
+ | -->}}<!-- switch Type or Category | ||
-->}}<!-- | -->}}<!-- | ||
output delimiter | output delimiter | ||
− | --> | + | -->│ <!-- |
− | -->}}<!-- | + | -->}}<!-- arraymap |
ELSE -->|''The name space prefix “{{{ns prefix|}}}” has no corresponding page [[MediaWiki:Smw import {{{ns prefix|}}}]] yet.''<!-- | ELSE -->|''The name space prefix “{{{ns prefix|}}}” has no corresponding page [[MediaWiki:Smw import {{{ns prefix|}}}]] yet.''<!-- | ||
-->}}</includeonly><noinclude>{{Documentation}}</noinclude> | -->}}</includeonly><noinclude>{{Documentation}}</noinclude> |
Revision as of 12:59, 26 September 2012
[edit] [ ] Template documentation
This documentation is transcluded from Template:Generate concept formlinks from SMW import page/doc. (edit | history)
Template “Generate concept formlinks from SMW import page” generates a list of formlinks based on a “MediaWiki:Smw_import-ns-prefix”-page
Usage
This template has the following parameter:
{{Generate concept formlinks from SMW import page
|ns prefix= e.g. "dwc" or "rdf" etc.
|title= optional title of the target page
|query string= form_name[field]=value&form_name[field2]=value3 “form_name” must be given, it will be replaced by an appropriate form
}}
Technical documentation
Dependencies: