|
|
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>&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 |
| + | }} |
| | | |
− | == Technical details ==
| + | {{Card gallery|region=FR| |
− | === Characters in page names ===
| + | PHHY-FR038; 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}} | lang=html | 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>< > [ ] { | }</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=DE| |
− | {{ #tag: syntaxhighlight |
| + | PHHY-DE038; 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~ }}
| |
− | | lang=html }}
| |
| | | |
− | === Replacements ===
| + | {{Card gallery|region=IT| |
− | {{tl|Normalized pagename}} performs the following replacements. | + | PHHY-IT038; Photon Hypernova; UR; 1E |
− | {| class="wikitable"
| + | }} |
− | |- | |
− | ! scope="col" | Numeric character reference
| |
− | ! scope="col" | Character entity reference
| |
− | ! scope="col" | Character
| |
− | |-
| |
− | | <code>&#34;</code>
| |
− | | <code>&quot;</code>
| |
− | | <code>"</code>
| |
− | |-
| |
− | | <code>&#38;</code>
| |
− | | <code>&amp;</code>
| |
− | | <code>&</code>
| |
− | |-
| |
− | | <code>&#39;</code>
| |
− | | <code>&apos;</code>
| |
− | | <code>'</code>
| |
− | |-
| |
− | | <code>&#59;</code>
| |
− | | —
| |
− | | <code>;</code>
| |
− | |-
| |
− | | <code>&#61;</code>
| |
− | | —
| |
− | | <code>=</code>
| |
− | |-
| |
− | |}
| |
| | | |
− | === Why not <code>#titleparts</code>? ===
| + | {{Card gallery|region=PT| |
− | {{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}} }} | lang=html | 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-PT038; 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=SP| |
− | <!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
| + | PHHY-SP038; Photon Hypernova; UR; 1E |
− | [[Category:Templates]]
| + | }} |
− | </includeonly>
| + | |
| + | {{Card gallery|region=JP| |
| + | PHHY-JP038; Photon Hypernova ::OP |
| + | PHHY-JP038; Photon Hypernova; SR |
| + | 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 |
| + | }} |