Template:Copyright: Difference between revisions
Appearance
Cdjensen94 (talk | contribs) |
Cdjensen94 (talk | contribs) |
||
| Line 14: | Line 14: | ||
<!-- If name is missing, error out --> | <!-- If name is missing, error out --> | ||
{{#switch: {{#if:{{{name|{{{2|}}}}}}|1|0}} | {{#switch: {{#if:{{{name|{{{2|}}}}}}|1|0}} | ||
| 0 = <span class=" | | 0 = <span class="error">Copyright error: missing name.</span> | ||
| 1 = | | 1 = | ||
<!-- If year is omitted, use current year --> | <!-- If year is omitted, use current year --> | ||
| Line 25: | Line 25: | ||
<!-- Year is valid and <= current year --> | <!-- Year is valid and <= current year --> | ||
{{#ifexpr: {{{year|{{{1|}}}}}} = {{#time:Y}} | | {{#ifexpr: {{{year|{{{1|}}}}}} = {{#time:Y}} | | ||
© {{#time:Y}} {{{name|{{{2|}}}}}} | | <div class="copyright">© {{#time:Y}} {{{name|{{{2|}}}}}}</div> | | ||
© {{{year|{{{1|}}}}}}–{{#time:Y}} {{{name|{{{2|}}}}}} | <div class="copyright">© {{{year|{{{1|}}}}}}–{{#time:Y}} {{{name|{{{2|}}}}}}</div> | ||
}} | }} | ||
}} | }} | ||
| Line 32: | Line 32: | ||
| | | | ||
<!-- No year given --> | <!-- No year given --> | ||
© {{#time:Y}} {{{name|{{{2|}}}}}} | <div class="copyright">© {{#time:Y}} {{{name|{{{2|}}}}}}</div> | ||
}} | }} | ||
}} | }} | ||
Revision as of 17:54, 3 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