Template:Archive nav: Difference between revisions

From MediaWiki
Jump to navigationJump to search
Derik (talk | contribs)
mNo edit summary
JW (talk | contribs)
Recat'd as part of Category:Templates cleanup.
 
(33 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{chapters|title=[[{{#titleparts:{{FULLPAGENAMEE}}|-1}}|{{#titleparts:{{FULLPAGENAMEE}}|2|-2}}]]
<includeonly>{{chapters|title=[[{{#titleparts:{{FULLPAGENAMEE}}|-1}}|{{#titleparts:{{PAGENAMEE}}|-1}}]] / [[{{#titleparts:{{FULLPAGENAMEE}}|-1}}/Archive|{{#titleparts:{{FULLPAGENAMEE}}|1|-1}}]] &nbsp; <small><span class="plainlinks">[{{fullurl:{{FULLPAGENAMEE}}|action=edit&section=0}} e]</span></small>
|center=false|float=right|style=2
|center=false|float=right|style=2|align=left
|prev={{Template:Archive nav/utility|getOffsetLink={{FULLPAGENAMEE}}|offset=-1}}
|prev={{#ifeq:{{SUBPAGENAME}}|Archive1||{{Template:Archive nav/utility|getOffsetLink={{FULLPAGENAMEE}}|offset=-1}}}}
|next={{Template:Archive nav/utility|getOffsetLink={{FULLPAGENAMEE}}|1|-1}}|offset=1}}
|next={{Template:Archive nav/utility|getOffsetLink={{FULLPAGENAMEE}}|offset=1}}
|content=
|content=<p><tt>from</tt>~{{{from|?}}}<br/>
*{{Template:Archive nav/utility|getOffsetLink={{#titleparts:{{FULLPAGENAMEE}}|1|-1}}|offset=-1}}
<tt>to</tt>~{{{to|?}}}</p>
*{{Template:Archive nav/utility|getOffsetLink={{#titleparts:{{FULLPAGENAMEE}}|1|-1}}|offset=1}}
<p>'''notes: '''
}}
{{{notes|}}}</p>
}}{{--}}</includeonly><noinclude>{{doc}}


&#8592;
[[Category:Wiki community page templates]]
 
</noinclude>
&#8594;
 
{{#iferror: {{#expr: {{#sub:{{#titleparts:{{FULLPAGENAMEE}}|1|-1}}|-2|2}} - 0 }} | error | {{#expr: {{#sub:{{#titleparts:{{FULLPAGENAMEE}}|1|-1}}|-2|2}} +1 }}  }}
 
 
* {{:Template:Archive nav/utility|getNumLength={{#titleparts:{{FULLPAGENAMEE}}|1|-1}}}}
 
 
* {{:Template:Archive nav/utility|getNumLength=Sandbox2}}
*x
 
* {{Template:Archive nav/utility|getOffsetLink=Sandbox1|offset=1}}
*y
 
 
* {{#sub:sanedbox5|-{{:Template:Archive nav/utility|getNumLength=Sandbox5}}|{{:Template:Archive nav/utility|getNumLength=Sandbox5}}}}
 
<!--Next-->{{#sub:Sandbox15|0|-{{:Template:Archive nav/utility|getNumLength=Sandbox15}}}}{{#expr: {{#sub:Sandbox15|-{{:Template:Archive nav/utility|getNumLength=Sandbox15}}|{{:Template:Archive nav/utility|getNumLength=Sandbox15}}}} + 1 }}
 
----
 
* <!--
    getNumLength=String (pagename)
 
    Test if a page name ends in 3, 2 or 1 #'s.  If all 3 tests are negative, the pagename is assumed to end in 0 numbers.
    Return the number of numbers.
 
-->{{#if:|
{{#iferror: {{#expr: {{#sub:{{{getNumLength}}}|-3|3}} - 0 }} | {{#iferror: {{#expr: {{#sub:{{{getNumLength}}}|-2|2}} - 0 }} | {{#iferror: {{#expr: {{#sub:{{{getNumLength}}}|-1|1}} - 0 }} | 0 | 1 }} | 2 }} | 3 }}
|}}<!--
    getOffsetLink=String (pagename)
      |offset=Number (#of digits)
 
    Return a substring of length "length" from the end of "getNum."
 
-->{{#if:Sandbox121|
{{#sub:Sandbox121|0|-{{:Template:Archive_nav/utility_recurs|getNumLength=Sandbox121}}}}{{#expr: {{#sub:Sandbox121|-{{:Template:Archive_nav/utility_recurs|getNumLength=Sandbox121}}|{{:Template:Archive_nav/utility_recurs|getNumLength=Sandbox121}}}} + 0 }}
|}}

Latest revision as of 17:33, 27 May 2011

(Transcluded documentation: view)

{{Archive nav}} creates basic navigation for the archives of TFWiki.net Community Portal Discussion.

The template can be used as-is; all functions are automatic. It dynamically detects the number at the end of the page name (up to 3 digits) and will create previous/next links.

This template will produce violent and alarming rendering errors if used on a page whose title doesn't end in a number.


If you want to add meta-data about this archive to make finding stuff easier (beginning and end date, notable subjects covered) there are 3 optional parameters.

{{archive_nav
|from=May 16, 2007
|from=Mid-August, 2007
|notes=* Major discussion about a "messagebox 3.0" redesign.
* Character infobox proposal
* An '''useful''' funny/unfunny discussion (with links!)
}}


Technical notes

[edit]

This Template has 2 sub-templates:


This Template's look-and-feel is laid out using the standard "chapters" nav:

Metadata

[edit]
  • Designed by: User:Derik
  • Custom CSS: None
  • Date created: September 4, 2009
  • Date last modified:
  • Future issues: None anticipated