Template:Copyright: Difference between revisions
Appearance
Cdjensen94 (talk | contribs) |
|||
| (3 intermediate revisions by the same user not shown) | |||
| Line 11: | Line 11: | ||
== Examples == | == Examples == | ||
{{Copyright|year=2021|name=Jensen Saga Studio}}{{Copyright|2021|Jensen Saga Studio}}{{Copyright|name=Jensen Saga Studio}} | {{Copyright|year=2021|name=Jensen Saga Studio}}{{Copyright|2021|Jensen Saga Studio}}{{Copyright|name=Jensen Saga Studio}} | ||
</noinclude><includeonly> | </noinclude><includeonly>{{#switch: {{#if:{{{name|{{{2|}}}}}}|1|0}} | ||
| 0 = {{#tag:span|Copyright error: missing name.|class=error}} | |||
{{#switch: {{#if:{{{name|{{{2|}}}}}}|1|0}} | |||
| 0 = | |||
| 1 = | | 1 = | ||
{{#if:{{{year|{{{1|}}}}}}| | {{#if:{{{year|{{{1|}}}}}}| | ||
{{#iferror:{{#expr: {{{year|{{{1|}}}}}} + 0 }}| | {{#iferror:{{#expr: {{{year|{{{1|}}}}}} + 0 }}| | ||
{{#tag:span|Copyright error: invalid year “{{{year|{{{1|}}}}}}”.|class=error}}| | |||
{{#ifexpr: {{{year|{{{1|}}}}}} > {{#time:Y}} | | {{#ifexpr: {{{year|{{{1|}}}}}} > {{#time:Y}} | | ||
{{#tag:span|Copyright error: year “{{{year|{{{1|}}}}}}” is in the future.|class=error}} | | |||
{{#ifexpr: {{{year|{{{1|}}}}}} = {{#time:Y}} | | {{#ifexpr: {{{year|{{{1|}}}}}} = {{#time:Y}} | | ||
© {{#time:Y}} {{{name|{{{2|}}}}}} | | {{#tag:div|© {{#time:Y}} {{{name|{{{2|}}}}}}|class=copyright}} | | ||
© {{{year|{{{1|}}}}}}–{{#time:Y}} {{{name|{{{2|}}}}}} | {{#tag:div|© {{{year|{{{1|}}}}}}–{{#time:Y}} {{{name|{{{2|}}}}}}|class=copyright}} | ||
}} | }} | ||
}} | }} | ||
}} | }} | ||
| | | | ||
{{#tag:div|© {{#time:Y}} {{{name|{{{2|}}}}}}|class=copyright}} | |||
}} | }} | ||
}} | }}</includeonly> | ||
</includeonly> | |||
<noinclude> | <noinclude> | ||
[[Category:Licensing templates]] [[Category:Image license templates]] [[Category:Templates]] | [[Category:Licensing templates]] [[Category:Image license templates]] [[Category:Templates]] [[Category:File license templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 12:31, 4 October 2025
This template prints a copyright notice with sane year logic.
Usage:
{{Copyright|year=2021|name=Jensen Saga Studio}}
{{Copyright|2021|Jensen Saga Studio}} <!-- positional works too -->
{{Copyright|name=Jensen Saga Studio}} <!-- year omitted -> current year -->
{{Copyright|2026|name=Jensen Saga Studio}} <!-- will give error if year is ahead of current -->
Examples
© 2021–2025 Jensen Saga Studio
© 2021–2025 Jensen Saga Studio
© 2025 Jensen Saga Studio