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

class=
(Fix typo I missed)
imported>FrozenPlum
(class=)
Line 2:
{{DPL manual|section=General usage and invocation syntax}}
{{tocright}}
'''DynamicPageList3 (DPL3)''' can be used as a '''parser extension''' (<small><code><nowiki><DPLdpl> .... </DPLdpl></nowiki></code></small>) or as a '''parser function''' (<small><code><nowiki>{{#dpl: .... }}</nowiki></code></small>). There is no general rule which one is better. If in doubt, you may want to use the '''parser function syntax''', as it '''is more powerful'''.
 
;Sample output
Line 12:
 
==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><DPLdpl></nowiki></code>) and a corresponding end tag (<code><nowiki></DPLdpl></nowiki></code>). '''The text between these tags is handed over to the extension module ''just as it is''.'''
 
;Example syntax
<blockquote><pre><nowiki>
<DPLdpl>
category = cat1|cat2
# only pages which contain a link to myPage
linksto = myPage
</DPLdpl>
</nowiki></pre></blockquote>
 
Line 106:
==URL parameters==
DPL understands a couple of parameters which can be passed via a URL specification. These URL-parameters all start with DPL_:
* <code>DPL_count</code>: influencesInfluences the {{DPL|count}} parameter (inwhich factlimits the number of pages to show, it overwrites the value specified within the DPL statement).
* <code>DPL_offset</code>: influencesInfluences the {{DPL|offset}} parameter (in fact, it overwrites the value specified within the DPL statement and specifies where to start (n<sup>th</sup> page).
* <code>DPL_refresh</code>: ifSpecifies usedwhether withor anot valueto ofpurge the cache ('yes' this will clear the DPL cache).
* <code>DPL_fromTitle</code>: restrictInfluences the {{DPL|titlelt}} (previously title<), specifies the page name to start after, so restricts the selection to articles with a page title greater or equal to the specified value.
* <code>DPL_toTitle</code>: restrictInfluences the {{DPL|titlegt}} (previously title>), specifies the page name to end with, so restricts the selection to articles with a page title less than or equal to the specified value.
* <code>DPL_findTitle</code>: Influences the {{DPL|titlegt}} parameter, specifies the page name to start with that is passed to {{DPL|titlegt}}.
* <code>DPL_arg1, DPL_arg2, .. DPL_arg5</code>: these are genericGeneric parameters that can be used freely to influence a DPL statement.
 
The command following would display ''MyPage'' and set the offset parameter to a value of ''20''.:
The command
 
<pre><nowiki> http://mywebsite/mywiki/index.php?title=MyPage&DPL_offset=20 </nowiki></pre>
 
would display ''MyPage'' and set the offset parameter to a value of ''20''.
 
Within the DPL statement, you can access URL parameters via
Line 125:
In this case, DPL will use 'yyy' if the parameter DPL_xxx is not specified on the URL command line.
 
'''Note:''' There is a template called [[Template:Extension DPL scroll]] which uses <code>DPL_offset</code> and <code>DPL_count</code> to provide a generic page scrolling method for huge result sets, where there is an expected number of results.
 
==Syntax used in this manual==
Line 140:
As mentioned before, DPL3 will insert its output exactly at the position where you placed the DPL3 call. This means that you can put wiki syntax around your DPL call, like e.g.,:
<pre><nowiki>
{| class="wikitable"
|a table field
|<DPLdpl>
linksto=myPage
</DPLdpl>
|-
|another table field
Line 222:
* DPL_offset
* DPL_refresh (a value of 'yes' will purge the DPL cache)
* DPL_fromTitle (will- Will be passed to title<{{DPL|titlelt}} (previously title<)
* DPL_toTitle (will- Will be passed to title>{{DPL|titlegt}} (previously title>)
* DPL_findTitle (will- Will be passed to {{DPL|titlegt}}= (title>= )
* DPL_scrolldir (will be used to influence sort order, can be 'up' or 'down')
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.