Template:DPL: Difference between revisions

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


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


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

}}|{{{1}}}]]</includeonly></onlyinclude>
| userformat
| 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 05:02, 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 mode
  • {{DPL|mode|alternate label}} gives mode
  • {{DPL|mode|DPL format statement}} gives format
  • {{DPL|#dplnum}} gives #dplnum
  • {{DPL|non-existing page}} gives non-existing page

To include parameter values:

  • {{DPL|mode}} followed by [[=userformat]] gives mode=userformat (with redirect created from =userformat to mode)
  • Just doing {{DPL|mode}}=userformat is also fine, resulting in mode=userformat
[view | edit | purge]The above documentation is transcluded from Template:DPL/doc.