Template:Link/Desc/Doc
From PCSAR
(→Implementation) |
|||
Line 78: | Line 78: | ||
* [[Template:Link/Desc/CoreText]] | * [[Template:Link/Desc/CoreText]] | ||
Icons: | Icons: | ||
- | * {{link| | + | * {{link|Image:Calendar-miniscule-icon.png}} |
Revision as of 06:06, 18 September 2015
Related Templates | |
---|---|
Link/Create | Create from template |
Link/Desc | Use page's description |
Link/Create+Desc | Combine Link/Create and Link/Desc |
Link | Default; same as Link/Desc |
The template {{Link/Desc|Page|RevisionID=id|PageNum=number|Text|Desc=description}}
is used to create a link to a page.
- Page
- the page to link to
- RevisionID
- (optional) The revision to link to. This is used to link to an old version of an existing page. Revision ID's can be found on the "history" tab of the page in question, as "oldid". Revision ID's are unique across all pages, so the Revision ID also specifies the Page. If the Revision ID is provided, the Page does not need to be specified unless it is to provide the link text.
- PageNum
- (optional) if Page is a file that supports multiple internal pages, this parameter will link to the specified internal page
- 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.
This template's purpose is very similar to creating links with double square brackets.
The benefit of using {{Link/Desc|
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:
- "Demo/Page with description" uses Template:desc to define a description.
- "Demo/Page without description" doesn't use Template:desc and doesn't have a description.
You type... | You get... |
---|---|
{{Link/Desc|Demo/Page with description}} | Described page |
{{Link/Desc|Demo/Page without description}} | Page without description |
{{Link/Desc|Demo/Page with description|this page}} | this page |
{{Link/Desc|Demo/Page without description|this page}} | this page |
Here's how it would work if you had used square brackets instead. (The difference between this table and the previous one is only in the first case.)
You type... | You get... |
---|---|
[[Demo/Page with description]] | Demo/Page with description |
[[Demo/Page without description]] | Demo/Page without description |
[[Demo/Page with description|this page]] | this page |
[[Demo/Page without description|this page]] | this page |
Using Desc
:
You type... | You get... |
---|---|
{{Link/Desc|Demo/Page with description|Desc=this page}} | Described page |
{{Link/Desc|Demo/Page without description|Desc=this page}} | this page |
{{Link/Desc|Demo/Page with description|That Page|Desc=this page}} | That Page |
{{Link/Desc|Demo/Page without description|That Page|Desc=this page}} | That Page |
Using RevisionID
:
You type... | You get... |
---|---|
{{Link/Desc|RevisionID=1}} | link![]() |
{{Link/Desc|Main Page|RevisionID=1}} | Main Page![]() |
{{Link/Desc|Main Page|main|RevisionID=1}} | main![]() |
Using PageNum
:
You type... | You get... |
---|---|
{{Link/Desc|Main Page|PageNum=2}} | Main Page |
Implementation
Helper templates:
Icons: