Difference between revisions of "Template:Lowercase"

From The iPhone Wiki
Jump to: navigation, search
(Note: wrong placement)
m (with the addition of parser functions, we dont need the ns= or 1= crap, we can now check if there is a namespace)
Line 1: Line 1:
<includeonly>{{DISPLAYTITLE:{{{ns|{{{1|}}}}}}{{lcfirst:{{PAGENAME}}}}}}</includeonly><noinclude>
+
{{DISPLAYTITLE:{{#if:{{NAMESPACE|{{{ns|{{{1|}}}}}}}}|{{NAMESPACE|{{{ns|{{{1|}}}}}}}}:|}}{{lcfirst:{{PAGENAME}}}}}}<noinclude>
 
Lowercases the title of a page.
 
Lowercases the title of a page.
 
== Usage ==
 
== Usage ==
 
(Top of page)
 
(Top of page)
<nowiki>{{lowercase|ns=namespace plus colon}}</nowiki>
+
<nowiki>{{lowercase}}</nowiki>
 
(text)
 
(text)
 
(bottom of page)
 
(bottom of page)
  +
Simple, right? For pages with a title that is not a namespace (ex Tutorial:), we need to do:
Simple, right?
 
  +
<nowiki>{{lowercase|ns=Tutorial:}}</nowiki>
   
 
== Examples ==
 
== Examples ==
Line 12: Line 13:
 
Page Name: IPod
 
Page Name: IPod
 
<nowiki>{{lowercase}}</nowiki>
 
<nowiki>{{lowercase}}</nowiki>
Try: iPod<br />
+
Result: iPod
True Result: iPod
 
 
=== Ex 2 ===
 
=== Ex 2 ===
 
Page Name: Help:Contents
 
Page Name: Help:Contents
 
<nowiki>{{lowecase}}</nowiki>
 
<nowiki>{{lowecase}}</nowiki>
  +
Result: Help:Contents
Try: contents<br />
 
True Result: Help:Contents<br />
 
'''''NOTE:''' This does not work as DISPLAYTITLE only works with lowercasing the first letter in the title''
 
=== Ex 3 ===
 
Page: Help:Contents
 
<nowiki>{{lowercase|Help:}}</nowiki>
 
Try Name: Help:contents<br />
 
True Result: Help:contents
 
 
== Note ==
 
'''This contains content that n00bs may not understand'''
 
 
This template does not natively work on pages other than the main namespace as [http://mediawiki.org/wiki/Help:ParserFunctions Parser Functions] are not installed on this wiki. Here is a comparison of the [[wikipedia:Template:lowercase|wikipedia]] version and this version: (parser function bolded) (red is removed in this stripped down version and green is added in this version)
 
 
<nowiki>{{DISPLAYTITLE:</nowiki>'''<font color="red"><nowiki>{{#if:{{NAMESPACE|}}|{{NAMESPACE|}}:}}</nowiki>'''</font><nowiki>{{lcfirst:{{PAGENAME}}}}}}</nowiki>
 
 
<nowiki>{{DISPLAYTITLE:</nowiki><font color="green"><nowiki>{{ns|}}</nowiki></font><nowiki>{{lcfirst:{{PAGENAME}}}}}}</nowiki>
 
 
That checks if there is a namespace and if yes, display it with a colon, otherwise display nothing.
 

Revision as of 23:05, 17 July 2011

Lowercases the title of a page.

Usage

(Top of page)
{{lowercase}}
(text)
(bottom of page)

Simple, right? For pages with a title that is not a namespace (ex Tutorial:), we need to do:

{{lowercase|ns=Tutorial:}}

Examples

Ex 1

Page Name: IPod

{{lowercase}}

Result: iPod

Ex 2

Page Name: Help:Contents

{{lowecase}}

Result: Help:Contents