Forum:Generating navigation links via templates... howto?

I'd like to create a template that has one parameter and generates two links: to previous article and to the next one. All considered articles are sorted via redirect pages called saying Article_1, Article_2 etc.

I think I need something like
 * Previous article | Next article

I mean the first link reduces parameter number by one, the second arises. And Article_0 is a redirect to the table of contents without this template, and Article_&lt;last+1&gt; is another special page.

Is it possible to do that, what manuals should I read? I looked through help:templates pages and following wikipedia links but found nothing that actually helped me. Have I missed something? // Gluk47 00:24, December 20, 2009 (UTC)


 * There's a parser function that can divide the title of a page into "parts" but i'm not sure it could work with your namming scheme.
 * Because, otherwise, how do you think your template could know what is the number added at the end of the title ?
 * return full title.
 * I think the parser function titlepart divide titles of page where there's a "/" character (and maybe also the ":" character). — TulipVorlax 01:23, December 20, 2009 (UTC)


 * No, real data pages are named by their contents, no numbers included. Only table of contents has links to these redirecting metapages.
 * That part of wiki is about exams' questions that are numbered and can be changed in some time. In case of this changing one should rename links (without changing their locations) in contents and correct necessary redirect page &mdash; and fix this template at the bottom of the data page with changed number.
 * So I do not try to get this number from page's title, let it be manually-provided parameter. I just need the way to create links depending on this parameter. What's the syntax for that? --Gluk47 02:01, December 20, 2009 (UTC)