Other parameters: Difference between revisions

m
Fix a couple more things I couldn't see on first edit
imported>FrozenPlum
(Some minor fixes)
imported>FrozenPlum
m (Fix a couple more things I couldn't see on first edit)
Line 9:
}}
 
 
'''Syntax:'''
 
<code>debug=<i>n</i></code>, where ''n'' is one of:
Line 18 ⟶ 19:
* <code>''4''</code> &mdash; Dump raw SQL Query; only if ''$wgDebugDumpSql'' is set to true.
* <code>''5''</code> &mdash; Show wiki text output from DPL instead of parsed wiki text.
 
 
'''If debug param is used, but not in first position in the DPL element, the new debug settings are not applied before all previous parameters have been parsed and checked.''' This will generate a warning for <code>debug=2</code> and above.
 
 
'''Example:'''
 
<pre><nowiki>
Line 43 ⟶ 46:
|purpose= Cache query results to improve performance, keep servers from crashing under high load.
}}
 
 
'''Syntax:'''
 
<code>allowcachedresults=''value''</code> where ''value'' is one of:
 
* <code>''true''</code> &mdash; ('''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 59 ⟶ 63:
|purpose= Define the expiration period for the dplcache
}}
 
 
'''Syntax:'''
Line 70 ⟶ 75:
|purpose= Set the overall goal for DPL to either show '''pages''' (default) or '''categories''' these pages belong to
}}
 
 
'''Syntax:'''
Line 79 ⟶ 85:
 
DPL produces a list of pages by default, and this is precisely what the name DPL promises.
 
 
If the goal parameter is set to 'categories' the list of pages is still be produced, but is not seen. Instead, it is be used to '''calculate a unique ordered list of all categories these pages belong to'''.
 
 
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?
 
 
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 all DPL formatting options can be used (mode=userformat, listseparators, columns etc.) and pseudo variables (<code>%TITLE%</code>, <code>%PAGE%</code>) to customize the layout of the report.
 
 
'''Technical Note:'''
Line 98 ⟶ 109:
|purpose= Suppress references to pages, templates, images, categories in DPL output
}}
 
 
'''Syntax:'''
 
<code>eliminate=''keyword,..''</code> where ''keyword'' is one of:
 
* <code>''categories''</code>
* <code>''templates''</code>
Line 108 ⟶ 119:
* <code>''links''</code>
* <code>''all''</code> &mdash; 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 114 ⟶ 126:
* shares their references to images
* shares their references to other articles
 
 
In some cases, this may be useful. But in many cases, this is not wanted. Especially when DPL is used to create a printable document which contains the full text of other articles, duplicating all links, template uses etc., of those articles is probably undesired.
Line 121 ⟶ 134:
For further explanation, see {{DPL|reset}}.
 
Please'''Note:''' note that theThe 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 129 ⟶ 142:
|purpose= Suppress references to pages, templates, images, categories in DPL output
}}
 
 
'''Syntax:'''
Line 138 ⟶ 152:
*<code>''links''</code>
*<code>''all''</code> &mdash; 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 144 ⟶ 159:
* that it shares their references to images
* 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 DPL is used to create a printable document which contains the full text of other articles, duplicateing all links, template uses etc., of those articles is probably undesired.
Line 159 ⟶ 175:
...
</nowiki></pre>
 
 
<u>In parser extension mode (DPL3 '''tag''' like &lt;DPL&gt;):</u>
Line 165 ⟶ 182:
;reset=templates: will ignore templates used in included contents but keep 'own' template usage ('Q Template').
;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.
 
 
To avoid the above described effect of <code>reset</code> on one's 'own' links, {{DPL|eliminate}} 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.
 
<u>In parser function mode ('''<nowiki>{{#DPL:....}}</nowiki>'''):</u>
 
<u>In parser function mode ('''<nowiki>{{#DPL:....}}</nowiki>'''):</u>
;reset=categories: will ignore all categories
;reset=images: will throw away all references to images
;reset=templates: will ignore all template invocations
;reset=links: will throw away all references to other pages
 
 
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.
Line 187 ⟶ 206:
|purpose= Assign the article containing a DPL3 statement to a category, although <code>reset</code> was used.
}}
 
 
'''Syntax:'''
 
<code>fixcategory=''category name''</code>
 
 
Use multiple commands to assign the article to more than one category.
Line 204 ⟶ 226:
|purpose= Process the command given as an argument and then exit immediately.
}}
 
 
'''Syntax:'''
Line 210 ⟶ 233:
<br>or<br>
<code>execandexit=''geturlargs''</code>
 
 
If no wiki text is given, the command will be ignored. Otherwise, DPL3 will output the wiki text and exit immediately.
Line 217 ⟶ 241:
 
Using this command, DPL3 can be prevented from executing a database query; this may be useful if a necessary parameter was not given by the user. Note that an ''#if'' function call would NOT help in that case because ''#if'' evaluates its complete content before taking the "if" or the "else" path. So, emebdding a DPL3 call within a #if is much less efficient than using the ''execandexit'' function.
 
 
A typical use would look like this (note the double pipe symbols within the #if.
Line 231 ⟶ 256:
</nowiki></pre>
 
See also: [[Template:Extension DPL scroll]] and {{DPL|scrolling}}
 
''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 behaviour (like {{DPL|allowcachedresults}}) will not be interpreted.
 
 
'''Note:''' <code>execandexit</code> acts like a short-circuit evaluation. This means, for example, that successive statements to influence caching behaviour (like {{DPL|allowcachedresults}}) will not be interpreted.
 
 
Line 242 ⟶ 269:
{{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:'''
Line 251 ⟶ 279:
 
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.
Anonymous user