Template:Edit/doc: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
No edit summary |
m (53 revisions imported from wikipedia:Template:Edit/doc) |
||
(17 intermediate revisions by 9 users not shown) | |||
Line 21: | Line 21: | ||
* '''2''': the label text of the edit link. If omitted, it is "edit" by default. |
* '''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. |
* '''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 [[ |
* '''editintro''': the content of a page/template that will be transcluded above the edit box when you edit the page. Usually used to load [[Wikipedia:Template messages|template messages]]. |
||
* '''preload''': the content of a page/template that will be preloaded into the text area of the edit form. It works only if the page to be edited does not exist. |
* '''preload''': the content of a page/template that will be preloaded into the text area of the edit form. It works only if the page to be edited does not exist. |
||
* '''preloadtitle''': if making a new section (i.e. <code>|section=new</code>), the title to be preloaded into the title box of the edit form. |
* '''preloadtitle''': if making a new section (i.e. <code>|section=new</code>), the title to be preloaded into the title box of the edit form. |
||
Line 34: | Line 34: | ||
|- |
|- |
||
!style="width: 35%;"| Code |
!style="width: 35%;"| Code |
||
!style="width: 15%;"| |
!style="width: 15%;"| Output |
||
!| |
!| Notes |
||
|- |
|- |
||
| <nowiki>{{edit}}</nowiki> || {{edit}} || Edit current page |
| <nowiki>{{edit}}</nowiki> || {{edit}} || Edit current page |
||
|- |
|- |
||
| <nowiki>{{edit| |edit template doc}}</nowiki> || {{edit| |edit template doc}} || |
| <nowiki>{{edit| |edit template doc}}</nowiki> || {{edit| |edit template doc}} || |
||
|- |
|||
| <nowiki>{{edit|1=Infobox foo|2=E}}</nowiki> || {{edit|1=Infobox foo|2=E}} || |
|||
|- |
|- |
||
| <nowiki>{{edit|2=edit template doc}}</nowiki> || {{edit|2=edit template doc}} || |
| <nowiki>{{edit|2=edit template doc}}</nowiki> || {{edit|2=edit template doc}} || |
||
Line 120: | Line 122: | ||
== See also == |
== See also == |
||
* {{tl| |
* {{tl|Navbox}} |
||
* {{tl|VTE}} |
|||
<includeonly>{{sandbox other|| |
<includeonly>{{sandbox other|| |
||
<!-- Add categories below this line, and interwikis at Wikidata --> |
<!-- Add categories below this line, and interwikis at Wikidata --> |
||
[[ |
[[Category:Internal link maintenance templates]] |
||
[[ |
[[Category:Internal link templates]] |
||
}}</includeonly> |
}}</includeonly> |
Latest revision as of 22:20, January 28, 2022
This is a documentation subpage for Template:Edit. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
It provides a clickable link to edit a page, or a section of the page.
Usage
{{Edit |1= |2= |section= |editintro= |preload= |preloadtitle= |tooltip= }}
- 1: the page to edit. If omitted, it will be the current page.
- 2: the label text of the edit link. If omitted, it is "edit" by default.
- section: the section to edit, in which
0
for the top (i.e. lead section),1
for the first (sub-)section, andnew
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 template messages.
- preload: the content of a page/template that will be preloaded into the text area of the edit form. It works only if the page to be edited does not exist.
- preloadtitle: if making a new section (i.e.
|section=new
), the title to be preloaded into the title box of the edit form. - tooltip: the text to display when you hover over the link.
Notes:
- All parameters are optional.
- The parameter names must be in lowercase or they will fail.
Examples
Code | Output | Notes |
---|---|---|
{{edit}} | action=edit}} Edit]] | Edit current page |
{{edit| |edit template doc}} | [[[[:Template:Fullurl:Template:]] Edit]] |
|
{{edit|1=Infobox foo|2=E}} | [Edit] |
|
{{edit|2=edit template doc}} | action=edit}} Edit]] | |
{{edit|friendship}} | [Edit] |
Edit the article friendship |
{{edit|friendship|section=3}} | [Edit] |
Edit the third order of a (sub-)section of the article friendship, which is 1.2 Adolescence as of 10 Jan 2020 |
{{edit|Draft:Sandbox|editintro=Template:Disambig editintro}} | [Edit] |
Load {{Disambig editintro}} when you edit |
{{edit|Template:Some new template|preload=Template:Documentation/preload}} | [Edit] |
Preload the whoole content of {{Documentation/preload}} when you create a new template |
{{edit|Wikipedia talk:Sandbox|section=new||preloadtitle=Custom title of the new section}} | [Edit] |
Create a new section of a custom title |
{{edit|2=link with tooltip|tooltip=This is a tooltip}} | [[[[:Template:Fullurl:Template:]] Edit]] |
Hover over the link to see the tooltip |
TemplateData
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.
TemplateData for Edit
Displays a link to edit a page.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Page | 1 | The page to edit
| Page name | suggested |
Label | 2 | The link label
| String | optional |
Section | section | The section to edit; 0 for the top section; new for a new section
| String | optional |
Edit Intro | editintro | Content that will be rendered above the edit box
| Unknown | optional |
Preload | preload | Content to preload in the edit form when creating a new page or section | Unknown | optional |
Preload title | preloadtitle | If making a new section, preload text into the title box | Unknown | optional |
Tooltip | tooltip | Text to display on mouseover
| String | optional |
Comparison
[
] Compare different edit templates:- {{Ed}} —– plain-style edit link surrounded by <small> tags, specifically for templates only
- {{Ed right}} —– plain-style edit link surrounded by <small> tags and aligned to right of page, specifically for templates only
- {{Edit}} —– plain-style edit link, applicable to all Wikipedia namespaces
- {{Edit section}} —– edit link surrounded by <div> tags by default which can specify which section to edit on a page, applicable to all Wikipedia namespaces
- {{Vedit}} —– plain-style edit link which edit with the Wikipedia:VisualEditor, applicable to all Wikipedia namespaces
Templates with view, talk and edit links:
- {{Navbar}} —– navigation bar with configurable caption and view·talk·edit links, specifically for templates only
- {{View}} —– navbar-style view·talk·edit links, specifically for templates only
- {{VTE}} & {{V}} —– navbar-style V·T·E links (i.e. view·talk·edit links in short forms), specifically for templates only
See also
- {{Navbox}}