Template:Oldid: Difference between revisions

From Heroes 3 wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 15: Line 15:
-->}}}}}}}}}]</span><!--
-->}}}}}}}}}]</span><!--
--><noinclude>
--><noinclude>
{{documentation|content=
This template is intended to be useful for creating links to "[[Help:URL#Old versions of pages|oldid]]s"; that is, links to old versions of a wiki page.
Every historical version of a page has a revision ID, which you can find from the [[:en:Help:Page history|history]] of the page, or from the URL of the old revision.  Given a page name and a revision IDs of it, you can construct a link to that particular version.
== Usage ==
'''{{((}}oldid{{!}}1='''''page'''''{{!}}2='''''oldid'''''{{!}}3='''''label'''''{{))}}'''
;Current default:'''{{((}}oldid{{!}}page='''Main Page'''{{))}}''' &rarr; {{oldid|page=Main Page}}
;You can also use the named variables "page", "oldid", and "label".:'''{{((}}oldid{{!}}page='''Main Page'''{{!}}oldid={{!}}label='''<nowiki>Last revision of '''Main Page'''</nowiki>'''{{))}}''' &rarr; {{oldid|page=Main Page|oldid=|label=Last revision of '''Main Page'''}}
;As long as the values do not contain equals signs, you can skip the variable names/numbers.:'''{{((}}oldid{{!}}'''Main Page'''{{!}}589841{{!}}'''<nowiki>Old version of '''Main Page'''</nowiki>'''{{))}}''' &rarr; {{oldid|Main Page|589841|Old version of '''Main Page'''}}
{{(!}} class="wikitable"
! style="width:33%;" {{!}} code !! result
{{!}}-
{{!}} <code><nowiki>{{oldid|Main Page|589841|Link to a 2003 version of a the Main Page}}</nowiki></code>
{{!}} {{oldid|Main Page|589841|Link to a 2003 version of a the Main Page}}
* The '''label=''' parameter (parameter number 3) should be the link text description (optional).
{{!}}-
{{!}} <code><nowiki>{{oldid|Main Page|589841}}</nowiki></code>
{{!}} {{oldid|Main Page|589841}}
* The '''oldid=''' parameter (parameter number 2) should be the known revision number.
{{!}}-
{{!}} <code><nowiki>{{oldid|Main Page}}</nowiki></code>
{{!}} {{oldid|Main Page}}(pretty useless)
* The '''page=''' parameter (parameter number 1) should be the name of the page.
* The '''oldid=''' parameter (parameter number 2) can be '''cur''' (or leave it empty) for the current version.
{{!)}}
== See also ==
* {{tl|diff}} uses a similar approach to create links to [[Help:Diff|differences]] between versions.
}}
==Documentation==
==Documentation==
[https://www.mediawiki.org/wiki/Template:Oldid mediawiki.org/wiki/Template:Oldid]
[https://www.mediawiki.org/wiki/Template:Oldid mediawiki.org/wiki/Template:Oldid]

Revision as of 19:43, 15 December 2023