Difference between revisions of "Template:Rename"
(Restoring revision 5136426 by User:SMbot on 2022-12-26 06:47:47. "→top: replaced: Yu-Gi-Oh!: → Yugipedia: (5)") |
Dinoguy1000 (talk | contribs) (support "reason" as an alternate name for the second parameter since people are used to that from other templates and keep making that mistake with this one) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{ #ifeq: {{NAMESPACE}} | {{ns:6}} | + | {{ #vardefine: $rename-target | {{PAGENAME:{{{1<includeonly>|</includeonly>}}}}} |
− | | {{ # | + | }}{{ #vardefine: $rename-reason | {{ #if: {{{reason|}}} | {{{reason}}} | {{{2<includeonly>|</includeonly>}}} }} |
− | || {{ # | + | }}{{ #if: {{{1|}}} |
+ | | {{ #ifeq: {{NAMESPACE}} | {{ns:6}} | ||
+ | | {{ #vardefine: $rename-extension | {{ lc: {{ #explode: {{PAGENAME}} | . | -1 }} }} | ||
+ | }}{{ #if: {{ #pos: {{ #var: $rename-target }} | .{{ #var: $rename-extension }} | ||
+ | || {{ #switch: {{ lc: {{ #explode: {{ #var: $rename-target }} | . | -1 }} }} | ||
+ | | png | gif | jpg | jpeg | webp | svg | pdf | flac | mkv | mov | mp3 | mp4 | oga | ogg | ogv | wav | webm<!-- recognized extension: replace with the current extension --> | ||
+ | = {{ #vardefine: $rename-target | {{ #sub: {{ #var: $rename-target }} || {{ #rpos: {{ #var: $rename-target }} | {{ #explode: {{ #var: $rename-target }} | . | -1 }} }} }}{{ #var: $rename-extension }} }} | ||
+ | | #default = <!-- no/unrecognized extension: append the current extension -->{{ #vardefine: $rename-target | {{ #var: $rename-target }}.{{ #var: $rename-extension }} }} | ||
+ | }} | ||
+ | }} | ||
+ | }}{{ #ifeq: {{ #var: $rename-target }} | {{PAGENAME}} | ||
+ | | {{mbox | ||
+ | | type = style | ||
+ | | text = Please [{{fullurl:{{FULLPAGENAMEE}}|action=edit}} edit this page] and remove the "Rename" template from its source.<br />This notice was probably forgotten after a [[Yugipedia:Mover|mover]] or [[Yugipedia:Administrators|administrator]] renamed this {{ #switch: {{NAMESPACE}} | {{ns:0}} = article | {{ns:6}} | {{ns:10}} | {{ns:14}} = {{ lc: {{NAMESPACE}} }} | #default = page }}.[[Category:Renamed pages with the rename tag]] | ||
+ | }} | ||
+ | | {{ #ifeq: {{NAMESPACE}} | {{ns:6}} | ||
+ | | {{ #ifexist: File:{{ #var: $rename-target }} | ||
| {{imbox | | {{imbox | ||
| type = delete | | type = delete | ||
− | | text = '''The file [[:File:{{ | + | | text = '''The file [[:File:{{ #var: $rename-target }}]] already exists!''' Please either check whether one of these files should be deleted or if they should be history merged, or choose a different name. |
+ | }} | ||
}} | }} | ||
}} | }} | ||
}} | }} | ||
− | }} | + | }} }}{{mbox |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }}{{mbox | ||
| type = move | | type = move | ||
| text = {{ #ifeq: {{NAMESPACE}} | {{ns:6}} | | text = {{ #ifeq: {{NAMESPACE}} | {{ns:6}} | ||
Line 32: | Line 38: | ||
| Media | | Media | ||
| Candidates | | Candidates | ||
− | }} for renaming|renamed]]{{ #if: {{ | + | }} for renaming|renamed]]{{ #if: {{ #var: $rename-target }} |
| to '''{{ #if: {{NAMESPACE}} | | to '''{{ #if: {{NAMESPACE}} | ||
| {{NAMESPACE}}: | | {{NAMESPACE}}: | ||
− | }}{{ | + | }}{{ #var: $rename-target }}''' |
− | }}. ([[{{ #if: {{{discuss|}}} | {{{discuss}}} | {{TALKPAGENAME}} }}|discuss]]){{ #if: {{ | + | }}. ([[{{ #if: {{{discuss|}}} | {{{discuss}}} | {{TALKPAGENAME}} }}|discuss]]){{ #if: {{ #var: $rename-reason }} |
− | | <br />The reason given was: ''{{ | + | | <br />The reason given was: ''{{ #var: $rename-reason }}'' |
}}{{ #ifeq: {{NAMESPACE}} | {{ns:6}} | }}{{ #ifeq: {{NAMESPACE}} | {{ns:6}} | ||
| <br /> | | <br /> | ||
Please '''do not''' reupload this file; a [[Yugipedia:Mover|mover]] or [[Yugipedia:Administrators|administrator]] will be along shortly to move it to the correct name.<br /><!-- | Please '''do not''' reupload this file; a [[Yugipedia:Mover|mover]] or [[Yugipedia:Administrators|administrator]] will be along shortly to move it to the correct name.<br /><!-- | ||
− | --><small>Administrators: [[Special:WhatLinksHere/{{FULLPAGENAME}}|What links here]]{{•}} [{{fullurl:{{FULLPAGENAMEE}}|action=history}} File history]{{•}} [{{fullurl:Special:MovePage/{{FULLPAGENAMEE}}|wpLeaveRedirect=0{{#if:{{ | + | --><small>Administrators: [[Special:WhatLinksHere/{{FULLPAGENAME}}|What links here]]{{•}} [{{fullurl:{{FULLPAGENAMEE}}|action=history}} File history]{{•}} [{{fullurl:Special:MovePage/{{FULLPAGENAMEE}}|wpLeaveRedirect=0{{ #if: {{ #var: $rename-target }} | &wpNewTitle={{urlencode:File:{{ #var: $rename-target }} }} }}&wpReason={{urlencode:renaming file {{ #if: {{ #var: $rename-target }} |to "File:{{ #var: $rename-target }}"}} {{ #if: {{ #var: $rename-reason }} | because "{{ #var: $rename-reason }}" }} }} }} Rename file]</small> |
}} | }} | ||
}}<includeonly>{{ #ifeq: {{NAMESPACE}}:{{ #titleparts: {{PAGENAME}} | 1 | 1 }} | {{ns:10}}:Rename | }}<includeonly>{{ #ifeq: {{NAMESPACE}}:{{ #titleparts: {{PAGENAME}} | 1 | 1 }} | {{ns:10}}:Rename |
Latest revision as of 18:48, 5 February 2024
It has been suggested that this template be renamed. (discuss) The reason given was: {{{2}}} |
{{Rename}}
is a template used to nominate an article for renaming.
Contents
Usage[edit]
{{Rename|Target name|Reason}}
Replace "Target name" with the name you are suggesting the page be renamed to. Replace "Reason" with the reason you think it should be moved.
Both parameters are optional, but it is recommended that both be used.
Examples[edit]
Suggest a new name and give a reason[edit]
{{Rename|Example|Official English name}}
It has been suggested that this template be renamed to Template:Example. (discuss) The reason given was: Official English name |
No suggested new name or reason[edit]
{{Rename}}
It has been suggested that this template be renamed. (discuss) |
Suggest a new name without giving a reason[edit]
{{Rename|Example}}
It has been suggested that this template be renamed to Template:Example. (discuss) |
Give a reason without suggesting a new name[edit]
{{Rename||Name used in Tag Force 5}}
It has been suggested that this template be renamed. (discuss) The reason given was: Name used in Tag Force 5 |
See also[edit]
- Template:OCG-TCG card image - template used for card images, which automatically determines if the image needs renamed and tags it as appropriate if so