Template:GetUser/doc

From OIAr
Revision as of 20:24, 29 March 2013 by Jan Schoonderbeek (talk | contribs) (doc added)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This template takes a single non-named parameter and determine which user it is referring to. To this end, the template assumes that the provided parameter is

a) a display name, such as users are supposed to set on their user page using property [[Displayname::]], or
b) a user login name.

This template produces NO output, but after it has been called, there will exist two variables that you can use as you please:

{{#var|displayname}} will contain the user's display name (or the given parameter surrounded by question marks)
{{#var|userpage}} will contain the user's userpage without the User: prefix (or the string "Unknown").

This makes it possible to construct nice links such as [[User:{{#var:userpage}}|{{#var:displayname}}]]

Suppose there's a user "John Doe" with userpage User:John Doe, on which is defined [[displayname::John F. Doe]], and suppose that user Yohn Doe does not exist (it's a typo). Then

{{GetUser|John Doe}} results in {{#var|displayname}} = John F. Doe and {{#var|userpage}} = John Doe
{{GetUser|John F. Doe}} results in {{#var|displayname}} = John F. Doe and {{#var|userpage}} = John Doe
{{GetUser|Yohn Doe}} results in {{#var|displayname}} = ?Yohn Doe? and {{#var|userpage}} = Unknown