Anonymous user
Other parameters: Difference between revisions
Some minor fixes
imported>FrozenPlum (Remove purge note (no longer needed)) |
imported>FrozenPlum (Some minor fixes) |
||
Line 12:
<code>debug=<i>n</i></code>, where ''n'' is one of:
* <code>''0''</code> — Silent mode, shows nothing
* <code>''1''</code> — Quiet mode, shows (fatal) errors
* <code>''2''</code> — Default mode, like 1 + shows warnings; — '''(default)'''
* <code>''3''</code> — Verbose mode, like 2
* <code>''4''</code> — Dump raw SQL Query; only if ''$wgDebugDumpSql'' is set to true.
* <code>''5''</code> — Show wiki text output from DPL instead of parsed wiki text.
'''If
Example:
Line 31:
</nowiki></pre>
This
DPL debug messages are translatable in
<code>debug=1</code> will suppress warning messages (e.g., if the result set of a DPL query is empty). As an alternative,
Line 44:
}}
'''Syntax:'''
<code>allowcachedresults=''value''<
* <code>''true''</code> — ('''default''', need not be set)
* <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. The cache period is handled by the [[#cacheperiod]] parameter.
Line 57:
{{DPL Parameter
|name = cacheperiod
|purpose=
}}
'''Syntax:'''
<code>cacheperiod=
Line 70 ⟶ 68:
{{DPL Parameter
|name = goal
|purpose=
}}
'''Syntax:'''
<code>goal=''goaltype''<
* <code>''pages''</code> — ('''default''', need not be set)
* <code>''categories''</code>
If
This allows
One of the more useful applications would be a question like: "To which categories do the pages belong which contain a reference to the current page?"
The output of "goal=categories" is technically a ''list of pages of type category''. This means that
'''Technical Note:'''
Due to some limitations in MySQL, it is currently not possible to restrict the intermediate result set of pages to a certain maximum (using the LIMIT clause). In addition, the generated SQL code is not in all cases optimal (as its structure provides for complex selection criteria and therefore is unnecessarily complex in simple cases). So be careful and apply precise selection criteria.
Line 97 ⟶ 96:
{{DPL Parameter
|name = eliminate
|purpose=
}}
'''Syntax:'''
* <code>''categories''</code>
* <code>''templates''</code>
* <code>''images''</code>
* <code>''links''</code>
* <code>''all''</code> — a synonym for all of the above
The output of a DPL statement typically creates links to all pages which are part of the result set. The inclusion of contents from other pages via DPL (using {{DPL|include}}) normally has these consequences:
Line 118 ⟶ 115:
* 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 will suppress all or some of the effects described above.
Line 130 ⟶ 127:
{{DPL Parameter
|name = reset
|purpose=
}}
'''Syntax:'''
<code>reset=
*<code>''categories''
*<code>''templates''</code>
*<code>''images''</code>
*<code>''links''
*<code>''all''</code> — a synonym for all of the above
The output of a DPL statement typically creates links to all pages which are part of the result set. The inclusion of contents from other pages via DPL (using 'include') normally has the consequence
Line 148 ⟶ 145:
* that 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>reset</code> parameter will suppress all or some of the effects described above.
There are some subtle differences here depending on the mode in which
Example:
<pre><nowiki>
[[Category:Q Cat]] linking to [[Q Link]] and showing [[Image:Q Image]] and using {{Q Template}}
...
assuming that this contents contains links and images,
that it uses templates and
RESET statement at the end of the
...
</nowiki></pre>
<u>In parser extension mode (
;reset=categories: will ignore categories of included contents but keep 'own' categories like 'Q Cat'.
;reset=images: will throw away references to images contained in included contents but keep 'own' images like 'Q Image'.
Line 169 ⟶ 166:
;reset=links: will throw away all references to other pages, i.e., links contained in included contents and links like 'Q Link' will be ignored. This means that all links can be used in the normal "FORWARD" way, but no "BACKLINKS" are available for them.
<u>In parser function mode ('''<nowiki>{{#DPL:....}}</nowiki>'''):</u>
Line 178 ⟶ 175:
;reset=links: will throw away all references to other pages
If
Line 188 ⟶ 185:
{{DPL Parameter
|name = fixcategory
|purpose=
}}
'''Syntax:'''
<code>fixcategory=
Use multiple commands to assign the article to more than one category.
If
As a side effect of using <code>reset=all</code>
The <code>fixcategory</code> allows
Line 205 ⟶ 202:
{{DPL Parameter
|name = execandexit
|purpose=
}}
'''Syntax:'''
<code>execandexit=
<br>or<br>
<code>execandexit=
If no wiki text is given, the command will be ignored. Otherwise,
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 Variables extension is installed) or via #dplvar.
Using this command,
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 &cat parameter would trigger the error text message (without
<pre><nowiki>
{{#dpl:execandexit=geturlargs}}
Line 244 ⟶ 239:
{{DPL Parameter
|name = updaterules
|purpose=
{{note|'''Important:''' The <code>updaterules</code> feature is intended for wiki expert users only. It is recommended that articles using this statement are '[[mw:Help:Protecting and unprotecting pages|protected]]'.|error}}
}}
'''Syntax:'''
updaterules=
...
Where rule is one of the following:
# '''Rules for batch update of articles'''
#* A
replace ''pattern'';
Line 319 ⟶ 314:
Defines the text to be inserted.
A
replace /([a-z]+])-cat/;
by \1-dog;
Line 327 ⟶ 322:
insert bar2;
Only one 'replace'-'by' sequence, one insertion 'before' and one insertion 'after' can be specified. 'replace' is always executed first, followed by 'insert before' and 'insert after', regardless of the sequence in which the rules appear in the
Line 344 ⟶ 339:
by ''replacement'';
For safety reasons, the update statements
Note that if "exec yes" is present, the update
The size of the form fields will dapt to the size of the displayed content.
<!--To make the use of the <code>updaterules</code> feature easier, we provide a [[Template:Bulk Update|special user interface]].
Note: This template is deliberately not present, as it can apparently alter lots of wiki content. The line above is retained as a comment, since it was part of the original
''text'' is plain text; ''replacement'' is text which may contain references (like \1) to the matching ''pattern'' (provided that this pattern contains match groups).
Line 359 ⟶ 354:
{{DPL Parameter
|name = deleterules
|purpose=
}}
deleterules=
reason
exec ''true'';
This command is experimental at the moment.
|