Difference between revisions of "Template:Prevnext2"

Jump to: navigation, search
m
Line 3: Line 3:
 
<td style="text-align: center; width:  33%">'''{{PAGENAME}}'''</td>
 
<td style="text-align: center; width:  33%">'''{{PAGENAME}}'''</td>
 
<td style="text-align: right; width: 33%">{{#if: {{{nextpage|}}} | [[{{{nextpage}}}|{{{nexttext|{{{nextpage}}}}}}&rarr;]] | }}</td>
 
<td style="text-align: right; width: 33%">{{#if: {{{nextpage|}}} | [[{{{nextpage}}}|{{{nexttext|{{{nextpage}}}}}}&rarr;]] | }}</td>
</tr></table></includeonly>
+
</tr></table></includeonly><noinclude>{{Template:I18n/Language Navigation Bar|Template:Prevnext}}
<noinclude>
 
  
{{Template:I18n/Language Navigation Bar|Template:Prevnext}}
+
Use this template when you want to provide links to the previous and the next sections of the article so the user isn't forced to go back to the index to navigate.
  
Use this template when you want to provide links to the previous and the next sections of the article so the user isn't forced to go back to the index to navigate.
 
  
 
== How to use this template ==
 
== How to use this template ==
Line 14: Line 12:
 
Write
 
Write
  
<tt>'''<nowiki>{{Prevnext2</nowiki><br><nowiki>
+
<code>{{Prevnext2
| prevpage=path/to/article | nextpage=path/to/article</nowiki><br><nowiki>
+
| prevpage=path/to/article | nextpage=path/to/article
| prevtext=previous section| nexttext=The next section</nowiki><br><nowiki>
+
| prevtext=previous section| nexttext=The next section
}}</nowiki>'''</tt>
+
}}</code>
  
 
which will be returned as,
 
which will be returned as,
 
+
----
 
{{Prevnext2
 
{{Prevnext2
 
| prevpage=path/to/article | nextpage=path/to/article
 
| prevpage=path/to/article | nextpage=path/to/article
 
| prevtext=previous section| nexttext=The next section
 
| prevtext=previous section| nexttext=The next section
 
}}
 
}}
 +
----
  
 +
== Optional arguments ==
  
Additionally, the arguments in this template are optional. That is, if there is no previous page to link to, you don't have to include it in the template. You can just write this:
+
The arguments in this template are optional. That is, if there is no previous page to link to, you don't have to include it in the template. You can just write this:
  
<tt>'''<nowiki>{{Prevnext2</nowiki><br><nowiki>
+
<code>{{Prevnext2
| nextpage=path/to/article</nowiki><br><nowiki>
+
| nextpage=path/to/article
| nexttext=The next section</nowiki><br><nowiki>
+
| nexttext=The next section
}}</nowiki>'''</tt>
+
}}</code>
  
 
Which would be rendered as:
 
Which would be rendered as:
  
 +
----
 
{{Prevnext2
 
{{Prevnext2
 
| nextpage=path/to/article
 
| nextpage=path/to/article
 
| nexttext=The next section
 
| nexttext=The next section
 
}}
 
}}
 +
----
  
 
This works the other way around, too. This:
 
This works the other way around, too. This:
  
<tt>'''<nowiki>{{Prevnext2</nowiki><br><nowiki>
+
<code>{{Prevnext2
| prevpage=path/to/article </nowiki><br><nowiki>
+
| prevpage=path/to/article
| prevtext=previous section</nowiki><br><nowiki>
+
| prevtext=previous section
}}</nowiki>'''</tt>
+
}}</code>
  
 
is rendered as:
 
is rendered as:
 
+
----
 
{{Prevnext2
 
{{Prevnext2
 
| prevpage=path/to/article  
 
| prevpage=path/to/article  
 
| prevtext=previous section
 
| prevtext=previous section
 
}}
 
}}
 +
----
 +
 +
== Omitting link descriptions ==
  
 
Finally, the link description text doesn't have to be specified, either. The text will default to the name of the article you are linking to. So, the following syntax,
 
Finally, the link description text doesn't have to be specified, either. The text will default to the name of the article you are linking to. So, the following syntax,
  
<tt>'''<nowiki>{{Prevnext2</nowiki><br><nowiki>
+
<code>{{Prevnext2
| nextpage=path/to/article</nowiki><br><nowiki>
+
| nextpage=path/to/article
| prevpage=path/to/lastsection</nowiki><br><nowiki>
+
| prevpage=path/to/lastsection
}}</nowiki>'''</tt>
+
}}</code>
  
 
will render as:
 
will render as:
 
+
----
 
{{Prevnext2
 
{{Prevnext2
 
| nextpage=path/to/article
 
| nextpage=path/to/article
 
| prevpage=path/to/lastsection
 
| prevpage=path/to/lastsection
 
}}
 
}}
 +
----
  
 
This might be useful in some situations. But often it looks ugly, so try to specify link text whenever you can!
 
This might be useful in some situations. But often it looks ugly, so try to specify link text whenever you can!
 +
 +
== Template source code ==
 +
<code>
 +
<table align=center id=toc style="width: 95%" class="noprint"><tr>
 +
<td style="text-align: left; width: 33%">{{#if: {{{prevpage|}}} | [[{{{prevpage}}}|&larr; {{{prevtext|{{{prevpage}}}}}}]] | }}</td>
 +
<td style="text-align: center; width:  33%">'''{{PAGENAME}}'''</td>
 +
<td style="text-align: right; width: 33%">{{#if: {{{nextpage|}}} | [[{{{nextpage}}}|{{{nexttext|{{{nextpage}}}}}}&rarr;]] | }}</td>
 +
</tr></table></code>
  
 
[[Category:Template]]
 
[[Category:Template]]

Revision as of 04:29, 3 June 2010

Template:I18n/Language Navigation Bar

Use this template when you want to provide links to the previous and the next sections of the article so the user isn't forced to go back to the index to navigate.


How to use this template

Write

which will be returned as,



Optional arguments

The arguments in this template are optional. That is, if there is no previous page to link to, you don't have to include it in the template. You can just write this:

Which would be rendered as:



This works the other way around, too. This:

is rendered as:



Omitting link descriptions

Finally, the link description text doesn't have to be specified, either. The text will default to the name of the article you are linking to. So, the following syntax,

will render as:



This might be useful in some situations. But often it looks ugly, so try to specify link text whenever you can!

Template source code

Prevnext2

Content is available under Creative Commons License SA 4.0 unless otherwise noted.