Anonymous user
General usage and invocation syntax: Difference between revisions
General usage and invocation syntax (view source)
Revision as of 06:25, 25 November 2018
, 5 years agoreplaced: tt> → code> (82)
No edit summary |
(replaced: tt> → code> (82)) |
||
Line 11:
=== Parser extension method ===
The following example would probably be used directly on an article page, but could also be included as part of a template. Parser extensions define a specific tag (in this case <
;Example syntax
Line 24:
;Parsing procedure
Wiki markup expansion ''does not take place'' before the commands are handed over to the extension module.
* This may be useful if you want to pass wiki syntax elements to DPL3 as arguments (see the <
* [[mw:Magic words|Magic words]] like <
* Template calls like <
* Parser function calls like <
* To pass wiki syntax elements to DPL as parameters it is sometimes necessary to enforce a line break. The reason is that wiki syntax depends on line breaks. Instead, use <
;Syntax features
* Every parameter assignment (<
* Lines starting with a # will be ignored (comment).
* Generally the syntax looks fairly simple and intuitive as it doesn't contain special characters (except for the two embracing tags).
* Tag case doesn't matter, so it can also be written <
* In many cases there is no need to have macro expansion within the parameter list. Note that in the example above, the pipe character (which is used to define a logical OR between the two categories) can be written as it is. The name of the page (''myPage''), however, must be a hardcoded constant.
=== Parser function method ===
This example would be used inside a template, and uses the variable <
;Example syntax
Line 54:
;Parsing procedure
Wiki markup expansions (not the final conversion to HTML) take place before the commands are handed over to the extension module.
* Magic words like <
* Template calls like <
* Parser function calls like <
;Syntax features
Line 63:
** With DPL it is also possible to use the symbol ¦ instead of |; this is very intuitive and maybe it could be adopted by MediaWiki in general...but be <u>careful</u>: it must be inserted by copy-and-paste from here (or from a HTML symbol or extended ASCII table like Windows' ''Character Map'') as normally a keyboard will not have it available (even worse: on some keyboards the standard pipe character is printed in a way that it looks more like the "broken pipe").
* The text can (but needs not) be written in one line of text, parameters are separated by pipe characters.
* What was said before regarding explicit line breaks also holds true for parser function syntax, i.e. the special symbols <
Note: The pipe character, which is used to define a logical OR for the two categories, must be represented as a call of a special template (which would typically be called "Template:!") which has a single pipe character as its contents. The same kind of trick is also found outside DPL in other templates. The second example shows that the <
The second example is not literally equivalent to the first one as there is an additional pipe character before the first parameter. Technically, this creates an additional empty parameter, but as empty parameters are silently ignored by DPL it makes no difference.
Line 173:
<center style="border:1px black solid"><big>'''''Normally DPL does not return its own page in the result.'''''</big></center>
* The parameter <
* You can suppress back references to a page containing a DPL query by using [[reset]] and/or [[eliminate]].
=== Symbol replacement in ''mode=userformat'' ===
When mode=userformat is selected, DPL will not output anything by default. Instead it will look for symbols in your input (''listseparators, secseparators, multisecseparators, tablerow'') which it will replace by their corresponding values. For example, <
'''See [[DPL:Parameters: Controlling Output Format#format]] for a complete list of symbols.'''
The specification of <
mode=userformat
listseparators=a,b,c,d
Line 193:
=== Implicit link to [[:Template:Extension DPL]] ===
Since version 1.7.9 DPL creates an implicit automatic link to <
This means that every page containing a DPL statement will automatically create a link to [[:Template:Extension DPL]]. You should create this Template in your wiki. We suggest that you copy the source code from [[:Template:Extension DPL|our version]]. The idea is that via this connection you can easily find out which pages in a wiki contain DPL calls.
Line 206:
resultsfooter=«/nowiki»«/pre»
The same effect can be achieved with <
=== Table output ===
Line 216:
DPL supports efficient scrolling through huge result sets.
The command <
DPL can take certain URL parameters from the command line, like &DPL_fromTitle and &DPL_toTitle. If these arguments are given the commands <
See [[DPL Example 027]] for details.
Line 224:
Basically the idea of backward scrolling is that the SQL statement produces a DESCENDING order (with titles below the threshold). Internally DPL buffers the SQl result set and reverses its order. So the user will see a page of entries directly below the threshold, but in ascending order.
If scrolling is enabled, DPL 1.8.0 and later will take a couple of parameters from the URL command line, like <
* <
or
* <
The variables are:
Line 251:
</nowiki></pre>
Calling <
|