Template:FindVersionedSubpage: Difference between revisions
Scottviger (talk | contribs) No edit summary |
Scottviger (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>{{#ifexist: {{{1}}}/{{{2}}} | <includeonly>{{#ifexist: {{{1}}}/{{{2}}} | ||
| {{{1}}}/{{{2}}}| {{#dpl:| titlematch = {{{1}}}/% | | {{{1}}}/{{{2}}}| {{#dpl:| namespace = {{NAMESPACE:{{{1}}}}} | ||
| titlelt = {{{1}}}/{{{2}}} | | titlematch = {{PAGENAME:{{{1}}}}}/% | ||
| titlelt = {{PAGENAME:{{{1}}}}}/{{{2}}} | |||
| ordermethod = title | | ordermethod = title | ||
| order = descending | | order = descending | ||
| count = 1 | | count = 1 | ||
| format = ,%PAGE%,, | | format = ,{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}%PAGE%,, | ||
| noresultsfooter = {{#dpl:| titlematch = {{{1}}}/% | | noresultsfooter = {{#dpl:| namespace = {{NAMESPACE:{{{1}}}}} | ||
| titlematch = {{PAGENAME:{{{1}}}}}/% | |||
| ordermethod = title | | ordermethod = title | ||
| order = ascending | | order = ascending | ||
| count = 1 | | count = 1 | ||
| format = ,%PAGE%,, | | format = ,{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}%PAGE%,, | ||
| noresultsfooter = }} | | noresultsfooter = | ||
}} | |||
}} | }} | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
Line 22: | Line 25: | ||
</pre> | </pre> | ||
* '''PageName''': The base name of the page (e.g., "Kernel Documentation"). | * '''PageName''': The base name of the page (e.g., "Kernel Documentation" or "LC:CONFIG_SMP"). | ||
* '''Version''': The version to match (e.g., "v6.2"). | * '''Version''': The version to match (e.g., "v6.2"). | ||
Revision as of 15:30, 21 August 2025
Documentation
This template finds the best-matching versioned subpage based on a given page name and version string.
Usage
{{FindVersionedSubpage|PageName|Version}}
- PageName: The base name of the page (e.g., "Kernel Documentation" or "LC:CONFIG_SMP").
- Version: The version to match (e.g., "v6.2").
Logic
The template follows these rules in order:
- It returns an exact match if a subpage with the given version exists.
- If not, it returns the closest older version.
- If there are no older versions, it returns the oldest available version.
This template requires the DPL3 extension.