Template:Link/Create/Core

From PCSAR

(Difference between revisions)
Jump to: navigation, search
(New page: <noinclude>{{documentation}}</noinclude><includeonly><!-- Do we have to use parameters to index.php? We want to avoid them because redlink appearance is different in internal links than ...)
Current revision (22:42, 22 November 2018) (edit) (undo)
(Undo revision 61195 by Brett Wuth (Talk))
 
(3 intermediate revisions not shown.)
Line 1: Line 1:
-
<noinclude>{{documentation}}</noinclude><includeonly><!--
+
<noinclude>{{documentation}}</noinclude><includeonly><noinclude>
-
 
+
;;;;;;;;;;;;
-
Do we have to use parameters to index.php? We want to avoid them because redlink appearance is different
+
;;;;;;;;;;;; Do we have to use parameters to index.php? We want to avoid them
-
in internal links than external links. Although we try to make it look as close to the original as
+
;;;;;;;;;;;; because redlink appearance is different in internal links than
-
possible, it's not quite.
+
;;;;;;;;;;;; external links. Although we try to make it look as close to the
-
* red links that have been visited don't get a faded colour.
+
;;;;;;;;;;;; original as possible, it's not quite.
-
* 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.
+
;;;;;;;;;;;; * red links that have been visited don't get a faded colour.
-
 
+
;;;;;;;;;;;; * hovering over an external link underlines it in blue, even if
-
http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#Options_affecting_the_edit_form
+
;;;;;;;;;;;; it's a red link.
-
 
+
;;;;;;;;;;;; * The red we chose ignores the user's preference of stylesheet,
-
-->{{#if: {{{Preload|}}}{{{Editintro|}}}<!--
+
;;;;;;;;;;;; etc.
-
 
+
;;;;;;;;;;;;
-
-->|<!--
+
;;;;;;;;;;;; http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#Options_affecting_the_edit_form
-
 
+
;;;;;;;;;;;;
-
We were given index.php parameters
+
</noinclude>{{#if: {{{Preload|}}}{{{Editintro|}}}<noinclude>
-
 
+
;;;;;;;;;;;;
-
-->{{#ifexist: {{{1}}}<!--
+
</noinclude>|<noinclude>
-
 
+
;;;;;;;;;;;;
-
-->|<!--
+
;;;;;;;;;;;; We were given index.php parameters
-
 
+
;;;;;;;;;;;;
-
The page exists, we don't need the index.php parameters; use an internal link.
+
</noinclude>{{#ifexist: {{{1}}}<noinclude>
-
 
+
;;;;;;;;;;;;
-
-->{{{Internal}}}<!--
+
</noinclude>|<noinclude>
-
 
+
;;;;;;;;;;;;
-
-->|<!--
+
;;;;;;;;;;;; The page exists, we don't need the index.php parameters; use an
-
 
+
;;;;;;;;;;;; internal link.
-
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.
+
</noinclude>{{{Internal}}}<noinclude>
-
 
+
;;;;;;;;;;;;
-
Don't paint the external link fancy (no arrow).
+
</noinclude>|<noinclude>
-
 
+
;;;;;;;;;;;;
-
--><span class="plainlinks"><!--
+
;;;;;;;;;;;; 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
-
Create the external link
+
;;;;;;;;;;;; link as we can.
-
 
+
;;;;;;;;;;;;
-
-->[<!--
+
;;;;;;;;;;;; Don't paint the external link fancy (no arrow).
-
 
+
;;;;;;;;;;;;
-
The URL marked up with parameters.
+
</noinclude>{{Plainlink<noinclude>
-
Parameters that aren't specified will be blank which defaults to no action.
+
;;;;;;;;;;;;
-
 
+
;;;;;;;;;;;; The URL marked up with parameters.
-
-->{{fullurl:{{{1}}}|action=edit&preload={{{Preload|}}}&editintro={{{Editintro|}}}}}<!--
+
;;;;;;;;;;;; Parameters that aren't specified will be blank which defaults to
-
 
+
;;;;;;;;;;;; no action.
-
A space separates the URL from the link text
+
;;;;;;;;;;;;
-
 
+
</noinclude>|{{fullurl:{{{1}}}<noinclude>
-
--> <!--
+
;;;;;;;;;;;;
-
 
+
</noinclude>|action=edit<noinclude>
-
Paint the link red.
+
;;;;;;;;;;;;
-
 
+
</noinclude>&preload={{{Preload|}}}<noinclude>
-
--><span style="color: #ba0000;"><!--
+
;;;;;;;;;;;;
-
 
+
</noinclude>&editintro={{{Editintro|}}}<noinclude>
-
What text to display.
+
;;;;;;;;;;;;
-
 
+
</noinclude>}}<noinclude>
-
-->{{{2}}}<!--
+
;;;;;;;;;;;;
-
 
+
;;;;;;;;;;;;
-
--></span><!--
+
</noinclude>|{{{2}}}<noinclude>
-
 
+
;;;;;;;;;;;;
-
-->]<!--
+
;;;;;;;;;;;; Paint the link red.
-
 
+
;;;;;;;;;;;;
-
--></span><!--
+
</noinclude>|Style=color: #ba0000;<noinclude>
-
 
+
;;;;;;;;;;;;
-
-->}}<!--
+
</noinclude>}}<noinclude>
-
 
+
;;;;;;;;;;;;
-
-->|<!--
+
</noinclude>}}<noinclude>
-
 
+
;;;;;;;;;;;;
-
There were no index.php parameters; we can use an internal link.
+
</noinclude>|<noinclude>
-
 
+
;;;;;;;;;;;;
-
-->{{{Internal}}}<!--
+
;;;;;;;;;;;; There were no index.php parameters; we can use an internal link.
-
 
+
;;;;;;;;;;;;
-
-->}}<!--
+
</noinclude>{{{Internal}}}<noinclude>
-
 
+
;;;;;;;;;;;;
-
--></includeonly>
+
</noinclude>}}<noinclude>
 +
;;;;;;;;;;;;
 +
</noinclude></includeonly>

Current revision

This is the documentation for the template Template:Link/Create/Core

Template:Link/Create/Core/Doc:

The template {{Link/Create/Core|Page|Text|Desc=description|Preload=boilerplate|Editintro=intro}} is a helper template for Template:Link/Create.

It performs the core function of Link/Create, leaving the caller to decide what Text to display and how to create an Internal link if the external one does not have to be used.

Text 
(required) The text of the link to display. Since it is required, the default value if Page does not exist need to be computed.
Internal 
How to display the link if an external link does not have to be used.
Preload 
(optional)
Editintro 
(optional)


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

Personal tools