Other parameters: Difference between revisions

Content added Content deleted
imported>FrozenPlum
(Add example)
imported>FrozenPlum
m (Fix formatting in a few places, still need to split out some examples but first will have to test the fix to %TOTALPAGES% used for scroll behaviour)
Line 12: Line 12:
'''Syntax:'''
'''Syntax:'''


<code>debug=<i>n</i></code>, where ''n'' is one of:
<code>debug=<i>n</i></code>, where {{tt|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.
Line 21: Line 21:




'''If the debug parameter is used, but not in first position in the DPL3 element, the new debug settings are not applied before all previous parameters have been parsed and checked.''' This generates a warning for <code>debug=2</code> and above.
{{note|'''Note:''' If the debug parameter is '''not''' used in the first position of the DPL3 statement, the new debug settings are not applied before all previous parameters have been parsed and checked.''' This generates a warning for <code>debug{{=}}2</code> and above.}}




Line 30: Line 30:
'''Notes:'''
'''Notes:'''
* DPL3 debug messages are translatable in ''DynamicPageList2.i18n.php''.
* 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.
* <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 42: Line 42:
'''Syntax:'''
'''Syntax:'''


<code>allowcachedresults=''value''</code> where ''value'' is one of:
<code>allowcachedresults=''value''</code> where {{tt|value}} is one of:
* <code>''true''</code> – ('''default''', need not be set)
* <code>''true''</code> – ('''default''', need not be set).
* <code>''false''</code> – prevent caching
* <code>''false''</code> – prevent caching.




Line 53: Line 53:
{{DPL Parameter
{{DPL Parameter
|name = cacheperiod
|name = cacheperiod
|purpose= Defines the expiration period for the DPL3 cache
|purpose= Defines the expiration period for the DPL3 cache.
}}
}}


Line 65: Line 65:
{{DPL Parameter
{{DPL Parameter
|name = goal
|name = goal
|purpose= Set the goal for DPL3 to either show '''pages''' (default) or '''categories''' these pages belong to
|purpose= Set the goal for DPL3 to either show '''pages''' (default) or '''categories''' these pages belong to.
}}
}}


Line 71: Line 71:
'''Syntax:'''
'''Syntax:'''


<code>goal=''goaltype''</code> where ''goaltype'' can be one of:
<code>goal=''goaltype''</code> where {{tt|goaltype}} can be one of:
* <code>''pages''</code> – ('''default''', need not be set)
* <code>''pages''</code> – ('''default''', need not be set).
* <code>''categories''</code>
* <code>''categories''</code>.




Line 105: Line 105:
'''Syntax:'''
'''Syntax:'''


<code>eliminate=''keyword,..''</code> where ''keyword'' is one of:
<code>eliminate=''keyword,..''</code> where {{tt|keyword}} is one of:
* <code>''categories''</code>
* <code>''categories''</code>
* <code>''templates''</code>
* <code>''templates''</code>
Line 114: Line 114:


The output of a DPL3 statement typically creates links to all pages which are part of the result set. The inclusion of contents from other pages via DPL3 (using <code>{{DPL|include}}</code>) normally has these consequences:
The output of a DPL3 statement typically creates links to all pages which are part of the result set. The inclusion of contents from other pages via DPL3 (using <code>{{DPL|include}}</code>) normally has these consequences:
* The page containing the DPL3 query becomes part of the categories of the transcluded page
* The page containing the DPL3 query becomes part of the categories of the transcluded page.
* It shares ('adopts') their use of templates.
* It shares ('adopts') their use of templates.
* It shares their references to images.
* It shares their references to images.
Line 138: Line 138:
'''Syntax:'''
'''Syntax:'''


<code>reset=''keyword,..''</code>, where ''keyword'' is one of:
<code>reset=''keyword,..''</code>, where {{tt|keyword}} is one of:
* <code>''categories''</code>
* <code>''categories''</code>
* <code>''templates''</code>
* <code>''templates''</code>
Line 170: Line 170:


'''In parser extension mode''' (tag like <code><nowiki><dpl></nowiki></code>):
'''In parser extension mode''' (tag like <code><nowiki><dpl></nowiki></code>):
* <code>reset=categories</code> – Ignores categories of included contents but keeps 'own' categories like 'Q Cat'.
* <code>reset=''categories''</code> – Ignores categories of included contents but keeps 'own' categories like 'Q Cat'.
* <code>reset=images</code> – Throws away references to images contained in included contents but keeps 'own' images like 'Q Image'.
* <code>reset=''images''</code> – Throws away references to images contained in included contents but keeps 'own' images like 'Q Image'.
* <code>reset=templates</code> – Ignores templates used in included contents but keeps 'own' template usage ('Q Template').
* <code>reset=''templates''</code> – Ignores templates used in included contents but keeps 'own' template usage ('Q Template').
* <code>reset=links</code> – Throws away all references to other pages, i.e., links contained in included contents and links like 'Q Link' are ignored. This means all links can be used in the normal "FORWARD" way, but no "BACKLINKS" are available for them.
* <code>reset=''links''</code> – Throws away all references to other pages, i.e., links contained in included contents and links like 'Q Link' are ignored. This means all links can be used in the normal "FORWARD" way, but no "BACKLINKS" are available for them.




Line 180: Line 180:


''' In parser function mode''' (<code><nowiki>{{#dpl:....}}</nowiki></code>):
''' In parser function mode''' (<code><nowiki>{{#dpl:....}}</nowiki></code>):
* <code>reset=categories</code> – Ignores all categories.<br>
* <code>reset=''categories''</code> – Ignores all categories.<br>
* <code>reset=images</code> – Throws away all references to images.
* <code>reset=''images''</code> – Throws away all references to images.
* <code>reset=templates</code> – Ignores all template invocations.
* <code>reset=''templates''</code> – Ignores all template invocations.
* <code>reset=links</code> – Throws away all references to other pages.
* <code>reset=''links''</code> – Throws away all references to other pages.




Line 207: Line 207:
Use multiple commands to assign the article to more than one category.
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 MediaWiki link database. This may be quite useful if an article transcludes content from other pages. Without the <code>{{DPL|reset}}</code> command, the article would appear in a category if a text portion containing an assignment to that category was used.
If <code>reset=''all''</code> or <code>reset=''categories''</code> are used, the article containing the DPL3 statement is not be recorded in the MediaWiki link database. This may be quite useful if an article transcludes content from other pages. Without the <code>{{DPL|reset}}</code> command, the article would appear in a category if a text portion containing an assignment to that category was used.


As a side effect of using <code>reset=all</code>, the article does not appear in a category even if one is literally assigned to it.
As a side effect of using <code>reset=''all''</code>, the article does not appear in a category, even if one is literally assigned to it.
<code>fixcategory</code> allows a category assignment to be made which is not blocked by the <code>reset</code> command.
<code>fixcategory</code> allows a category assignment to be made which is not blocked by the <code>reset</code> command.


Line 355: Line 355:


A regular expression:
A regular expression:

<pre>
after ''pattern'';
after ''pattern'';
insert ''text'';
insert ''text'';
replace ''pattern'';
replace ''pattern'';
by ''replacement'';
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.
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.