Template:Unsigned/testcases

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
This is the template test case page for Template:Unsigned and its sandbox version. You may have to purge this page to update the examples.

Correct

Username and date (two anonymous parameters)
Wiki code
{{subst:Unsigned|User|2024-05-14}}
Main version
— The preceding unsigned comment was added by User (talkcontribs) 2024-05-14
Sandbox version


Username only (one anonymous parameter)
Wiki code
{{subst:Unsigned|User}}
Main version
— The preceding unsigned comment was added by User (talkcontribs)
Sandbox version


↑ This is OK, but it's really better to provide a date, as in the previous example.


When the username contains an equal sign (using 1= and 2=)
Wiki code
{{subst:Unsigned|1=User{{=}}name|2=2024-05-14}}
Main version
— The preceding unsigned comment was added by User=name (talkcontribs) 2024-05-14
Sandbox version


↑ If 1= is used, then the date must be specified using 2= or omitted completely.


Showing something other than the date (two anonymous parameters)
Wiki code
{{subst:Unsigned|User|— oops)}}
Main version
— The preceding unsigned comment was added by User (talkcontribs) — oops
Sandbox version


↑ There might not be any good reason to use anything but the date in the second position.


Dating a signed comment (using unsigned=undated)
Wiki code
{{subst:Unsigned|User|2024-05-14|unsigned=undated}}
Main version
— The preceding undated comment was added by User (talkcontribs) 2024-05-14
Sandbox version


Hiding the word "unsigned" (empty value for unsigned)
Wiki code
{{subst:Unsigned|User|2024-05-14|unsigned=}}
Main version
— The preceding comment was added by User (talkcontribs) 2024-05-14
Sandbox version


↑ This is useful when a comment has been "manually" signed using plain text.


Suppressing the link on the word "unsigned" (using unsigned=unsigned)
Wiki code
{{subst:Unsigned|User|2024-05-14|unsigned=unsigned}}
Main version
— The preceding unsigned comment was added by User (talkcontribs) 2024-05-14
Sandbox version


Incorrect

No parameters (exposes raw wikicode)
Wiki code
{{subst:Unsigned}}
Main version
— The preceding unsigned comment was added by [[User:{{{1}}}|{{{1}}}]] ([[User talk:{{{1}}}|talk]] • [[Special:Contributions/{{{1}}}|contribs]])
Sandbox version


Only second anonymous parameter (exposes raw wikicode)
Wiki code
{{subst:Unsigned||2024-05-14}}
Main version
— The preceding unsigned comment was added by [[User:|]] ([[User talk:|talk]] • contribs) 2024-05-14
Sandbox version


Three anonymous parameters (no error, but not supported)
Wiki code
{{subst:Unsigned|User|2024-05-14|radical!}}
Main version
— The preceding unsigned comment was added by User (talkcontribs) 2024-05-14
Sandbox version