Template:Link/Create+Desc

From PCSAR

(Difference between revisions)
Jump to: navigation, search
(New page: <noinclude>{{documentation}}</noinclude><includeonly><!-- Do we have to use Parameter to index.php? We want to avoid them because redlink handling is different in internal links than ext...)
Current revision (13:34, 18 July 2012) (edit) (undo)
 
Line 1: Line 1:
<noinclude>{{documentation}}</noinclude><includeonly><!--
<noinclude>{{documentation}}</noinclude><includeonly><!--
-
Do we have to use Parameter to index.php? We want to avoid them because redlink handling is different
+
-->{{Link/Create/Core|1={{{1}}}|2={{Link/Desc/Text|1={{{1|}}}|2={{{2|}}}|Desc={{{Desc|}}}}}|Preload={{{Preload|}}}|Editintro={{{Editintro|}}}|Internal={{Link/Desc|1={{{1|}}}|2={{{2|}}}|Desc={{{Desc|}}}}}}}<!--
-
in internal links than external links. Although we try to make it look as close to the original as
+
-
possible, it's not quite.
+
-
* red links that have been visited don't get a faded colour.
+
-
* hovering over an external link underlines it in blue, even if it's a red link.
+
-
* The red we chose ignores the user's preference of stylesheet, etc.
+
-
 
+
-
http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#Options_affecting_the_edit_form
+
-
 
+
-
-->{{#if: {{{Preload|}}}{{{Editintro|}}}<!--
+
-
 
+
-
-->|<!--
+
-
 
+
-
We were given index.php parameters
+
-
 
+
-
-->{{#ifexist: {{{1}}}<!--
+
-
 
+
-
-->|<!--
+
-
 
+
-
The page exists, we don't need the index.php parameters; use an internal link.
+
-
 
+
-
-->{{Link/Desc|1={{{1|}}}|2={{{2|}}}|Desc={{{Desc|}}}}}<!--
+
-
 
+
-
-->|<!--
+
-
 
+
-
We have to use index.php parameters to a non-existing page.
+
-
Use an external link, but make it look as much like an internal link as we can.
+
-
 
+
-
Don't paint the external link fancy (no arrow).
+
-
 
+
-
--><span class="plainlinks"><!--
+
-
 
+
-
Create the external link
+
-
 
+
-
-->[<!--
+
-
 
+
-
The URL marked up with parameters.
+
-
Parameters that aren't specified will be blank which defaults to no action.
+
-
 
+
-
-->{{fullurl:{{{1}}}|action=edit&preload={{{Preload|}}}&editintro={{{Editintro|}}}}}<!--
+
-
 
+
-
A space separates the URL from the link text
+
-
 
+
-
--> <!--
+
-
 
+
-
Paint the link red.
+
-
 
+
-
--><span style="color: #ba0000;"><!--
+
-
 
+
-
Compute what text to display.
+
-
 
+
-
-->{{Link/Desc/Text|1={{{1|}}}|2={{{2|}}}|Desc={{{Desc|}}}}}<!--
+
-
 
+
-
--></span><!--
+
-
 
+
-
-->]<!--
+
-
 
+
-
--></span><!--
+
-
 
+
-
-->}}<!--
+
-
 
+
-
-->|<!--
+
-
 
+
-
There were no index.php parameters; we can use an internal link.
+
-
 
+
-
-->{{Link/Desc|1={{{1|}}}|2={{{2|}}}|Desc={{{Desc|}}}}}<!--
+
-
 
+
-
-->}}<!--
+
--></includeonly>
--></includeonly>

Current revision

This is the documentation for the template Template:Link/Create+Desc

Template:Link/Create+Desc/Doc:
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/Create+Desc|Page|Text|Desc=description|Preload=boilerplate|Editintro=intro}} 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.
Preload 
(optional) When Page does not exist, following the link will create it with the page boilerplate already loaded into the editor.
Editintro 
(optional) When Page does not exist, following the link will display the page intro before the edit window rather than the normal instructions

This template supports the functionality of both {{Link/Desc}} and {{Link/Create}}.

[edit] Implementation

Helper templates:


To see how this template is implemented, edit this page and examine the portion between <includeonly> and </includeonly>.

Personal tools