Template:Link/Desc/Doc
From PCSAR
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|Text|Desc=description}}
is used to create a link to a page.
- Page
- the page to link to
- Text
- (optional) the text to display as the link
- Desc
- (optional) the text to display as the link if the page does not 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|
is that, the page itself may specify a description using Template:desc, etc.
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 |
Implementation
Helper templates: