Other parameters: Difference between revisions

Content added Content deleted
m (clean up, typos fixed: won´t → won't, fuction → function)
Line 316: Line 316:
Note that the wiki text may be a parser function call which evaluates to an empty string.
Note that the wiki text may be a parser function call which evaluates to an empty string.


The special word ''geturlargs'' can be used as a wiki text to transform URL arguments into variables which can then be accessed via #var (if the Variables extension is installed) or via #dplvar.
The special word ''geturlargs'' can be used as a wiki text to transform URL arguments starting with <code>DPL_</code> into variables which can then be accessed via #var (if the Variables extension is installed) or via #dplvar.
Purpose:
Purpose:
Line 323: Line 323:


A typical use would look like this (note the double pipe symbols within the #if.
A typical use would look like this (note the double pipe symbols within the #if.
Calling the following page with &cat=Country would list countries, omitting the &cat parameter would trigger the error text mnessage (without DPL going to the database):
Calling the following page with &DPL_cat=Country would list countries, omitting the &cat parameter would trigger the error text message (without DPL going to the database):
<pre><nowiki>
<pre><nowiki>
{{#dpl:execandexit=geturlargs}}
{{#dpl:execandexit=geturlargs}}
{{#dpl:
{{#dpl:
| execandexit = {{#if:{{#dplvar:cat}}||please specify a category via &cat= in the URL!}}
| execandexit = {{#if:{{#dplvar:DPL_cat}}||please specify a category via &DPL_cat= in the URL!}}
| resultsheader = pages in category {{#dplvar:cat}}:\n
| resultsheader = pages in category {{#dplvar:DPL_cat}}:\n
| noresultsheader = there are no pages in category {{#dplvar:cat}}.\n
| noresultsheader = there are no pages in category {{#dplvar:DPL_cat}}.\n
| count = 5
| count = 5
| category = {{#dplvar:cat}}
| category = {{#dplvar:DPL_cat}}
}}
}}
</nowiki></pre>
</nowiki></pre>