Difference between pages "Template:Normalized pagename/doc" and "Card Gallery:Icejade Gymir Aegirine"

From Yugipedia
< Template:Normalized pagename(Difference between pages)
Jump to: navigation, search
(create)
(Tags: Mobile edit, Mobile web edit)
 
m
 
Line 1: Line 1:
{{Documentation subpage}}
+
{{Navigation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
{{tl|Normalized pagename}} is a template which [[wikipedia:Data normalization|normalizes]] a page's name, as returned by <code><nowiki>{{FULLPAGENAME}}</nowiki></code> and other [[mw:Special:MyLanguage/Help:Magic words#Page names|page name magic words]], by replacing [[wikipedia:Numeric character reference|numeric character references]] and [[wikipedia:List of XML and HTML character entity references|character entity references]] (collectively, "character references") with the actual character (for instance, <code>&amp;quot;</code> is replaced with <code>"</code>). This is most often useful when using the [[mw:Special:MyLanguage/Help:Extension:ParserFunctions##ifeq|<code>#ifeq</code> parser function]] to compare the value of these magic words with values passed into a template via a parameter.
 
  
By default, {{tl|Normalized pagename}} uses <code><nowiki>{{FULLPAGENAME}}</nowiki></code>, but it accepts an unnamed parameter allowing other values to be used, e.g. <code><nowiki>{{Normalized pagename|{{PAGENAME}}}}</nowiki></code>.
+
{{Card gallery|region=EN|
 +
PHHY-EN038; Photon Hypernova; UR; 1E
 +
}}
 +
 
 +
{{Card gallery|region=FR|
 +
PHHY-FR038; Photon Hypernova; UR; 1E
 +
}}
  
== Technical details ==
+
{{Card gallery|region=DE|
=== Characters in page names ===
+
PHHY-DE038; Photon Hypernova; UR; 1E
Several different characters may be replaced by <code><nowiki>{{FULLPAGENAME}}</nowiki></code> and related magic words. The replacements made for a particular title can be viewed using the code <code class="nowrap"><nowiki>{{ #tag: syntaxhighlight | {{PAGENAME:</nowiki>''Title''<nowiki>}} }}</nowiki></code>; for instance, for the title <code class="nowrap">"We'll Be There" - Rex & Weevil</code>, this code produces <span class="nowrap">{{ #tag: syntaxhighlight | {{PAGENAME:"We'll Be There" - Rex & Weevil}} | inline=yes }}</span>.
+
}}
  
On this wiki, the following character replacements are made by <code><nowiki>{{FULLPAGENAME}}</nowiki></code> and related magic words. Note that because a lone period (<code>.</code>) is not output (it represents the [[wikipedia:Working directory|working directory]] in Unix-like systems and Microsoft Windows) and a leading colon (<code>:''foo''</code>) is stripped, they are prefixed by a capital "A"; the other characters are also prefixed for consistency. The asterisk (<code>*</code>) is also shown preceding the "A" since when it is the leading character (<code>*''foo''</code>), it gets replaced with a character reference. The characters <code class="nowrap"><nowiki>&lt; &gt; [ ] { | }</nowiki></code> are illegal in page titles in MediaWiki, and the character <code>#</code> introduces the [[wikipedia:Fragment identifier|fragment identifier]] in URLs, so these characters are not listed below (<code><nowiki>{{FULLPAGENAME}}</nowiki></code> and related magic words will strip these characters, or output nothing, when they are passed in).
+
{{Card gallery|region=IT|
{{ #tag: syntaxhighlight |
+
PHHY-IT038; Photon Hypernova; UR; 1E
A! {{PAGENAME: A! }}
 
A" {{PAGENAME: A" }}
 
A$ {{PAGENAME: A$ }}
 
A% {{PAGENAME: A% }}
 
A& {{PAGENAME: A& }}
 
A' {{PAGENAME: A' }}
 
A( {{PAGENAME: A( }}
 
A) {{PAGENAME: A) }}
 
A* {{PAGENAME: A* }}
 
*A {{PAGENAME: *A }}
 
A+ {{PAGENAME: A+ }}
 
A, {{PAGENAME: A, }}
 
A. {{PAGENAME: A. }}
 
A/ {{PAGENAME: A/ }}
 
A: {{PAGENAME: A: }}
 
A; {{PAGENAME: A; }}
 
A= {{PAGENAME: A= }}
 
A? {{PAGENAME: A? }}
 
A@ {{PAGENAME: A@ }}
 
A\ {{PAGENAME: A\ }}
 
A^ {{PAGENAME: A^ }}
 
A_ {{PAGENAME: A_ }}
 
A` {{PAGENAME: A` }}
 
A~ {{PAGENAME: A~ }}
 
 
}}
 
}}
  
=== Replacements ===
+
{{Card gallery|region=PT|
{{tl|Normalized pagename}} performs the following replacements.
+
PHHY-PT038; Photon Hypernova; UR; 1E
{| class="wikitable"
+
}}
|-
 
! scope="col" | Numeric character reference
 
! scope="col" | Character entity reference
 
! scope="col" | Character
 
|-
 
| <code>&amp;#34;</code>
 
| <code>&amp;quot;</code>
 
| <code>"</code>
 
|-
 
| <code>&amp;#38;</code>
 
| <code>&amp;amp;</code>
 
| <code>&</code>
 
|-
 
| <code>&amp;#39;</code>
 
| <code>&amp;apos;</code>
 
| <code>'</code>
 
|-
 
| <code>&amp;#59;</code>
 
| —
 
| <code>;</code>
 
|-
 
| <code>&amp;#61;</code>
 
| —
 
| <code>=</code>
 
|-
 
|}
 
  
=== Why not <code>#titleparts</code>? ===
+
{{Card gallery|region=SP|
{{tl|Normalized pagename}} is written using the [[mw:Special:MyLanguage/Extension:StringFunctions##replace:|<code>#replace</code> string function]], even though the [[mw:Special:MyLanguage/Help:Extension:ParserFunctions##titleparts|<code>#titleparts</code> parser function]] can perform the same task without requiring multiple functions: <code class="nowrap"><nowiki>{{ #titleparts: {{PAGENAME:"We'll Be There" - Rex & Weevil}} }}</nowiki></code> → <span class="nowrap">{{ #tag: syntaxhighlight | {{ #titleparts: {{PAGENAME:"We'll Be There" - Rex & Weevil}} }} | inline=yes }}</span>. This is because <code>#titleparts</code> automatically strips any content after a hash (<code>#</code>), including the hash itself. <code><nowiki>{{FULLPAGENAME}}</nowiki></code> and related magic words also strip this content from input, but {{tl|Normalized pagename}} may be passed raw strings directly, without using any magic words, and these strings may contain hashes which should not affect the output. For example, the string <code class="nowrap">Nekogal #2</code> results in the following outputs:
+
PHHY-SP038; Photon Hypernova; UR; 1E
* <code><nowiki>{{PAGENAME:Nekogal #2}}</nowiki></code> → {{PAGENAME:Nekogal #2}}
+
}}
* <code><nowiki>{{ #titleparts: Nekogal #2 }}</nowiki></code> → {{ #titleparts: Nekogal #2 }}
 
* <code><nowiki>{{Normalized pagename|Nekogal #2}}</nowiki></code> → {{Normalized pagename|Nekogal #2}}
 
  
<includeonly>
+
{{Card gallery|region=JP|
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
+
PHHY-JP038; Photon Hypernova ::OP
[[Category:Templates]]
+
PHHY-JP038; Photon Hypernova; SR
</includeonly>
+
PHHY-JP038; Photon Hypernova; ScR
 +
PHHY-JP038; Photon Hypernova; PScR
 +
}}
 +
 
 +
{{Card gallery|region=KR|
 +
PHHY-KR038; Photon Hypernova; SR; UE
 +
PHHY-KR038; Photon Hypernova; ScR; UE
 +
PHHY-KR038; Photon Hypernova; PScR; UE
 +
}}
 +
 
 +
{{Card gallery|region=EN|type=Video games|
 +
MADU :: artwork
 +
}}

Revision as of 13:43, 27 June 2023