Template:Edit

From Bjoern Hassler's website
Jump to: navigation, search


Usage

{{Edit | link text | wikipage | preload=template | editintro=template | section=section | page=(talk|article) }}

Link text and wikipage can be omitted. Defaults:

  • link text = Edit
  • wikipage = current page

All parameters are optional.

Examples:

Edit
[Edit this page.]
Edit other page.
Edit other page with template. using Template:Edit/preload
Edit other page with intro. using Template:Edit/editintro
Edit other page by adding section.
Edit Talk
Edit article (Also see Template talk:Edit.)
Add adding section to talk page.
Add adding section to talk page, with preload and editintro.
 {{Edit}}
 [{{Edit|Edit this page.}}]
 {{Edit|Edit other page.|Template:Edit/test}}
 {{Edit|Edit other page with template.|Template:Edit/test1|preload=Template:Edit/preload}} using [[Template:Edit/preload]]
 {{Edit|Edit other page with intro.|Template:Edit/test|editintro=Template:Edit/editintro}} using [[Template:Edit/editintro]]
 {{Edit|Edit other page by adding section.|Template:Edit/test|section=new}}
 {{Edit|Edit Talk|page=talk}}
 {{Edit|Edit article|page=article}} (Also see [[{{TALKPAGENAME}}]].)
 {{Edit|Add adding section to talk page.|page=talk|section=new}}
 {{Edit|Add adding section to talk page, with preload and editintro.
       |page=talk|section=new|preload=Template:Edit/preload|editintro=Template:Edit/editintro}}

Possible improvement: At the moment, if a page is explicitly given (i.e. {{Edit|Edit other page.|Template:Edit/test}}) then the "page" parameter is ignored. Could change the template so that the explicitly given page is switched into the talk space if page=talk is specified.

The template (version 1:)

<span class="plainlinks">[{{fullurl:{{{2|{{FULLPAGENAME}}}}}|action=edit{{#if:{{{preload|}}}|&preload={{{preload}}}|}}{{#if:{{{editintro|}}}|&editintro={{{editintro}}}|}}{{#if:{{{section|}}}|&section={{{section}}}|}} }} {{{1|Edit}}}]</span>

Version 2:

<span class="plainlinks">[{{fullurl:{{{2|{{#if:{{{page|}}}|{{TALKPAGENAME}}|{{FULLPAGENAME}}}}}}}|action=edit{{#if:{{{preload|}}}|&preload={{{preload}}}|}}{{#if:{{{editintro|}}}|&editintro={{{editintro}}}|}}{{#if:{{{section|}}}|&section={{{section}}}|}} }} {{{1|Edit}}}]</span>

Unfortutnately this doesn't work: Template:WithAmp, Template:MakeExample