Mediawiki templates for edit and history

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

1 Producing 'edit' and 'history' links[edit]

How do you produce links for page/discussion/edit/history etc within wiki text? The basic tool is fullurl c.f. http://meta.wikimedia.org/wiki/Help:Magic_words:

{{fullurl:{{FULLPAGENAME}}|action=edit}}

gives

http://www.sciencemedianetwork.org/w/index.php?title=Mediawiki_templates_for_edit_and_history&action=edit

You then package this

[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit] -> Edit

and remove the external link formatting:

[<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit]</span>] -> [Edit]

Some more examples:

Because this gets a bit difficult to type, here are some templates:

  • Two simple templates:
  • Two simple to use, but somewhat more complicated to write and understand templates:

A more complicated example

{{Edit|Add comment.|page=talk|section=new|preload=Template:Edit/preload|editintro=Template:Edit/editintro}}

gives:

Add comment.

1.1 Not quite as tricky, but still handy[edit]

A very simple template: Template:Backtoarticle. Can be used on talk pages to link back to the article.

2 Other[edit]

[Create page W:Blog/20170920] (using Template:Blogtemplate )

Template:EditLink