Other parameters: Difference between revisions

Content added Content deleted
imported>FrozenPlum
(Fixes and edits)
imported>FrozenPlum
(Add example)
Line 13: Line 13:


<code>debug=<i>n</i></code>, where ''n'' is one of:
<code>debug=<i>n</i></code>, where ''n'' is one of:
* <code>''0''</code> – Silent mode, shows nothing
* <code>''0''</code> – Silent mode, shows nothing.
* <code>''1''</code> – Quiet mode, shows (fatal) errors
* <code>''1''</code> – Quiet mode, shows (fatal) errors.
* <code>''2''</code> – Default mode, like 1 + shows warnings; – '''(default)'''
* <code>''2''</code> – Default mode, like 1 + shows warnings; – '''(default)'''.
* <code>''3''</code> – Verbose mode, like 2
* <code>''3''</code> – Verbose mode, like 2.
* <code>''4''</code> – Dump raw SQL Query; only if ''$wgDebugDumpSql'' is set to true.
* <code>''4''</code> – Dump raw SQL Query; only if ''$wgDebugDumpSql'' is set to true.
* <code>''5''</code> – Show wiki text output from DPL3 instead of parsed wiki text.
* <code>''5''</code> – Show wiki text output from DPL3 instead of parsed wiki text.
Line 24: Line 24:




'''Example:'''<br><br><!-- transclude example from subpage-->{{#lsth:Examples/Module: debug (example 1)|Example}}
'''Example:'''
{{ViewTest|Examples|Module: debug (example 1)}}


<pre><nowiki>
{{#dpl:
| namespace = Media
| debug = 0
| namespace = Special
}}
</nowiki></pre>

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.

DPL3 debug messages are translatable in ''DynamicPageList2.i18n.php''.


'''Notes:'''
<code>debug=1</code> suppresses warning messages (e.g., if the result set of a DPL3 query is empty). As an alternative, the <code>{{DPL|suppresserrors}}=</code> statement can be used.
* DPL3 debug messages are translatable in ''DynamicPageList2.i18n.php''.
* <code>debug=1</code> suppresses warning messages (e.g., if the result set of a DPL3 query is empty). As an alternative, the <code>{{DPL|suppresserrors}}=</code> statement can be used.




Line 52: Line 44:
<code>allowcachedresults=''value''</code> where ''value'' is one of:
<code>allowcachedresults=''value''</code> where ''value'' is one of:
* <code>''true''</code> – ('''default''', need not be set)
* <code>''true''</code> – ('''default''', need not be set)
* <code>''false''</code>
* <code>''false''</code> – prevent caching




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. Cache period is handled by the <code>{{DPL|cacheperiod}}</code> parameter.
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. Cache period is handled by the <code>{{DPL|cacheperiod}}</code> parameter.




Line 67: Line 59:
'''Syntax:'''
'''Syntax:'''


<code>cacheperiod=''number of seconds''</code> – ('''default''' is 3600, meaning 1 hour)
<code>cacheperiod=''number of seconds''</code> – ('''default''' is 3600, meaning 1 hour).