Template:ISCC
This template is used to create links to external databases with images based on their ISCC code. For now, it only links to CommonsDB Explorer but if there are other websites that could be linked to, these should preferably be added to this template.
The template can either get the ISCC code from structured data of a file (through ISCC code (P13150)), or be fed with an ISCC code manually through the parameter ISCC which then overrides any structured data even if there is some. The structured data can come from the file for the page where this template is used, or from an arbitrary file using the parameter file. If neither structured data exists nor a manually written, the template is not showing anything.
Simplified logic:
{{#if:{{{ISCC|}}}|{{{ISCC}}}|
{{#if:{{{file|}}}|{{#property:P13150|from=M{{PAGEID:{{{file}}} }} }}|
{{#if:{{#property:P13150|from=M{{PAGEID}}|{{#property:P13150|from=M{{PAGEID}}
}}
| }}
}}
This means that the manual ISCC takes precedence over the structured data on another file page, which in turn has precdence over structured data on the current page. This means that it is possible to use all three possible combinations of the parameters on a single page.
- Example
{{User:Ainali/ISCC template test|ISCC=KEC5NLBVXTHMCSTP3APBWMPB4MTOY2X7SVVBNSCJ7IKY4FCKZG3NZKY}}
gives
And
{{User:Ainali/ISCC template test|file=File:Sweden-Karlskrona.jpg}}
gives