Template:movinganchor
From Homestar Runner Wiki
(Difference between revisions)
m (→Usage: Reword.) |
The Cheatbot (Talk | contribs) (autoreplace: — → {{--}}) |
||
(includes 9 intermediate revisions) | |||
Line 1: | Line 1: | ||
- | {{#ifexist:{{{1}}}|{{{1}}} | + | {{#ifexist:{{{1}}}|{{{1}}}|{{{2}}}}}{{#if:{{{3|}}}|#{{{3}}}|}}<noinclude> |
---- | ---- | ||
=== Usage === | === Usage === | ||
- | Links to current, specific sections on pages like [[Talk:Main Page]] will break after that content has been archived as usually done. In order for these links to work for future readers, | + | Links to current, specific sections on pages like [[Talk:Main Page]] will break after that content has been archived as usually done. In order for these links to work for future readers, create the link using this template rather than hard-coding it. |
=== Syntax === | === Syntax === | ||
*<code><nowiki>{{movinganchor|archive|current|anchor}}</nowiki></code> | *<code><nowiki>{{movinganchor|archive|current|anchor}}</nowiki></code> | ||
- | **<code>archive</code> | + | **<code>archive</code> {{--}} The page where <code>anchor</code> will be archived in the future. |
- | **<code>current</code> | + | **<code>current</code> {{--}} The current page where <code>anchor</code> resides. |
- | **<code>anchor</code> | + | **<code>anchor</code> {{--}} The section/anchor name. ''(Optional)'' |
=== Example === | === Example === | ||
- | *<code><nowiki>[[ | + | *<code><nowiki>[[{{movinganchor|HRWiki:Main Page Talk Archive 40|Talk:Main Page|Featured Article (DNA Evidence) Typo}}]]</nowiki></code> → [[{{movinganchor|HRWiki:Main Page Talk Archive 40|Talk:Main Page|Featured Article (DNA Evidence) Typo}}]] |
+ | *<code><nowiki>[[{{movinganchor|HRWiki:Main Page Talk Archive 1987|Talk:Main Page}}]]</nowiki></code> → [[{{movinganchor|HRWiki:Main Page Talk Archive 1987|Talk:Main Page}}]] | ||
- | [[Category: | + | [[Category:Internal link templates|{{PAGENAME}}]] |
</noinclude> | </noinclude> |
Current revision as of 04:13, 4 November 2022
{{{2}}}
[edit] Usage
Links to current, specific sections on pages like Talk:Main Page will break after that content has been archived as usually done. In order for these links to work for future readers, create the link using this template rather than hard-coding it.
[edit] Syntax
{{movinganchor|archive|current|anchor}}
archive
— The page whereanchor
will be archived in the future.current
— The current page whereanchor
resides.anchor
— The section/anchor name. (Optional)
[edit] Example
[[{{movinganchor|HRWiki:Main Page Talk Archive 40|Talk:Main Page|Featured Article (DNA Evidence) Typo}}]]
→ HRWiki:Main Page Talk Archive 40#Featured Article (DNA Evidence) Typo[[{{movinganchor|HRWiki:Main Page Talk Archive 1987|Talk:Main Page}}]]
→ Talk:Main Page