Template:DPL: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
mNo edit summary
imported>FrozenPlum
m (Retest a swap to DPLvar, the underscore was problematic before)
Line 1: Line 1:
<onlyinclude><includeonly>[[{{#switch: {{{1}}}
<onlyinclude><includeonly>{{#dplvar:set|page2}}<!--
-->{{#vardefine:page|
{{#switch: {{{1}}}
| #dplvar = Dplvar
| #dplvar = Dplvar
| #dplnum = Dplnum
| #dplnum = Dplnum
Line 135: Line 137:
| dplcacheperiod = Other parameters
| dplcacheperiod = Other parameters


| #default =
<!-- General use and invocation syntax -->
}}}}<!--
| syntax = General usage and invocation syntax


-->{{#ifeq:{{#dplvar:page}}|<!--
| #default = {{{1}}}
-->|{{#dplvar:set|page2|
}}{{#switch: {{{1|test}}}
{{#switch: {{{1}}}
| #dplvar
<!-- Other pages These links will have a different formatting than the links in the list above-->
| #dplnum
| Characters with special meaning
| #dplreplace
| Scrolling
| #dplmatrix
| URL parameters = General usage and invocation syntax
| #dplchapter =

| #default = &#35;{{{1}}}
| userformat
}}|{{{1}}}]]</includeonly></onlyinclude>
| VARIABLES = Controlling output format

| Select articles based on REVISION dates
| REVISION
| Criteria for page selection
| selection criteria = Criteria for page selection

| #default =
}}}}
|<span class=dpl3><!-- Those found in the first list (dpl parameters and functions) will be formatted differently than those found in the second list
-->}}<!--

-->{{#ifeq:{{#dplvar:page}}{{#dplvar:page2}}|<!-- if not on either list
-->|{{#if:{{#pos:{{lc:{{{1}}}}}|example}}{{#pos:{{lc:{{{1}}}}}|test}}<!-- if either an example or a test (on another page)
-->|{{ifexists|Example:_{{{1}}} <!-- calls a dpl which may be slower? than the previous {{#if:{{#pos statement
-->|[[Example:_{{{1}}}|{{{2|{{{text|{{{1}}}}}}}}}]]<!-- only if the page exists
-->|{{#tag:span|{{{1}}} not found|style=color:red}} <!-- <-if {{{1}}} isn't on the list, and the page doesn't exist.
-->}}<!--
-->|{{ifexists|{{{1}}} <!-- calls a dpl which may be slower? than the previous {{#if:{{#pos statement
-->|[[{{{1}}}|{{{2|{{{text|{{{1}}}}}}}}}]]<!-- only if the page exists
-->|{{#tag:span|'{{{1}}}' not found|style=color:red}} <!-- <-if {{{1}}} isn't on the list, and the page doesn't exist.
-->}}<!--
-->}}<!--
-->|{{#if:{{#pos:{{{1}}}|#dpl}}<!--
-->|[[{{#dplvar:page}}|{{{2|{{{text|{{{1}}}}}}}}}]]<!-- DPL functions
-->|[[{{#dplvar:page}}{{#dplvar:page2}}#{{{1}}}|<!--
-->{{#forargs:|p|v|}}{{#if:{{#dplvar:p}}<!-- check for usage of "=" in parameters
-->|{{{2|{{{text|{{{1}}}}}}}}}<!--
-->|{{{1|}}}={{#dplvar:v}}}}<!--
-->]]<!--
-->}}<!--

-->}}<!--
-->{{#ifeq:{{#dplvar:page}}|||</span>}}</includeonly></onlyinclude>
{{Documentation}}
{{Documentation}}

Revision as of 04:51, 31 March 2022

[view | edit | purge]Template Documentation
Formats, and where appropriate, creates a link to the proper dpl parameter, help page, or dpl parser function in the DPL Manual.

Example:

  • {{DPL|mode}} gives {{#dplvar:set|page2}}{{#vardefine:page|

Controlling output format}}[[{{#dplvar:page}}|mode]]

  • {{DPL|mode|alternate label}} gives {{#dplvar:set|page2}}{{#vardefine:page|

Controlling output format}}[[{{#dplvar:page}}|alternate label]]

  • {{DPL|mode|DPL format statement}} gives {{#dplvar:set|page2}}{{#vardefine:page|

Controlling output format}}[[{{#dplvar:page}}|DPL format statement]]

  • {{DPL|#dplnum}} gives {{#dplvar:set|page2}}{{#vardefine:page|

Dplnum}}[[{{#dplvar:page}}|#dplnum]]

  • {{DPL|non-existing page}} gives {{#dplvar:set|page2}}{{#vardefine:page|

}}[[{{#dplvar:page}}|non-existing page]]

To include parameter values:

  • {{DPL|mode}} followed by [[=userformat]] gives {{#dplvar:set|page2}}{{#vardefine:page|

Controlling output format}}[[{{#dplvar:page}}|mode]]=userformat (with redirect created from =userformat to mode)

  • Just doing {{DPL|mode}}=userformat is also fine, resulting in {{#dplvar:set|page2}}{{#vardefine:page|

Controlling output format}}[[{{#dplvar:page}}|mode]]=userformat

[view | edit | purge]The above documentation is transcluded from Template:DPL/doc.