Template:Pagename

From Lotro-Wiki.com
Jump to navigation Jump to search


This is the template documentation for {{Pagename}}. It is transcluded from Template:Pagename/doc and may be directly edited there.

Usage

{{PAGENAME}} is not actually a template, but instead is a magic word, meaning it is a feature of the MediaWiki software. When used, it will return the name of the page it's on, but without the namespace. As an example, when placed on this page, it returns Pagename. It is possible to specify which pagename will appear by using a colon (not a pipe as is typical for templates). As an example, {{PAGENAME:Lotro-Wiki.com:Ninjas}} returns Ninjas.

There is actual template code here. The purpose of the template code is to ensure that if someone uses this magic word with a piped parameter, the template code will be invoked and it will not cause an error on the page. Parameter 1 will be used as the : parameter and other parameters will be discarded. This way, if someone mistakenly enters {{PAGENAME|Lotro-Wiki.com:Ninjas}}, the template will change it to the correct {{PAGENAME:Lotro-Wiki.com:Ninjas}}