Template:Link/Desc/Doc

From PCSAR

Revision as of 06:24, 18 July 2012 by Brett Wuth (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
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:


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:

Personal tools