Mediawiki templates for edit and history
From Bjoern Hassler
[edit] 1 Producing 'edit' and 'history' links
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/wiki_source/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:
- Template:AddSection, e.g. {{AddSection}} adds a section to the current page.
- Template:AddTalk, e.g. {{AddTalk}} adds a section to the talk page of the current page.
- Two simple to use, but somewhat more complicated to write and understand templates:
- Template:Edit: e.g. {{Edit}} edits the current page.
- Template:Action: e.g. {{Action|history}} links to the history of the current page.
A more complicated example
{{Edit|Add comment.|page=talk|section=new|preload=Template:Edit/preload|editintro=Template:Edit/editintro}}
gives:
Add comment.
[edit] 1.1 Not quite as tricky, but still handy
A very simple template: Template:Backtoarticle. Can be used on talk pages to link back to the article.
[edit] 2 Other
[Create page W:Blog/20120210] (using Template:Blogtemplate )