Anonymous user
Other parameters: Difference between revisions
Fixes and edits
imported>FrozenPlum m (Fix a couple more things I couldn't see on first edit) |
imported>FrozenPlum (Fixes and edits) |
||
Line 13:
<code>debug=<i>n</i></code>, where ''n'' is one of:
* <code>''0''</code>
* <code>''1''</code>
* <code>''2''</code>
* <code>''3''</code>
* <code>''4''</code>
* <code>''5''</code>
'''If the debug
Line 36:
This outputs the error for the first namespace: ''Media'' is not a valid namespace value (pseudo-namespace). Assuming the default debug value (2) hasn't been changed, a warning is also displayed: <code>debug=1</code> is not input first (before <code>namespace=Media</code>). So, it did not apply to <code>namespace=Media</code> but only to what's after. Indeed, the warning for the second namespace (''Special'') is not given, since <code>debug=0</code> changed debug settings to silent mode.
<code>debug=1</code>
Line 51:
<code>allowcachedresults=''value''</code> where ''value'' is one of:
* <code>''true''</code>
* <code>''false''</code>
All queries are cached by default to reduce server load, as generally articles do not change often enough to require updating every page load. If immediate updates are required every page load, then set this parameter to false.
Line 61:
{{DPL Parameter
|name = cacheperiod
|purpose=
}}
Line 67:
'''Syntax:'''
<code>cacheperiod=''number of seconds''</code>
Line 73:
{{DPL Parameter
|name = goal
|purpose= Set the
}}
Line 80:
<code>goal=''goaltype''</code> where ''goaltype'' can be one of:
* <code>''pages''</code>
* <code>''categories''</code>
If the goal parameter is set to 'categories' the list of pages is still be produced, but is not seen. Instead, it is
This allows the asking of question like: Given all pages that are a member of category ''X'' with a title matching ''"y%"'' and which use template ''"Z"'': to which categories do these pages belong?
Line 96:
The output of
Line 107:
{{DPL Parameter
|name = eliminate
|purpose= Suppress references to pages, templates, images, categories in
}}
Line 118:
* <code>''images''</code>
* <code>''links''</code>
* <code>''all''</code>
The output of a
*
* It shares ('adopts') their use of templates.
* It shares their references to images.
* It shares their references to other articles.
In some cases, this may be useful. But in many cases, this is not wanted. Especially when
The <code>eliminate</code> parameter
For further explanation, see <code>{{DPL|reset}}</code>.
'''Note:''' The use of <code>eliminate</code> needs a considerable amount of extra computing power as it performs a second parser step for each included document.
Line 140:
{{DPL Parameter
|name = reset
|purpose= Suppress references to pages, templates, images, categories in
}}
Line 147:
<code>reset=''keyword,..''</code>, where ''keyword'' is one of:
* <code>''categories''</code>
* <code>''templates''</code>
* <code>''images''</code>
* <code>''links''</code>
* <code>''all''</code>
The output of a
*
*
*
*
In some cases, this may be useful. But in many cases, this is not wanted. Especially when
The <code>reset</code> parameter
There are some subtle differences here depending on the mode in which DPL3 is used. These differences affect the question of how links, and categories etc., are treated which are direct part of the document containing the DPL3 query.
Line 177:
To avoid the above described effect of <code>reset</code> on one's 'own' links, <code>{{DPL|eliminate}}</code> can be used. However, it is important to note that ''eliminate'' is rather expensive in terms of computer power, as it does a second parse for all included contents.
Using <code>reset</code> in parser function mode clears everything, regardless of whether it comes from included contents or whether it is direct part of the document containing the DPL3 query.
To avoid the above described effect of <code>reset</code>, <code>{{DPL|eliminate}}</code> can be used. However, ''eliminate'' is rather expensive in terms of computing power, as it does a second parse for all included contents. The extra parser step is conducted as soon
If there is '''more than one DPL3 query''' in a page, the effects depend on the exact mode (parser extension or parser function mode), on the sequence of the statements and on the presence of 'reset' or 'eliminate' statements in each of the queries and on their individual arguments. As this is a very rare case, only a simple rule of thumb is given here: Once 'reset' is used in parser function mode or
Line 215:
Use multiple commands to assign the article to more than one category.
If <code>reset=all</code> or <code>reset=categories</code> are used, the article containing the DPL3 statement is not be recorded in the
As a side effect of using <code>reset=all</code>, the article
Line 235:
If no wiki text is given, the command
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 starting with <code>DPL_</code> into variables, which can then be accessed via #var (if the [[mw:Extension:Variables|Variables]] extension is installed) or via #dplvar.
Using this command, DPL3 can be prevented from executing a database query; this may be useful if
A typical use would look like this (note the double pipe symbols within the #if.
Calling the following page with &DPL_cat=Country would list countries, omitting the <code>&cat</code> parameter would trigger the error text message (without DPL3 going to the database):
<pre><nowiki>
{{#dpl:execandexit=geturlargs}}
Line 257:
'''See also:''' [[Template:Extension DPL scroll]] and {{DPL|scrolling}}.
'''Note:''' <code>execandexit</code> acts like a short-circuit evaluation. This means, for example, that successive statements to influence caching
Line 278:
''rule'';
Where ''rule'' is one of the following:
# '''Rules for batch update of articles'''
#* A DPL3 query can select a group of articles and perform updates, like inserting a piece of text at a certain position, or changing text portions based on regular expressions.
Line 327:
====before ''pattern'';====
Defines locations where text will be inserted. The location(s)
The regexp will implicitly be enclosed in slashes. Hence, literal slash characters must be escaped by backslashes.
Line 333:
====after ''pattern'';====
Defines locations where text will be inserted. The location(s)
The regexp will implicitly be enclosed in slashes. Hence, literal slash characters must be escaped by backslashes.
Line 341:
Defines the text to be inserted.
A DPL3 statement may contain replacement, insertion, before, and after at the same time.
<pre>
replace /([a-z]+])-cat/;
by \1-dog;
Line 348 ⟶ 349:
after foo;
insert bar2;
</pre>
Only one
Line 356 ⟶ 358:
The name of the template; the prefix "Template:" must be given.
The regexp will implicitly be enclosed in slashes. Hence, literal slash characters must be escaped by backslashes.
<pre>
after ''pattern'';
insert ''text'';
replace ''pattern'';
by ''replacement'';
</pre>
For safety reasons, the update statements are only performed if "exec yes" is specified. So, leaving this away, what would happen if the update were to be executed can be checked.
Note that if "exec yes" is present, the update is performed each time the page is rendered which contains the DPL3 statement
The size of the form fields
<!--To make the use of the <code>updaterules</code> feature easier, we provide a [[Template:Bulk Update|special user interface]].
Line 390 ⟶ 394:
This command is experimental at the moment.
This
[[Category:Primary Module|05]]
|