Template:Links-core
{{#if:|template:foo}} ( {{#if:|talk}} {{#if:|edit}} {{#if:|watch}} {{#if:|{{#ifeq:template|user|[[:Special:Contributions/{{#titleparts:foo|1}}|contribs]]}}}} {{#if:|history}} {{#if:|links}} {{#if:|logs}} {{#if:|localspace}} {{#if:|delete}} {{#if:|{{#ifeq:template|user|[[:Special:Blockip/{{#titleparts:foo|1}}|block]]}}}} )
Documentation
Usage
This template is not intended to be used directly. It contains the complex programming for custom link templates which can selectively show relevant links. For example, {{links-core||template|foo|talk=1}}
will only output a link to the talk page.
The syntax is:
{{links-core|interwiki prefix (blank for current wiki)|namespace|page name|named option}}
Referring to the table of options below, a new links template can be created by adding "1" (or any value) beside the desired link options.
{{links-core |1 = {{#if:{{{3|}}}|{{{1|}}}}} |2 = {{#if:{{{3|}}}|{{{2|template}}}|{{{1|template}}}}} |3 = {{#if:{{{3|}}}|{{{3|foo}}}|{{{2|foo}}}}} |link = |talk = |edit = |watch = |history = |whatlinkshere = |logs = |localspace = |delete = |contribs = |block = }}
The following link options are possible:
Parameter | Example & notes |
---|---|
All namespaces | |
link | "template:foo"; a link to the relevant page. |
talk | "talk"; a link to the associated talk page (will not work correctly if the template is used for a talk page). |
edit | "edit"; a link to the edit mode for that page. |
watch | "watch"; click to watch the page. |
history | "history"; link to the edit log for that page. |
whatlinkshere | "links"; link to list of incoming links for that page. |
logs | "logs"; link to all logs for the current page. |
localspace | "localspace"; link to list of subpages. |
delete | "delete"; link to delete form with the page title filled in. |
User namespace | |
contribs | "contributions"; link to the user's edit log. |
block | "block"; link to the block form with the user name filled in. |
See also
- Shortcut templates
- {{#if:1|[[{{#if:|template}}:{{#if:|links|template}}:{{#if:|foo|links}}]]}} ( {{#if:1|[[{{#if:|template}}:{{#if:|links|template}} talk:{{#if:|foo|links}}|talk]]}} {{#if:1|[{{fullurl:{{#if:|template}}:{{#if:|links|template}}:{{#if:|foo|links}}|action=edit}} edit]}} {{#if:|[{{fullurl:{{#if:|template}}:{{#if:|links|template}}:{{#if:|foo|links}}|action=watch}} watch]}} {{#if:|{{#ifeq:{{#if:|links|template}}|user|[[{{#if:|template}}:Special:Contributions/{{#titleparts:{{#if:|foo|links}}|1}}|contribs]]}}}} {{#if:1|[{{fullurl:{{#if:|template}}:{{#if:|links|template}}:{{#if:|foo|links}}|action=history}} history]}} {{#if:1|[{{fullurl:{{#if:|template}}:Special:Whatlinkshere/{{#if:|links|template}}:{{#if:|foo|links}}|limit=1000}} links]}} {{#if:|[{{fullurl:{{#if:|template}}:Special:Log|page=%7B%7B%23if%3A%7Clinks%7Ctemplate%7D%7D%3A%7B%7B%23if%3A%7Cfoo%7Clinks%7D%7D}} logs]}} {{#if:|[[{{#if:|template}}:Special:Prefixindex/{{#if:|links|template}}:{{#if:|foo|links}}|localspace]]}} {{#if:|[{{fullurl:{{#if:|template}}:{{#if:|links|template}}:{{#if:|foo|links}}|action=delete}} delete]}} {{#if:|{{#ifeq:{{#if:|links|template}}|user|[[{{#if:|template}}:Special:Blockip/{{#titleparts:{{#if:|foo|links}}|1}}|block]]}}}} )
- {{#if:1|[[{{#if:|template}}:{{#if:|links-small|template}}:{{#if:|foo|links-small}}]]}} ( {{#if:1|[[{{#if:|template}}:{{#if:|links-small|template}} talk:{{#if:|foo|links-small}}|talk]]}} {{#if:1|[{{fullurl:{{#if:|template}}:{{#if:|links-small|template}}:{{#if:|foo|links-small}}|action=edit}} edit]}} {{#if:|[{{fullurl:{{#if:|template}}:{{#if:|links-small|template}}:{{#if:|foo|links-small}}|action=watch}} watch]}} {{#if:|{{#ifeq:{{#if:|links-small|template}}|user|[[{{#if:|template}}:Special:Contributions/{{#titleparts:{{#if:|foo|links-small}}|1}}|contribs]]}}}} {{#if:1|[{{fullurl:{{#if:|template}}:{{#if:|links-small|template}}:{{#if:|foo|links-small}}|action=history}} history]}} {{#if:1|[{{fullurl:{{#if:|template}}:Special:Whatlinkshere/{{#if:|links-small|template}}:{{#if:|foo|links-small}}|limit=1000}} links]}} {{#if:|[{{fullurl:{{#if:|template}}:Special:Log|page=%7B%7B%23if%3A%7Clinks-small%7Ctemplate%7D%7D%3A%7B%7B%23if%3A%7Cfoo%7Clinks-small%7D%7D}} logs]}} {{#if:|[[{{#if:|template}}:Special:Prefixindex/{{#if:|links-small|template}}:{{#if:|foo|links-small}}|localspace]]}} {{#if:|[{{fullurl:{{#if:|template}}:{{#if:|links-small|template}}:{{#if:|foo|links-small}}|action=delete}} delete]}} {{#if:|{{#ifeq:{{#if:|links-small|template}}|user|[[{{#if:|template}}:Special:Blockip/{{#titleparts:{{#if:|foo|links-small}}|1}}|block]]}}}} )