Template:Ln/doc

From the AARoads Wiki: Read about the road before you go
Jump to navigation Jump to search

About

This template and the other related templates listed below produce a series of links for a specified page that is generally, though not always, of the form:

Page (edit | talk | history | links | watch | logs)

The six links are:

editedit the page;
talk/subject – access its talk page (or if the target page is a talk page, its subject page);
history – access its edit history;
links – access the what links here feature;
watch – add the page to one's watchlist; and
log – access its logs.

The major difference between the templates is the namespace of the page to which it is applied.

  • General:
    • [[Template:]]  creates links for any page in any namespace.
    • [[Template:]]  creates links for pages in any subject namespace.
    • [[Template:]]  creates links for pages in any talk namespace.

Usage

Namespace Link to subject page Link to talk page
General {{pagelinks|FULL PAGE NAME}}
Same as for subject page
{{ln|NAMESPACE|PAGE NAME}} {{lnt|NAMESPACE|PAGE NAME}}
Article {{la|ARTICLE}} {{lat|ARTICLE}}
Template {{lt|TEMPLATE}} {{ltt|TEMPLATE}}
AARoads {{lw|PAGE}} {{lwt|PAGE}}
User {{lu|PAGE}} {{lut|PAGE}}[1]
Category {{lc|PAGE}} {{lct|PAGE}}
File {{lf|FILE}} {{lft|FILE}}
MediaWiki {{lm|MESSAGE}} {{lmt|MESSAGE}}
Module {{lmd|MODULE}} {{lmdt|MODULE}}
  1. ^ For a similar template for user accounts, see Template:user

Examples

Code Result
{{pagelinks|Category:Example}} Category:Example (edit | talk | history | links | watch | logs)
{{pagelinks|Category talk:Example}} Category talk:Example (edit | subject | history | links | watch | logs)
{{ln|Category|Example}} [[:Category:]] 
{{lnt|Category|Example}} [[Category talk:]] 
{{la|Example}} Example (edit | talk | history | protect | delete | links | watch | logs | views)
{{lat|Example}} [[Talk:]] 
{{lt|Deprecated template}} [[Template:]] 
{{ltt|Deprecated template}} [[Template talk:]] 
{{lu|Example}} [[User:]] 
{{lut|Example}} [[User talk:]] 
{{lw|About}} [[AARoads:]] 
{{lwt|About}} [[AARoads talk:]] 
{{lc|Stubs}} [[:Category:]] 
{{lct|Stubs}} [[Category talk:]] 
{{lm|Common.css}} [[MediaWiki:]] 
{{lmt|Common.css}} [[MediaWiki talk:]] 

{{subst:ln|Category|Stubs}} results (or resulted) in this code:

{{lx|1=:{{ucfirst:Category}}:|2={{ucfirst:Stubs}}|3=:Category talk|4=talk}}

Note the important colon in 1=:, unnecessary (?) for other Lx namespaces.
Substituting both Lx and Ucfirst finally arrived at (line breaks added manually):

 <span class="plainlinksneverexpand">[[:Category:Stubs]] <tt>(</tt>
 [{{fullurl::Category:Stubs|action=edit}} edit]<tt>|</tt>
 [[w::Category talk:Stubs|talk]]<tt>|</tt>
 [{{fullurl:Special:Whatlinkshere/:Category:Stubs|limit=999}} links]<tt>|</tt>
 [{{fullurl::Category:Stubs|action=history}} history]<tt>|</tt>
 [{{fullurl::Category:Stubs|action=watch}} watch]<tt>)</tt></span>

See also

Template Example output
{{c}} Example
{{cl}} Category:Example
{{cls}} Cat:Example
Template Example output
{{cconly}} 0
{{clc}} Category:Example (0)
{{lc}} [[:Category:]] 
{{lcs}} Category:Example(edit talk links history)


TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Ln in articles based on its TemplateData.

TemplateData for Ln

<templatedata> { "params": { "1": { "description": "Name of the target page.", "type": "wiki-page-name", "required": true } }, "description": "Produces a series of links for a specified page." } </templatedata>