Template:Link/Create+Desc/Doc

From PCSAR

(Difference between revisions)
Jump to: navigation, search
(New page: {{Template:Link/Doc/Related}} {{Template Doc|<nowiki>Page|Text|Desc=description|Preload=boilerplate|Editintro=intro</nowiki>}} is used to create a link to a page. ; Page : the page to lin...)
Current revision (13:35, 18 July 2012) (edit) (undo)
 
Line 9: Line 9:
; Editintro : (optional) When ''Page'' does not exist, following the link will display the page ''intro'' before the edit window rather than the normal instructions
; 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 <code>{{((}}[[Template:Link/Desc|Link/Desc]]{{))}}</code>.
+
This template supports the functionality of both <code>{{((}}[[Template:Link/Desc|Link/Desc]]{{))}}</code>
-
On top of that,
+
and <code>{{((}}[[Template:Link/Create|Link/Create]]{{))}}</code>.
-
rather than just dumping you into a blank editor if you follow a link to a page that hasn't been created yet,
+
-
''Preload'' can be used to give the editor some initial boilerplate text.
+
-
As well, ''Editintro'' can be used to give some specific instructions on how to change the boilerplate.
+
-
 
+
-
 
+
-
For illustration purpose, the following demonstration pages have been set up:
+
-
* "[[Demo/Does not exist]]" is a page that hasn't been created.
+
-
* "[[Demo/Boilerplate]]" is boilerplate text that we want to have loaded into our editor.
+
-
* "[[Demo/Editintro]]" are the instructions we want to see when we start creating the page.
+
-
 
+
-
 
+
-
{{demo table|
+
-
{{demo row|<nowiki>{{Link/Create+Desc|Demo/Does not exist|Preload=Demo/Boilerplate|Editintro=Demo/Editintro}}</nowiki>|<!--
+
-
-->{{Link/Create+Desc|Demo/Does not exist|Preload=Demo/Boilerplate|Editintro=Demo/Editintro}} }}
+
-
{{demo row|<nowiki>{{Link/Create+Desc|Demo/Does not exist|Preload=Demo/Boilerplate}}</nowiki>|<!--
+
-
-->{{Link/Create+Desc|Demo/Does not exist|Preload=Demo/Boilerplate}} }}
+
-
{{demo row|<nowiki>{{Link/Create+Desc|Demo/Does not exist|Editintro=Demo/Editintro}}</nowiki>|<!--
+
-
-->{{Link/Create+Desc|Demo/Does not exist|Editintro=Demo/Editintro}} }}
+
-
{{demo row|<nowiki>{{Link/Create+Desc|Demo/Does not exist|this page|Preload=Demo/Boilerplate}}</nowiki>|<!--
+
-
-->{{Link/Create+Desc|Demo/Does not exist|this page|Preload=Demo/Boilerplate}} }}
+
-
}}
+
== Implementation ==
== Implementation ==
Helper templates:
Helper templates:
 +
* [[Template:Link/Create/Core]]
* [[Template:Link/Desc]]
* [[Template:Link/Desc]]
* [[Template:Link/Desc/Text]]
* [[Template:Link/Desc/Text]]

Current revision

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:

Personal tools