Difference between revisions of "Template:Lowercase title/doc"

From blackwiki
Jump to navigation Jump to search
imported>Wiki-vr
imported>Gonnym
(doc update)
 
(90 intermediate revisions by 69 users not shown)
Line 1: Line 1:
<includeonly>{{template doc page transcluded}}</includeonly><noinclude>{{template doc page viewed directly}}</noinclude>
+
{{See also|Template:Nocaps}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
+
{{Documentation subpage}}
'''<span style="font-size:1.3em">Attention: Please do not [[WP:SUBST|Subst:]] this template.</span>'''
+
{{High-use}}
 +
{{No substitution}}
 +
{{TOC right}}
  
==Usage==
+
== Usage ==
This template uses the magic word DISPLAYTITLE to decapitalise the first letter of the name of a page it's transcluded on. (Previously, this template achieved this using JavaScript, but the DISPLAYTITLE method makes the change for all users, even those with JavaScript disabled).
+
Simply add the tag <code><nowiki>{{lowercase title}}</nowiki></code> at the beginning of a page (and optionally, at the beginning of its talk page). There are no parameters. The tag will only decapitalize the first letter of the page's name in the title at the beginning of the page. Examples:
  
== See also ==
+
{| class="wikitable"
* {{tl|Wrongtitle}}
+
|-
 +
! scope="col" | Page name
 +
! scope="col" | Will display
 +
|-
 +
! scope="row" | [[EBay]], [[IPod]], etc.
 +
| eBay, iPod, etc.
 +
|-
 +
! scope="row" | [[Talk:EBay]]
 +
| Talk:eBay
 +
|}
 +
 
 +
== Issues ==
 +
The template does '''not''' work together with other title modification templates: you need to use DISPLAYTITLE directly and make sure it's the last DISPLAYTITLE on the page. For example, to make "Example" italic and lowercase, use <code><nowiki>{{DISPLAYTITLE:''example''}}</nowiki></code>.
 +
 
 +
When using the template on redirect pages, the template must be moved ''after'' the redirect, since otherwise it will break the redirection. This, however, limits the template to have an effect only when viewing the redirect page directly. Nevertheless, it is still useful in this scenario in order to document the proper capitalization of a term.
 +
 
 +
When using on templates, please make sure to wrap it with a &lt;noinclude&gt; tag, so that transcluded pages don't get affected.
 +
 
 +
== Technical ==
 +
This template wraps the [[Help:Magic words|magic word]] DISPLAYTITLE so that it works automatically in any namespace (main, talk, template, etc.) to decapitalise the first letter of the name of a page it is transcluded on.
 +
 
 +
<syntaxhighlight lang=sql>
 +
/* Page using a lowercase title, with or without {{lowercase}} */
 +
SELECT page_title, pp_value AS displaytitle
 +
FROM page
 +
JOIN page_props ON pp_page=page_id AND pp_propname="displaytitle"
 +
WHERE page_namespace=0
 +
AND CONVERT(pp_value USING utf8mb4) COLLATE utf8mb4_bin /* &#greek; */
 +
    REGEXP "^([_ :]+|<[^<>]+>)*([[:lower:]]|&#9[4-6][0-9];)"
 +
</syntaxhighlight>
  
<includeonly>
+
==TemplateData==
<!-- ADD CATEGORIES BELOW THIS LINE -->
+
{{TemplateData header}}
[[Category:Wrong title templates|Lowercase]]
+
<templatedata>
 +
{
 +
"params": {},
 +
"description": "This template is used to make the first letter of the page title lowercase. It will not affect the page URL, just the displayed name."
 +
}
 +
</templatedata>
  
<!-- ADD INTERWIKIS BELOW THIS LINE -->
+
== See also ==
[[bg:Шаблон:С малка буква]]
+
* [[Wikipedia:Naming conventions (technical restrictions)#Lowercase first letter]]
[[de:Vorlage:Kleinbuchstabe]]
+
{{WrongTitleExamples}}
[[es:Plantilla:Título minúscula]]
 
[[ia:Patrono:Minuscula]]
 
[[ja:Template:小文字]]
 
[[nl:Sjabloon:Kleine letter]]
 
[[no:Mal:Liten forbokstav]]
 
[[pl:Szablon:małą literą]]
 
[[ro:Format:iniţialămică]]
 
[[ru:Шаблон:Заголовок со строчной буквы]]
 
[[sq:Stampa:Shkronja të vogël]]
 
[[sl:Predloga:Mala začetnica]]
 
[[sv:Mall:Liten begynnelsebokstav]]
 
[[vi:Tiêu bản:lowercase]]
 
[[zh-yue:Template:細楷]]
 
  
</includeonly>
+
<includeonly>{{Sandbox other||
 +
[[Category:Correct title templates]]
 +
}}</includeonly>

Latest revision as of 11:06, 19 October 2020

Usage

Simply add the tag {{lowercase title}} at the beginning of a page (and optionally, at the beginning of its talk page). There are no parameters. The tag will only decapitalize the first letter of the page's name in the title at the beginning of the page. Examples:

Page name Will display
EBay, IPod, etc. eBay, iPod, etc.
Talk:EBay Talk:eBay

Issues

The template does not work together with other title modification templates: you need to use DISPLAYTITLE directly and make sure it's the last DISPLAYTITLE on the page. For example, to make "Example" italic and lowercase, use {{DISPLAYTITLE:''example''}}.

When using the template on redirect pages, the template must be moved after the redirect, since otherwise it will break the redirection. This, however, limits the template to have an effect only when viewing the redirect page directly. Nevertheless, it is still useful in this scenario in order to document the proper capitalization of a term.

When using on templates, please make sure to wrap it with a <noinclude> tag, so that transcluded pages don't get affected.

Technical

This template wraps the magic word DISPLAYTITLE so that it works automatically in any namespace (main, talk, template, etc.) to decapitalise the first letter of the name of a page it is transcluded on.

/* Page using a lowercase title, with or without {{lowercase}} */
SELECT page_title, pp_value AS displaytitle
FROM page
JOIN page_props ON pp_page=page_id AND pp_propname="displaytitle"
WHERE page_namespace=0
AND CONVERT(pp_value USING utf8mb4) COLLATE utf8mb4_bin /* &#greek; */
    REGEXP "^([_ :]+|<[^<>]+>)*([[:lower:]]|&#9[4-6][0-9];)"

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Lowercase title

This template is used to make the first letter of the page title lowercase. It will not affect the page URL, just the displayed name.

Template parameters

ParameterDescriptionTypeStatus
No parameters specified

See also

Template:WrongTitleExamples