Template:Edit/doc: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(undo)
No edit summary
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->
<!-- Please add categories to the /doc subpage, and interwikis at Wikidata (see Wikipedia:Wikidata) -->
==Usage==
{{High-use}}
This [[Wikipedia:Template|template]] is a [[Wikipedia:Avoid self-references|self-reference]] and so is part of the Wikipedia project rather than the encyclopaedic content.


Parameters:
It provides a clickable link to edit a page, or a section of the page.


:{{para|1|Page to edit. }} Leave blank to edit current page.
== Usage ==
:{{para|2|Text to display.}} Default: "edit"
<pre>
:{{para|section|Section to edit.}} e.g. <code>0</code> to edit intro only. Default: none (edit whole page)
{{Edit
|1=
|2=
|section=
|editintro=
|preload=
|preloadtitle=
|tooltip=
}}
</pre>


==See also==
* '''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 <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 [[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.
* '''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.
* '''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 ==
{| class="wikitable"
|-
!style="width: 35%;"| Code
!style="width: 15%;"| Output
!| Notes
|-
| <nowiki>{{edit}}</nowiki> || {{edit}} || Edit current page
|-
| <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|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}}
<templatedata>
{
"params": {
"1": {
"label": "Page",
"description": "The page to edit",
"example": "Example",
"type": "wiki-page-name",
"default": "The current page",
"suggested": true
},
"2": {
"label": "Label",
"description": "The link label",
"example": "Edit this page",
"type": "string",
"default": "Edit"
},
"section": {
"label": "Section",
"description": "The section to edit; 0 for the top section; new for a new section",
"example": "0",
"type": "string",
"default": "None (whole page gets edited)"
},
"editintro": {
"label": "Edit Intro",
"description": "Content that will be rendered above the edit box",
"example": "Template:Disambig editintro"
},
"preload": {
"label": "Preload",
"description": "Content to preload in the edit form when creating a new page or section"
},
"preloadtitle": {
"label": "Preload title",
"description": "If making a new section, preload text into the title box"
},
"tooltip": {
"label": "Tooltip",
"description": "Text to display on mouseover",
"default": "Page or section name",
"type": "string"
}
},
"description": "Displays a link to edit a page.",
"paramOrder": [
"1",
"2",
"section",
"editintro",
"preload",
"preloadtitle",
"tooltip"
]
}
</templatedata>

== Comparison ==
{{edit templates}}
{{edit templates}}


<includeonly><!--
== See also ==
++++ PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, THANK YOU. -->
* {{tl|Navbox}}
[[Category:Inline cleanup templates|{{PAGENAME}}]]
[[Category:Internal link maintenance templates|{{PAGENAME}}]]


[[ar:قالب:تحرير]]
<includeonly>{{sandbox other||
[[ca:Plantilla:Edita]]
<!-- Add categories below this line, and interwikis at Wikidata -->
[[eu:Txantiloi:Aldatu]]
[[Category:Internal link maintenance templates]]
[[fr:Modèle:Éditer]]
[[Category:Internal link templates]]
[[ia:Patrono:Modificar]]
}}</includeonly>
[[ja:Template:Edit]]
[[mk:Шаблон:Уреди]]
[[no:Mal:Rediger]]
[[vi:Tiêu bản:Sửa]]
</includeonly>

Revision as of 11:54, November 12, 2021

Usage

This template is a self-reference and so is part of the Wikipedia project rather than the encyclopaedic content.

Parameters:

|1=Page to edit. Leave blank to edit current page.
|2=Text to display. Default: "edit"
|section=Section to edit. e.g. 0 to edit intro only. Default: none (edit whole page)

See also

[

This box: view • talk • edit

] 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