Editing Template:Link/Desc/Doc

From PCSAR

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Current revision Your text
Line 1: Line 1:
{{Template:Link/Doc/Related}}
{{Template:Link/Doc/Related}}
-
This template creates a link to another wiki page.
 
-
== Common usage ==
 
-
Most commonly this template is called as
 
-
<code>{{((}}link|Page{{))}}</code>.
 
-
In the form
 
-
<code>{{((}}link|Page|Text{{))}}</code>
 
-
it creates a link to Page but displays the link as Text.
 
-
 
-
{{demo table|
 
-
{{demo row|<nowiki>{{link|Main Page}}</nowiki>|<!--
 
-
-->{{link|Main Page}} }}
 
-
{{demo row|<nowiki>{{link|Main Page|see this page}}</nowiki>|<!--
 
-
-->{{link|Main Page|see this page}} }}
 
-
}}
 
-
 
-
It is also commonly used to provide links to file descriptor pages.
 
-
See [[Help:Linking to files]].
 
-
{{demo table|
 
-
{{demo row|<nowiki>{{link|Image:Demo Sunflower.png}}</nowiki>|<!--
 
-
-->{{link|Image:Demo Sunflower.png}} }}
 
-
}}
 
-
 
-
 
-
<code>{{((}}link{{))}}</code>
 
-
is an alternative shortened name for
 
-
<code>{{((}}Link/Desc{{))}}</code>.
 
-
Either can be used.
 
-
 
-
== Features ==
 
-
This template is similar to creating a link with double square brackets:
 
-
<code><nowiki>[[Page]]</nowiki></code>.
 
-
 
-
Double square brackets requires extra decoration with a leading colon when the page
 
-
is an <code>Image:</code>, <code>File:</code> or <code>Category:</code>.
 
-
This template handles those types of pages without any extra work; no leading colon is necessary.
 
-
 
-
If no Text is provided, the link is shown as the Page name.
 
-
For subpages (e.g. <code>Main Topic/subtopic</code>)
 
-
the link text is just the subtopic.
 
-
 
-
The page can have a description and that description will be displayed as the text of the link.
 
-
The description is taken from the [[Property:Page description]]
 
-
which can be set using [[Template:desc]], etc.
 
-
 
-
The link can lead to a previous version of a wiki page, using the parameter RevisionID.
 
-
 
-
For multipage PDF's the link can lead to a specific page, using the parameter PageNum.
 
-
 
-
As [[Template:Link/Create]] or [[Template:Link/Create+Desc]], links to pages that don't exist yet can specify default text for their creation.
 
-
 
-
== Parameters ==
 
{{Template doc|<nowiki>Page|RevisionID=id|PageNum=number|Text|Desc=description</nowiki>}}
{{Template doc|<nowiki>Page|RevisionID=id|PageNum=number|Text|Desc=description</nowiki>}}
-
uses the following parameters:
+
is used to create a link to a page.
; Page : the page to link to
; Page : the page to link to
Line 59: Line 8:
; Text : (optional) the text to display as the link
; Text : (optional) the text to display as the link
; Desc : (optional) the text to display as the link if the page does not have a description and ''Text'' is not supplied. There is no point to specifying both ''Text'' and ''Desc''.
; Desc : (optional) the text to display as the link if the page does not have a description and ''Text'' is not supplied. There is no point to specifying both ''Text'' and ''Desc''.
-
== Examples ==
+
 
 +
This template's purpose is very similar to creating links with double square brackets.
 +
The benefit of using <code>{{((}}Link/Desc|</code>
 +
is that, the page itself may specify a description using [[Template:desc]], etc.
 +
(Using the [[Property:Page description]].)
 +
That description can be displayed as the link text.
 +
Just like with double square brackets, if you have preferred text for the link, you can provide it.
 +
While ''Text'' is higher priority than the page's own description,
 +
''Desc'' is lower priority.
 +
 
For illustration purpose, the following demonstration pages have been set up:
For illustration purpose, the following demonstration pages have been set up:
* "[[Demo/Page with description]]" uses [[Template:desc]] to define a description.
* "[[Demo/Page with description]]" uses [[Template:desc]] to define a description.

Please note that all contributions to PCSAR are considered to be released under the Attribution-Share Alike 3.0 Unported (see PCSAR:Copyrights for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!


Cancel | Editing help (opens in new window)
Personal tools