Template:Previous: Difference between revisions
Content added Content deleted
imported>FrozenPlum (Create a simple direction template for a DPL3 navigation example) |
imported>FrozenPlum (debug should be at top, not bottom) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1:
<noinclude>Creates previous
|debug={{{debug|0}}}▼
|category={{{category|}}}
|notcategory={{{notcategory|}}}
|namespace={{{namespace|Main}}}
|titlelt={{#titleparts:
|mode=inline
|ordermethod=
|order=
|count=1
|format=,<div style="text-align:left;">[[File:Double arrow left.png|25px|link=%PAGE%]] [[%PAGE%|%TITLE%]]<
▲|debug={{{debug|0}}}
}}</includeonly><noinclude>
==Examples==
<pre>{{
'''Result:''' {{
==Notes==
The <code>#titleparts</code> section of the [[mw:Extension ParserFunctions|ParserFunctions]] page explains that [[mw:Help:Magic Words|Magic Words]] like <code><nowiki>{{PAGENAME}}</nowiki></code>
==See also==
* [[Template:Navigation]]
* [[Template:Next]]
[[Category:Example templates]]
</noinclude>
|
Latest revision as of 02:00, 10 April 2023
Creates previous navigation between items in a specified category. Is written to be embedded in another template to style as a navigation bar, and automatically generate previous page links from whatever the current {{PAGENAME}}
is.
Examples
{{previous|category=Fruit examples}}
Result: {{#dpl: |debug=0 |category=Fruit examples |notcategory= |namespace=Main |titlelt=Previous |mode=inline |ordermethod=title |order=descending |count=1
|format=,
,
}}
Notes
The #titleparts
section of the ParserFunctions page explains that Magic Words like {{PAGENAME}}
occasionally return strings as needlessly HTML-encoded, this formerly caused DPL3 to not return results when page names contain '
and other special characters. Use of {{#titleparts:{{PAGENAME}}}}
HTML-decodes, converting it to plain text.