Editing Template:Link/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:
-
#REDIRECT [[Template:Link/Desc/Doc]]
+
This template is used to create a link to a page.
 +
 
 +
It's purpose is very similar to creating links with double square brackets.
 +
 
 +
The benefit of using <code>{{((}}link|</code> is that if a description is not provided
 +
the link defaults to the description the page provides by using [[Template:desc]], etc.
 +
 
 +
Just like with double square brackets, if you have preferred text for the link, you can provide it.
 +
 
 +
 
 +
For illustration, suppose we have two pages:
 +
* "[[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.
 +
 
 +
{{demo table|
 +
{{demo row|<nowiki>{{link|Demo/Page with description}}</nowiki>|<!--
 +
-->{{link|Demo/Page with description}} }}
 +
{{demo row|<nowiki>{{link|Demo/Page without description}}</nowiki>|<!--
 +
-->{{link|Demo/Page without description}} }}
 +
{{demo row|<nowiki>{{link|Demo/Page with description|this page}}</nowiki>|<!--
 +
-->{{link|Demo/Page with description|this page}} }}
 +
{{demo row|<nowiki>{{link|Demo/Page without description|this page}}</nowiki>|<!--
 +
-->{{link|Demo/Page without description|this page}} }}
 +
}}
 +
 
 +
Here's how it would work if you had used square brackets instead:
 +
{{demo table|
 +
{{demo row|[[Demo/Page with description]]}}
 +
{{demo row|[[Demo/Page without description]]}}
 +
{{demo row|[[Demo/Page with description|this page]]}}
 +
{{demo row|[[Demo/Page without description|this page]]}}
 +
}}
 +
The difference is only in the first case.

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