Difference between revisions of "Example 3"

From FollowTheScore
Jump to: navigation, search
(weitere Beispiele)
 
(35 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
== Find Articles which have at least / at most [n] categories ==
 
== Find Articles which have at least / at most [n] categories ==
 
Members of the OAU with at least 3 categories, at most 6:
 
Members of the OAU with at least 3 categories, at most 6:
 +
<pre><nowiki>
 
{{#dpl:categoriesminmax=3,6|category=African Union member states|addpagesize=true}}
 
{{#dpl:categoriesminmax=3,6|category=African Union member states|addpagesize=true}}
 +
</nowiki></pre>
 +
{{#dpl:categoriesminmax=3,6|category=African Union member states|addpagesize=true}}
 +
 +
 +
== Show date and user of latest edit for country articles ==
 +
<pre><nowiki>
 +
<DPL>
 +
  category = Fictitious country
 +
  ordermethod = lastedit
 +
  order = ascending
 +
  resultsheader = ====latest edits:====\n
 +
  shownamespace = false
 +
  addeditdate = true
 +
  adduser = true
 +
  mode = ordered
 +
</DPL>
 +
</nowiki></pre>
 +
<DPL>
 +
  category = Fictitious country
 +
  ordermethod = lastedit
 +
  order = ascending
 +
  resultsheader = ====latest edits:====\n
 +
  shownamespace = false
 +
  addeditdate = true
 +
  adduser = true
 +
  mode = ordered
 +
</DPL>
 +
 +
== Find uncategorized articles ==
 +
Note: the following statement works only if you created a special SQL view in the wiki database.
 +
You need admin rights (including "CREATE VIEW permissions") for this. This demo site runs on a server where the author does not have such rights. So you will see an error message ...
 +
<pre><nowiki>
 +
<dpl>
 +
  category=
 +
</dpl>
 +
</nowiki></pre>
 +
 +
<dpl>
 +
  category=
 +
</dpl>
  
 
== Produce an image gallery ==
 
== Produce an image gallery ==
 +
 +
<pre><nowiki>
 +
<DPL>
 +
  namespace=File
 +
  mode=userformat
 +
  listseparators=<gallery>,%PAGE%\n,,</gallery>
 +
</DPL>
 +
</nowiki></pre>
  
 
<DPL>
 
<DPL>
   namespace=Image
+
   namespace=File
 
   mode=userformat
 
   mode=userformat
 
   listseparators=<gallery>,%PAGE%\n,,</gallery>
 
   listseparators=<gallery>,%PAGE%\n,,</gallery>
 
</DPL>
 
</DPL>
 +
 +
===Image gallery with alternative syntax===
 +
This allows passing of parameters et.c.
 +
<pre><nowiki>
 +
{{#dpl:
 +
  |namespace=File
 +
  |format=«gallery»,%PAGE%¦%NR%. %TITLE%\n,,«/gallery»
 +
}}
 +
</nowiki></pre>
 +
{{#dpl:
 +
  |namespace=File
 +
  |format=«gallery»,%PAGE%¦%NR%. %TITLE%\n,,«/gallery»
 +
}}
  
 
== Show number of articles instead of name list ==
 
== Show number of articles instead of name list ==
 +
<pre><nowiki>
 +
{{#dpl:category=African Union member states|resultsheader=There are %PAGES% articles on OAU member states.|mode=userformat}}
 +
</nowiki></pre>
 +
 
{{#dpl:category=African Union member states|resultsheader=There are %PAGES% articles on OAU member states.|mode=userformat}}
 
{{#dpl:category=African Union member states|resultsheader=There are %PAGES% articles on OAU member states.|mode=userformat}}
  
 +
<!--
  
 
== Multi column output and article numbers ==
 
== Multi column output and article numbers ==
  
 
ordering articles by size
 
ordering articles by size
 +
 +
<pre><nowiki>
 +
<dpl>
 +
  namespace=
 +
  addpagesize=true
 +
  ordermethod=size
 +
  mode=userformat
 +
  listseparators={|class=sortable\n!Rank\n!Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|align=right|%SIZE%,\n|-,\n|}
 +
  count=10
 +
  columns=3
 +
</dpl>
 +
</nowiki></pre>
  
 
<dpl>
 
<dpl>
Line 24: Line 103:
 
   ordermethod=size
 
   ordermethod=size
 
   mode=userformat
 
   mode=userformat
   listseparators={|class=sortablewikitable id=2\n!Rank\n!Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|align=right|%SIZE%,\n|-,\n|}
+
   listseparators={|class=sortable\n!Rank\n!Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|align=right|%SIZE%,\n|-,\n|}
 
   count=10
 
   count=10
 
   columns=3
 
   columns=3
 
</dpl>
 
</dpl>
  
== Varying font size based on article size ==
+
== Multi row output and article numbers ==
 +
 
 +
ordering articles by size, the table heading will be repeated 3 times 
 +
 
 +
<pre><nowiki>
 +
<dpl>
 +
  namespace=
 +
  addpagesize=true
 +
  ordermethod=size
 +
  mode=userformat
 +
  listseparators={|class=sortable\n!Rank\n!width=200|Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|align=right|%SIZE%,\n|-,\n|}
 +
  count=10
 +
  rows=3
 +
</dpl>
 +
</nowiki></pre>
 +
 
 +
<dpl>
 +
  namespace=
 +
  addpagesize=true
 +
  ordermethod=size
 +
  mode=userformat
 +
  listseparators={|class=sortable\n!Rank\n!width=200|Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|align=right|%SIZE%,\n|-,\n|}
 +
  count=10
 +
  rows=3
 +
</dpl>
 +
 
 +
 
 +
== Multi row output and article numbers ==
 +
 
 +
ordering articles by size, the table heading will be repeated after every group of 5 lines 
 +
 
 +
<pre><nowiki>
 +
<dpl>
 +
  namespace=
 +
  addpagesize=true
 +
  ordermethod=size
 +
  mode=userformat
 +
  listseparators={|class=sortable\n!Rank\n!width=200|Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|align=right|%SIZE%,\n|-,\n|}
 +
  count=10
 +
  rowsize=5
 +
</dpl>
 +
</nowiki></pre>
 +
 
 +
<dpl>
 +
  namespace=
 +
  addpagesize=true
 +
  ordermethod=size
 +
  mode=userformat
 +
  listseparators={|class=sortable\n!Rank\n!width=200|Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|align=right|%SIZE%,\n|-,\n|}
 +
  count=10
 +
  rowsize=5
 +
</dpl>
 +
 
 +
== Varying font size based on article size, RANDOM selection ==
 
This example shows how the size of an article can be used to display its name in a corresponding size;  
 
This example shows how the size of an article can be used to display its name in a corresponding size;  
 
we select 6 articles by '''random''':
 
we select 6 articles by '''random''':
{{Sortable Tables}}
+
 
 +
<pre><nowiki>
 +
<dpl>
 +
  namespace=
 +
  addpagesize=true
 +
  ordermethod=size
 +
  mode=userformat
 +
  randomcount=6
 +
  listseparators={|class=sortable\n!Article\n!Bytes\n|-,\n|<font size="%SIZEFS%">[[%PAGE%]]</font>\n|align=right|%SIZE%,\n|-,\n|}
 +
</dpl>
 +
</nowiki></pre>
 +
 
 
<dpl>
 
<dpl>
 
   namespace=
 
   namespace=
Line 39: Line 182:
 
   mode=userformat
 
   mode=userformat
 
   randomcount=6
 
   randomcount=6
   listseparators={|class=sortablewikitable id=1\n!Article\n!Bytes\n|-,\n|<font size="%SIZEFS%">[[%PAGE%]]</font>\n|align=right|%SIZE%,\n|-,\n|}
+
   listseparators={|class=sortable\n!Article\n!Bytes\n|-,\n|<font size="%SIZEFS%">[[%PAGE%]]</font>\n|align=right|%SIZE%,\n|-,\n|}
 
</dpl>
 
</dpl>
  
Line 46: Line 189:
 
Two different scalings (%COUNTFS% and %COUNTFS2%) are available.
 
Two different scalings (%COUNTFS% and %COUNTFS2%) are available.
  
<u>based on %COUNTFS%:</u>
+
<pre><nowiki>
 +
{{#dpl:namespace=Template
 +
  |addpagecounter=true
 +
  |mode=userformat
 +
  |listseparators=,<font size="%COUNTFS%">[[%PAGE%|%TITLE%]]</font>,
 +
  |inlinetext= &nbsp;&bull;&nbsp;
 +
}}
 +
</nowiki></pre>
 +
 
 +
<u>Templates based on %COUNTFS%:</u>
  
{{#dpl:namespace=
+
{{#dpl:namespace=Template
 
   |addpagecounter=true
 
   |addpagecounter=true
 
   |mode=userformat
 
   |mode=userformat
   |listseparators=,<font size="%COUNTFS%">[[%PAGE%]]</font>,
+
   |listseparators=,<font size="%COUNTFS%">[[%PAGE%|%TITLE%]]</font>,
 
   |inlinetext= &nbsp;&bull;&nbsp;  
 
   |inlinetext= &nbsp;&bull;&nbsp;  
 
}}
 
}}
  
<u>based on %COUNTFS2%:</u>
+
<u>Articles based on %COUNTFS2%:</u>
  
 
{{#dpl:namespace=
 
{{#dpl:namespace=
Line 64: Line 216:
 
}}
 
}}
  
== weitere Beispiele ==
+
== simple multi column output ==
 +
 
 +
<pre><nowiki>
 +
<dpl>
 +
  namespace=
 +
  titlematch=B%
 +
  addpagesize=true
 +
  ordermethod=size
 +
  mode=userformat
 +
  listseparators=,[[%PAGE%]] &nbsp; &nbsp; <br>,,
 +
  columns=4
 +
</dpl>
 +
</nowiki></pre>
 +
 
 
<dpl>
 
<dpl>
 
   namespace=
 
   namespace=
 +
  titlematch=B%
 
   addpagesize=true
 
   addpagesize=true
 
   ordermethod=size
 
   ordermethod=size
 +
  mode=userformat
 +
  listseparators=,[[%PAGE%]] &nbsp; &nbsp; <br>,,
 
   columns=4
 
   columns=4
 
</dpl>
 
</dpl>
 +
 +
<dpl>reset=all</dpl>
 +
 +
-->

Latest revision as of 08:17, 8 February 2011

Find Articles which have at least / at most [n] categories

Members of the OAU with at least 3 categories, at most 6:

{{#dpl:categoriesminmax=3,6|category=African Union member states|addpagesize=true}}


Show date and user of latest edit for country articles

<DPL>
  category = Fictitious country
  ordermethod = lastedit
  order = ascending
  resultsheader = ====latest edits:====\n
  shownamespace = false
  addeditdate = true
  adduser = true
  mode = ordered
</DPL>

latest edits:

  1. 2009-04-14 15:02:23 DPL Example 007 main page 1 . . Bwyseur
  2. 2009-04-14 15:32:28 Nigunda . . Kw123
  3. 2010-01-19 14:41:07 Somango . . Gero
  4. 2010-01-19 14:49:26 Nigunda Test . . Gero

Find uncategorized articles

Note: the following statement works only if you created a special SQL view in the wiki database. You need admin rights (including "CREATE VIEW permissions") for this. This demo site runs on a server where the author does not have such rights. So you will see an error message ...

<dpl>
  category=
</dpl>

Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option for parameter 'category'.


Extension:DynamicPageList (DPL), version 3.2.1: Error: No selection criteria found! You must use at least one of the following parameters: category, namespace, titlematch, linksto, uses, createdby, modifiedby, lastmodifiedby, or their 'not' variants


Extension:DynamicPageList (DPL), version 3.2.1: Warning: No results.

Produce an image gallery

<DPL>
  namespace=File
  mode=userformat
  listseparators=<gallery>,%PAGE%\n,,</gallery>
</DPL>

Image gallery with alternative syntax

This allows passing of parameters et.c.

{{#dpl:
   |namespace=File
   |format=«gallery»,%PAGE%¦%NR%. %TITLE%\n,,«/gallery»
}}

Show number of articles instead of name list

{{#dpl:category=African Union member states|resultsheader=There are %PAGES% articles on OAU member states.|mode=userformat}}

There are 4 articles on OAU member states.