Template:Edit/doc: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(add tooltip documentation) |
No edit summary |
||
Line 1: | Line 1: | ||
{{Documentation subpage}} |
{{Documentation subpage}} |
||
<!-- |
<!-- Please add categories to the /doc subpage, and interwikis at Wikidata (see Wikipedia:Wikidata) --> |
||
{{High-use}} |
|||
Provides a link to edit a page. |
|||
This [[Wikipedia:Template messages|template]] is a [[Wikipedia:Manual of Style/Self-references to avoid|self-reference]] and so is part of the Wikipedia project rather than the encyclopedic content. |
|||
It provides a clickable link to edit a page, or a section of the page. |
|||
⚫ | |||
<code><nowiki>{{</nowiki>'''Edit'''|''Page''|''Label''|section=''Section''|editintro=''Editintro''|preload=''preload''|preloadtitle=''Preloadtitle''|tooltip=''tooltip''<nowiki>}}</nowiki></code> |
|||
⚫ | |||
⚫ | |||
<pre> |
|||
⚫ | |||
{{Edit |
|||
*Label: the text to label the link, defaults to "edit" |
|||
|1= |
|||
*Section: the section to edit, 0 for top section, "new" to add a new section |
|||
|2= |
|||
*Editintro: Title of a page that will be transcluded above the edit box. Not a wikilink, templates require <code>Template:</code> |
|||
|section= |
|||
⚫ | |||
|editintro= |
|||
⚫ | |||
|preload= |
|||
⚫ | |||
|preloadtitle= |
|||
|tooltip= |
|||
}} |
|||
</pre> |
|||
⚫ | |||
* '''2''': the label text of the edit link. If omitted, it is "edit" by default. |
|||
* '''section''': the section to edit, in which <code>0</code> for the top (i.e. lead section), <code>1</code> for the first (sub-)section, and <code>new</code> for adding a new section. |
|||
* '''editintro''': the content of a page/template that will be transcluded above the edit box when you edit the page. Usually used to load [[w:en:Wikipedia:Template messages|template messages]]. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
Notes: |
|||
⚫ | |||
* The parameter names '''must be''' in lowercase or they will fail. |
|||
== Examples == |
|||
{| class="wikitable" |
|||
|- |
|||
!style="width: 35%;"| Code |
|||
!style="width: 15%;"| Result |
|||
!| Explanation |
|||
|- |
|||
| <nowiki>{{edit}}</nowiki> || {{edit}} || Edit current page |
|||
|- |
|||
| <nowiki>{{edit| |edit template doc}}</nowiki> || {{edit| |edit template doc}} || |
|||
|- |
|||
| <nowiki>{{edit|2=edit template doc}}</nowiki> || {{edit|2=edit template doc}} || |
|||
|- |
|||
| <nowiki>{{edit|friendship}}</nowiki> || {{edit|friendship}} || Edit the article [[friendship]] |
|||
|- |
|||
| <nowiki>{{edit|friendship|section=3}}</nowiki> || {{edit|friendship|section=3}} || Edit the third order of a (sub-)section of the article [[friendship]], which is [https://en.wikipedia.org/w/index.php?title=Friendship&oldid=930460849#Adolescence 1.2 Adolescence] as of 10 Jan 2020 |
|||
|- |
|||
| <nowiki>{{edit|Draft:Sandbox|editintro=Template:Disambig editintro}}</nowiki> || {{edit|Draft:Sandbox|editintro=Template:Disambig editintro}} || Load {{tl|Disambig editintro}} when you edit |
|||
|- |
|||
| <nowiki>{{edit|Template:Some new template|preload=Template:Documentation/preload}}</nowiki> || {{edit|Template:Some new template|preload=Template:Documentation/preload}} || Preload the whoole content of {{tl|Documentation/preload}} when you create a new template |
|||
|- |
|||
| <nowiki>{{edit|Wikipedia talk:Sandbox|section=new||preloadtitle=Custom title of the new section}}</nowiki> || {{edit|Wikipedia talk:Sandbox|section=new||preloadtitle=Custom title of the new section}} || Create a new section of a custom title |
|||
|- |
|||
| <nowiki>{{edit|2=link with tooltip|tooltip=This is a tooltip}}</nowiki> || {{edit| |tooltip=This is a tooltip}} || Hover over the link to see the tooltip |
|||
|} |
|||
== TemplateData == |
|||
{{TemplateDataHeader}} |
{{TemplateDataHeader}} |
||
<templatedata> |
<templatedata> |
||
Line 75: | Line 116: | ||
</templatedata> |
</templatedata> |
||
== Comparison == |
|||
⚫ | |||
{{edit templates}} |
{{edit templates}} |
||
⚫ | |||
⚫ | |||
* {{tl|View}} |
|||
⚫ | |||
* {{tl|VTE}} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
}}</includeonly> |
}}</includeonly> |