Examples/Parameter: titlelt (example 2)
Example
[edit source]This example creates navigation between pages in category Category:Fruit examples, by combining three templates: {{previous}}, {{next}}, and {{navigation}}.
Previous Content
[edit source]The {{previous}} template contains content similar to:
- Code
{{#dpl:
|category = {{{category|}}}
|namespace =
|titlelt = {{PAGENAME}}
|mode = inline
|format = ,<div style="text-align: left;">[[File:Double arrow left.png|25px|link=%PAGE%|alt=<]] [[%PAGE%|%TITLE%]]</div>,
|ordermethod = title
|order = descending
|count = 1
}}
- Result
Specifying category as {{{category|}}} passes the category parameter value to DPL3 to select pages from a specific category, in the Main namespace by default, whose title is to the left of titlelt, or before (alphabetically), the current page title (without Namespace due to the {{PAGENAME}} Magic word). The mode inline is used for formatting which nullifies the default bulleted list, and manually specifies the format. The ordermethod for sorting is set to title with an order of descending, and the count is limited to 1 result using an arrow image with page title beside it, both are linked to the previous page title.
Next Content
[edit source]The {{next}} template contains content similar to:
- Code
{{#dpl:
|category = {{{category|}}}
|namespace =
|titlegt = {{PAGENAME}}
|mode = inline
|format = ,<div style="text-align: right;">[[File:Double arrow.png|25px|link=%PAGE%|alt=>]] [[%PAGE%|%TITLE%]]</div>,
|ordermethod = title
|order = ascending
|count = 1
}}
- Result
The above functions the same as the {{previous}} template, only the title to the right |titlegt={{PAGENAME}} fetches the page title after, or next to (alphabetically), the current page title (without Namespace) and the order set to ascending.
Navigation Content
[edit source]The {{navigation}} template contains content similar to:
- Code
{| style="width: 100%; border: 1px solid lightgrey; background: #e9f4f9;"
| style="width: 40%;" | {{previous|category={{{category|}}}}}
| style="width: 20%; text-align: center;" | [[:Category:{{{category|}}}|{{{category|}}}]]
| style="width: 40%;" | {{next|category={{{category|}}}}}
|}
- Result
| [[:Category:|]] |
This template creates a wikitable and formats it as a navigation bar, It then calls the {{previous}} and {{next}} DPL3 templates in the first and last columns of the 3 column table. The {{{category|}}} parameter passes the |category=Fruit examples value (see next section) to both the {{previous}} and {{next}} templates, which then feed it to the DPL3 statement in each template. The middle column is used to link to the specified category page.
Combined use on-page
[edit source]The navigation template is used on a page and passes the Fruit examples category name as follows:
- Code
{{navigation|category=Fruit examples}}
- Result
| Fruit examples |