Difference between revisions of "Template:Generate concept formlinks from SMW import page"
From TDWG Terms Wiki
m (no red links) |
m (removed wrong usage of #formlink of Concept collection and replaced it by #formlink with Concept scheme class) |
||
(14 intermediate revisions by the same user not shown) | |||
Line 11: | Line 11: | ||
-->|{{!}}|!}}<!-- | -->|{{!}}|!}}<!-- | ||
-->}} | -->}} | ||
− | The {{abbr|SMW}}-import-page ([[MediaWiki:Smw import {{{ns prefix|}}}]]) defines a name space prefix “{{{ns prefix|}}}” {{#if: {{{title|}}} | (={{{title|}}}) }}and the following pages (=concepts):<br/><!-- | + | The {{abbr|SMW}}-import-page ([[MediaWiki:Smw import {{{ns prefix|}}}]]) defines a name space prefix “{{{ns prefix|}}}” {{#if: {{{title|}}} | (={{{title|}}}) }}and the following pages (=concepts or concept collections “[[File:Folder-silk.png|link=]]”):<br/><!-- |
-->{{#arraymap: {{#var: smwimport}}<!-- | -->{{#arraymap: {{#var: smwimport}}<!-- | ||
-->|<nowiki></nowiki> | -->|<nowiki></nowiki> | ||
Line 34: | Line 34: | ||
-->{{#ifexist: {{#var: thisFullPageName}}<!-- | -->{{#ifexist: {{#var: thisFullPageName}}<!-- | ||
− | then-->|[[{{#var: thisFullPageName}}|{{#var: thisVocabNoPrefix}}]] {{#formlink: | + | then-->|[[{{#var: thisFullPageName}}|{{#var: thisVocabNoPrefix}}]] <!-- |
+ | |||
+ | 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:''{{#if: {{#var: thisHasType}}|{{#var: thisHasType}}|<span class="error">missing value</span>}}'' on page {{#ifeq: {{FULLPAGENAME}}|{{#var: thisFullPageName}}|this page|[[{{#var: thisFullPageName}}]]}}!{{#switch: {{lc:{{#var: thisHasTypeImport}}}}<!-- | ||
+ | -->| uri =  You probably mean “Type:URL”.<!-- | ||
+ | -->| page =  “Type:Page” is most suited for reused concepts. To be resolved correctly point always to “Property:myns:myimportedconcept”.<!-- | ||
+ | -->}}<!-- end switch | ||
+ | -->|icon=warning}}}}<!-- | ||
+ | |||
+ | -->{{#formlink: | ||
form=Property setting<!-- | form=Property setting<!-- | ||
-->|link text=[[File:Pencil.png|x16px|link=]]<!-- | -->|link text=[[File:Pencil.png|x16px|link=]]<!-- | ||
Line 41: | Line 50: | ||
-->&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|}}}}}<!-- | ||
+ | -->{{#if: {{{query string|}}} |&{{#replace: {{{query string|}}}|form_name|Property setting}}}}<!-- | ||
-->|target={{#var: thisFullPageName}}<!-- | -->|target={{#var: thisFullPageName}}<!-- | ||
-->|tooltip=Edit this property page<!-- | -->|tooltip=Edit this property page<!-- | ||
-->}}<!-- | -->}}<!-- | ||
− | + | else-->|{{#var: thisVocabNoPrefix}} {{#formlink: | |
− | + | ||
− | + | ||
− | else-->|{{#var: thisVocabNoPrefix}}& | + | |
form=Property setting<!-- | form=Property setting<!-- | ||
− | -->|link text=[[File: | + | -->|link text=[[File:Add.png|x13px|link=]]<!-- |
-->|query string=<!-- | -->|query string=<!-- | ||
-->Property setting[imported from]={{#var: thisPrefixedVocab}}<!-- | -->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|}}}}}<!-- | ||
+ | -->{{#if: {{{query string|}}} |&{{#replace: {{{query string|}}}|form_name|Property setting}}}}<!-- | ||
-->|target={{#var: thisFullPageName}}<!-- | -->|target={{#var: thisFullPageName}}<!-- | ||
-->|tooltip=Create this property page<!-- | -->|tooltip=Create this property page<!-- | ||
Line 70: | Line 78: | ||
-->{{#ifexist: {{#var: thisFullPageName}}<!-- | -->{{#ifexist: {{#var: thisFullPageName}}<!-- | ||
− | then-->|[[:{{#var: thisFullPageName}}|{{#var: thisVocabNoPrefix}}]]& | + | then-->|[[:{{#var: thisFullPageName}}|{{#var: thisVocabNoPrefix}}]] {{#formlink: |
− | form=Concept | + | form=Concept scheme class<!-- |
-->|link text=[[File:Pencil.png|x16px|link=]]<!-- | -->|link text=[[File:Pencil.png|x16px|link=]]<!-- | ||
-->|query string=<!-- | -->|query string=<!-- | ||
− | -->Concept | + | -->Concept scheme class[imported from]={{#var: thisPrefixedVocab}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{query string|}}} |&{{#replace: {{{query string|}}}|form_name|Concept scheme class}}}}<!-- |
-->|target={{#var: thisFullPageName}}<!-- | -->|target={{#var: thisFullPageName}}<!-- | ||
-->|tooltip=Edit this {{lc:{{ns:category}}}} page<!-- | -->|tooltip=Edit this {{lc:{{ns:category}}}} page<!-- | ||
-->}}<!-- | -->}}<!-- | ||
− | else-->|{{#var: thisVocabNoPrefix}}& | + | else-->|{{#var: thisVocabNoPrefix}} {{#formlink: |
− | form=Concept | + | form=Concept scheme class<!-- |
− | -->|link text=[[File: | + | -->|link text=[[File:Add.png|x13px|link=]]<!-- |
-->|query string=<!-- | -->|query string=<!-- | ||
− | -->Concept | + | -->Concept scheme class[imported from]={{#var: thisPrefixedVocab}}<!-- |
− | -->{{#if: {{{ | + | -->{{#if: {{{query string|}}} |&{{#replace: {{{query string|}}}|form_name|Concept scheme class}}}}<!-- |
-->|target={{#var: thisFullPageName}}<!-- | -->|target={{#var: thisFullPageName}}<!-- | ||
-->|tooltip=Create this {{lc:{{ns:category}}}} page<!-- | -->|tooltip=Create this {{lc:{{ns:category}}}} page<!-- | ||
Line 92: | Line 100: | ||
output delimiter | output delimiter | ||
− | -->|& | + | -->| │ <!-- |
-->}}<!-- arraymap | -->}}<!-- 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> |
Latest revision as of 16:17, 7 January 2013
[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: