Jump to content
This wiki has been automatically closed because there have been no edits or log actions made within the last 60 days. If you are a user (who is not the bureaucrat) that wishes for this wiki to be reopened, please request that at Requests for reopening wikis. If this wiki is not reopened within 6 months it may be deleted. Note: If you are a bureaucrat on this wiki, you can go to Special:ManageWiki and uncheck the "Closed" box to reopen it.

General usage and invocation syntax: Difference between revisions

Not sure why examples how to scroll etc were on a general use and syntax page, but make it only so this has general use and syntax (the rest moved where it belonged), and, there were 3 or for disparate places for scroll info, there's now just this syntax/reference, and the main source (has 2 identically named sections on selection critera page too)
imported>FrozenPlum
m (Adjust a couple of the statements)
imported>FrozenPlum
(Not sure why examples how to scroll etc were on a general use and syntax page, but make it only so this has general use and syntax (the rest moved where it belonged), and, there were 3 or for disparate places for scroll info, there's now just this syntax/reference, and the main source (has 2 identically named sections on selection critera page too))
Line 12:
* [[Orange]]
 
==Invocation syntax==
 
===Parser extension (tag) 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 <code><nowiki><dpl></nowiki></code>) and a corresponding end tag (<code><nowiki></dpl></nowiki></code>). '''The text between these tags is handed over to the extension module ''just as it is''.'''
 
Line 45:
 
 
===Parser function method===
This example would be used inside a template, and uses the variable <code><nowiki>{{{1}}}</nowiki></code> passed to the template, which would be set to ''myPage'' here. Parser functions look like templates which start with a hash character (#). They are more closely integrated with the wiki system. They are more powerful, but their syntax looks a bit more complicated. '''The text between these tags is pre-parsed to expand wiki mark-up ''before'' being handed over to the extension module.'''
 
Line 264:
==Scrolling==
 
DPL3 supports efficient scrolling through huge result sets. Basically, the idea of backward scrolling is that the SQL statement produces a DESCENDING order (with titles below the threshold). Internally, DPL3 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.
DPL3 supports efficient scrolling through huge result sets.
 
The command <code>scroll=''yes''</code> must be given to enable scrolling.
 
DPL3 can take certain URL parameters from the command line, like <code>&DPL_fromTitle</code> and <code>&DPL_toTitle</code>. If these arguments are given, the commands <code>title&gt;</code> and <code>title&lt;</code> will implicitly be set. Within the {{DPL|resultsheader}} and/or {{DPL|resultsfooter}} you can call a template which generates links to fetch the next / previous page.
 
===Scroll variable syntax===
Basically, the idea of backward scrolling is that the SQL statement produces a DESCENDING order (with titles below the threshold). Internally, DPL3 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, DPL3 1.8.0 and later will take a couple ofsome parameters from the URL command line (e.g., like <code>DPL_offset</code> for instance); these parameters can be accessed within DPL3 via a special syntax:
* <code>{%DPL_offset%}</code>.
or
* <code>{%DPL_offset:defaultvalue%}</code>.
 
The variables are:
* DPL_count
* DPL_offset
* DPL_refresh (a value of 'yes' will purge the DPL3 cache)
* DPL_fromTitle - Will be passed to {{DPL|titlelt}} (previously title<)
* DPL_toTitle - Will be passed to {{DPL|titlegt}} (previously title>)
* DPL_findTitle - Will be passed to {{DPL|titlegt}}= (title>=)
* DPL_scrolldir (will be used to influence sort order, can be 'up' or 'down')
 
The===Scroll variables are:===
 
When scrolling is enabled, DPL will interpret the following special parameters in the URL.
Thus, you could write an article called 'MyPopularArticles' containing a DPL3 query like:
 
<pre><nowiki>
{{#dpl:execandexit=geturlargs}}
<dpl>
category = Country
count = {%DPL_count:100%}
scroll = yes
resultsheader = Showing {%DPL_count:100%} pages starting from page {{#expr:{%DPL_offset%} + 1}}:\n
</dpl>
 
{| class="wikitable"
</nowiki></pre>
! URL Parameter
 
! Description
Calling <code><nowiki>http://mywebsite/mywiki/index.php?title=MyPopularArticles</nowiki></code> will give you the first 100 articles in the category. Adding <code>&DPL_offset=100</code> will give you the next one hundred articles. This mechanism can be used to create a generic page scroll feature—provided you can access the value of <code>DPL_offset</code> also in other templates outside DPL3. And this is where the <code>{{DPL|execandexit}}</code> command comes in: it stores the URL parameters in a variable which can be accessed via <code>{{DPL|#dplvar}}</code>.
|-
* |DPL_count
|Limit number of pages to show, overwrites the values of the <code>{{DPL|count}}=</code> parameter.
|-
* |DPL_offset
|Where to start, n<sup>th</sup> page, overwrites the value of the <code>{{DPL|offset}}=</code> parameter.
|-
|DPL_refresh
|{{note|'''Note:''' This feature was removed in DPL3 version 3.0.0.|error}}
|-
|DPL_findTitle
*|Page DPL_fromTitlename -to Willstart bewith, value is passed to {{DPL|titlelttitlegt}}= (previously title<>= ).
|-
|DPL_toTitle
|Page name to end with, value is passed to {{DPL|titlegt}} (previously title>), which is needed for reverse scroll and which restricts the selection to articles with a page title less or equal to the specified value.
|-
|DPL_fromTitle
|Page name to start after, value is passed to {{DPL|titlelt}} (previously title<), which and restricts the selection to articles with a page title greater or equal to the specified value.
|-
|DPL_scrolldir
|direction of scroll (can be 'up' or 'down').
|}
 
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.