Other parameters: Difference between revisions

Content added Content deleted
No edit summary
(replaced: tt> → code> (56))
Line 52: Line 52:
The third group of rules is common to both other groups and controls the update process.
The third group of rules is common to both other groups and controls the update process.


The <tt>updaterules</tt> feature is intended for wiki expert users only. It is recommended that articles usind this statement are 'protected':
The <code>updaterules</code> feature is intended for wiki expert users only. It is recommended that articles usind this statement are 'protected':




Line 116: Line 116:
For safety reasons the update statements will only be performed if "exec yes" is specified. So, leaving this away, you can check what would happen if the update were to be executed.
For safety reasons the update statements will only be performed if "exec yes" is specified. So, leaving this away, you can check what would happen if the update were to be executed.


Note that if "exec yes" is present the update will be performed each time the page is rendered which contains the DPL statement with the <tt>updaterules</tt>. So it is advisable to set "exec yes" only via a command line argument and not as part of the statioc article text. Thus you stay in control when the update happens. Typically one would use an URL parameter like ''DPL_arg1'' for that purpose.
Note that if "exec yes" is present the update will be performed each time the page is rendered which contains the DPL statement with the <code>updaterules</code>. So it is advisable to set "exec yes" only via a command line argument and not as part of the statioc article text. Thus you stay in control when the update happens. Typically one would use an URL parameter like ''DPL_arg1'' for that purpose.


The size of the form fields will dapt to the size of the displayed content.
The size of the form fields will dapt to the size of the displayed content.
Line 123: Line 123:




To make the use of the <tt>updaterules</tt> feature easier we provide a [[Template:Bulk Update|special user interface]].
To make the use of the <code>updaterules</code> feature easier we provide a [[Template:Bulk Update|special user interface]].


''text'' is plain text; ''replacement'' is text which may contain references (like \1) to the matching ''pattern'' (provided that this pattern contains match groups).
''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 209: Line 209:
In some cases this may be useful. But in many cases this is not wanted. Especially when you use DPL to create a printable document which contains the full text of other articles you will probably not want to duplicate all links, template uses etc. of those articles.
In some cases this may be useful. But in many cases this is not wanted. Especially when you use DPL to create a printable document which contains the full text of other articles you will probably not want to duplicate all links, template uses etc. of those articles.


The <tt>reset</tt> parameter will suppress all or some of the effects described above.
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 you use DPL. These differences affect the question how links, and categories etc. are treated which are direct part of the document containing the DPL query.
There are some subtle differences here depending on the mode in which you use DPL. These differences affect the question how links, and categories etc. are treated which are direct part of the document containing the DPL query.
Line 228: Line 228:
;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.
;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.


If you want to avoid the above described effect of <tt>reset</tt> on your 'own' links you can use <tt>[[eliminate]]</tt>. But you should know that ''eliminate'' is rather expensive in terms of computer power as it does a second parse for all included contents.
If you want to avoid the above described effect of <code>reset</code> on your 'own' links you can use <code>[[eliminate]]</code>. But you should know that ''eliminate'' is rather expensive in terms of computer power as it does a second parse for all included contents.




Line 238: Line 238:
;reset=links: will throw away all references to other pages
;reset=links: will throw away all references to other pages


As you see, using <tt>reset</tt> in parser function mode will clear everything regardless whether it comes from included contents or whether it is direct part of the document containing the DPL query.
As you see, using <code>reset</code> in parser function mode will clear everything regardless whether it comes from included contents or whether it is direct part of the document containing the DPL query.


If you want to avoid the above described effect of <tt>reset</tt>, you can use <tt>[[eliminate]]</tt>. But you should know that ''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 as you specify <tt>eliminate</tt>. In terms of extra processing needed it does not make a difference whether you specify one or more arguments for the 'eliminate' command.
If you want to avoid the above described effect of <code>reset</code>, you can use <code>[[eliminate]]</code>. But you should know that ''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 as you specify <code>eliminate</code>. In terms of extra processing needed it does not make a difference whether you specify one or more arguments for the 'eliminate' command.


If you have '''more than one DPL query''' in a document the effects will 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 we only give a simple rule of thumb here: Once you have used 'reset' in parser function mode or 'reset=links' in parser extension mode the effect of these statements will dominate the rest.
If you have '''more than one DPL query''' in a document the effects will 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 we only give a simple rule of thumb here: Once you have used 'reset' in parser function mode or 'reset=links' in parser extension mode the effect of these statements will dominate the rest.
Line 249: Line 249:
{{DPL Parameter
{{DPL Parameter
|name = fixcategory
|name = fixcategory
|purpose= assign the article containing a DPL statement to a category although <tt>reset</tt> was used.
|purpose= assign the article containing a DPL statement to a category although <code>reset</code> was used.
}}
}}


Line 257: Line 257:
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 you use <tt>reset=all</tt> or <tt>reset=categories</tt> the article containing your DPL statement will not be recorded in the mediawiki link database. This may be quite useful if your article transcludes content from other pages. Without the <tt>reset</tt> command your article would appear in a category if you included a text portion containing an assignment to that category.
If you use <code>reset=all</code> or <code>reset=categories</code> the article containing your DPL statement will not be recorded in the mediawiki link database. This may be quite useful if your article transcludes content from other pages. Without the <code>reset</code> command your article would appear in a category if you included a text portion containing an assignment to that category.


As a side effect of using <tt>reset=all</tt> your article will not appear in a category even if you literally assign it to one.
As a side effect of using <code>reset=all</code> your article will not appear in a category even if you literally assign it to one.
The <tt>fixcategory</tt> allows you to make a category assignment which is not blocked by the [[reset]] command.
The <code>fixcategory</code> allows you to make a category assignment which is not blocked by the [[reset]] command.


===eliminate===
===eliminate===
Line 273: Line 273:
<code>eliminate=keyword,..</code>
<code>eliminate=keyword,..</code>


Where <tt>keyword</tt> is one of:
Where <code>keyword</code> is one of:


* <tt>categories</tt>
* <code>categories</code>
* <tt>templates</tt>
* <code>templates</code>
* <tt>images</tt>
* <code>images</code>
* <tt>links</tt>
* <code>links</code>
* <tt>all</tt> &mdash; a synonym for all of the above
* <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 <tt>[[include]]</tt>) normally has these consequences:
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 <code>[[include]]</code>) normally has these consequences:
* the page containing the DPL query becomes part of the categories of the transcluded page
* the page containing the DPL query becomes part of the categories of the transcluded page
* shares ('adopts') their use of templates
* shares ('adopts') their use of templates
Line 289: Line 289:
In some cases this may be useful. But in many cases this is not wanted. Especially when you use DPL to create a printable document which contains the full text of other articles you will probably not want to duplicate all links, template uses etc. of those articles.
In some cases this may be useful. But in many cases this is not wanted. Especially when you use DPL to create a printable document which contains the full text of other articles you will probably not want to duplicate all links, template uses etc. of those articles.


The <tt>eliminate</tt> parameter will suppress all or some of the effects described above.
The <code>eliminate</code> parameter will suppress all or some of the effects described above.


For further explanation see <tt>[[reset]]</tt>.
For further explanation see <code>[[reset]]</code>.


Please note that the use of <tt>eliminate</tt> needs a considerable amount of extra computing power as it performs a second parser step for each included document.
Please note that 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.


===debug===
===debug===
Line 328: Line 328:
DPL debug messages are translatable in <code>DynamicPageList2.i18n.php</code>. See also [[#Internationalization]].
DPL debug messages are translatable in <code>DynamicPageList2.i18n.php</code>. See also [[#Internationalization]].


'debug=1' will suppress warning messages (e.g. if the result set of a DPL query is empty). As an alternative, you can use the <tt>[[suppresserrors]]</tt> statement.
'debug=1' will suppress warning messages (e.g. if the result set of a DPL query is empty). As an alternative, you can use the <code>[[suppresserrors]]</code> statement.


===execandexit===
===execandexit===
Line 367: Line 367:
See also: [[Template:Extension DPL scroll]] and [[DPL Example 020]] and [[Scrolling]]
See also: [[Template:Extension DPL scroll]] and [[DPL Example 020]] and [[Scrolling]]


Note <tt>execandexit</tt> acts like a short-circuit evaluation. This means, for example, that successive statements to influence caching behaviour (like [[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 [[allowcachedresults]]) will not be interpreted.


=== cacheperiod ===
=== cacheperiod ===