k (1 versie geïmporteerd: Importeren dump EMont-core DeltaExpertise 4 november 2015)
|
|
||
(15 tussenliggende versies door dezelfde gebruiker niet weergegeven) | |||
Regel 10: | Regel 10: | ||
}} |
}} |
||
</pre> |
</pre> |
||
+ | <templatedata> |
||
+ | { |
||
+ | "description": "Cite", |
||
+ | "params": { |
||
+ | "resource": { |
||
+ | "label": "Resource", |
||
+ | "description": "Link to a resource", |
||
+ | "type": "wiki-page-name", |
||
+ | "required": true |
||
+ | }, |
||
+ | "name": { |
||
+ | "label": "Name", |
||
+ | "description": "Name of resource in page", |
||
+ | "type": "string", |
||
+ | "suggested": true |
||
+ | }, |
||
+ | "optional": { |
||
+ | "label": "Optional", |
||
+ | "description": "Optional info", |
||
+ | "type": "string" |
||
+ | } |
||
+ | } |
||
+ | } |
||
+ | </templatedata> |
||
Edit the page to see the template text. |
Edit the page to see the template text. |
||
− | </noinclude><includeonly>{{#vardefine:varResource|{{{resource|}}} }}{{#vardefine:varName|{{#if: {{{name|}}}| {{{name}}} | {{#show: {{#var:varResource}} | ?Dct:title }} }} }}{{#set:Reference={{#var:varResource}} }}[[{{# |
+ | </noinclude><includeonly>{{#vardefine:varResource|{{{resource|}}}}}{{#vardefine:varName|{{#if: {{{name|}}}| {{{name}}} | {{#show: {{#var:varResource}} | ?Dct:title }} }} }}{{#vardefine:varResourceName|{{#replace:{{#replace:{{#var:varResource}}|File:|Media:}}|Bestand:|Media:}} }}{{#set:Reference={{#var:varResource}} }}{{#ifeq:{{#sub:{{#var:varResourceName}}|0|6}}|Media:|[[{{#var:varResourceName}}|{{#var:varName}}]]|{{#if: {{#show: {{#var:varResource}} | ?Hyperlink}}|{{External link|resource={{#var:varResourceName}}|name={{#var:varName}} }}|{{#if: {{#show: {{#var:varResource}} | ?Wikipage}}|{{Internal link|resource={{#var:varResource}}|name={{#var:varName}}}}|{{{name|}}} ({{#show: {{#var:varResource}} | ?Dct:creator}}, {{#show: {{#var:varResource}} | ?Dct:date}})}} }} }}{{#if: {{{optional|}}}| <nowiki> </nowiki>({{{optional}}})|}}</includeonly> |
This is the "Cite" template. It should be called in the following format:
{{Cite |resource= |name= |optional= }}
<templatedata> { "description": "Cite", "params": { "resource": { "label": "Resource", "description": "Link to a resource", "type": "wiki-page-name", "required": true }, "name": { "label": "Name", "description": "Name of resource in page", "type": "string", "suggested": true }, "optional": { "label": "Optional", "description": "Optional info", "type": "string" } } } </templatedata> Edit the page to see the template text.