Jump to content

Template:Page link/doc: Difference between revisions

From The Austrian Economics Wiki, the global repository of classical-liberal thought
m Usage: note
m update for parameter switch
 
Line 3: Line 3:
This template is used to create links to pages in the '''Page''' namespace, while preventing those links from appearing in the '''Main''' namespace.  Its primary use is in the tables of contents of books.
This template is used to create links to pages in the '''Page''' namespace, while preventing those links from appearing in the '''Main''' namespace.  Its primary use is in the tables of contents of books.


<code><nowiki>{{</nowiki>page link|''text to display''|''link target''<nowiki>}}</nowiki></code>
<code><nowiki>{{</nowiki>page link|''link target''|''text to display''<nowiki>}}</nowiki></code>


The link target must be in the Page namespace.
The link target must be in the Page namespace.


===Example===
===Example===
For example, <code><nowiki>{{</nowiki>page link|page 9|Marxism Unmasked.pdf/9<nowiki>}}</nowiki></code> gives:
For example, <code><nowiki>{{</nowiki>page link|Marxism Unmasked.pdf/9|page 9<nowiki>}}</nowiki></code> gives:
*In the main namespace: page 9
*In the main namespace: page 9
*In the page namespace: <span align="right"><!--
*In the page namespace: {{page link|Marxism Unmasked.pdf/9|page 9}}
 
If in the main namespace, show only parameter 1.  Otherwise, show a link, where parameter 2 is the page namespace target of the link.
-->{{#ifeq:{{NAMESPACE}}||page 9|[[Page:Marxism Unmasked.pdf/9|page 9]]}}</span>


Note that "Page:" should not be included in the link target.
Note that "Page:" should not be included in the link target.

Latest revision as of 23:06, 10 March 2011

Usage

This template is used to create links to pages in the Page namespace, while preventing those links from appearing in the Main namespace. Its primary use is in the tables of contents of books.

{{page link|link target|text to display}}

The link target must be in the Page namespace.

Example

For example, {{page link|Marxism Unmasked.pdf/9|page 9}} gives:

  • In the main namespace: page 9
  • In the page namespace: page 9

Note that "Page:" should not be included in the link target.