User:Claus chr/DPL: Difference between revisions

From KDE UserBase Wiki
Line 50: Line 50:
   nottitleregexp = .*(/..(-..)?|_[(].*[)])$
   nottitleregexp = .*(/..(-..)?|_[(].*[)])$
   include = *
   include = *
   includematch = #.*\[\[([Ss]pecial\:[mM]y[lL]anguage/)?Getting[_ ]Help#
   includematch = #\[\[([Ss]pecial\:[mM]y[lL]anguage/)?Getting[_ ]Help#
   includemaxlength = 0
   includemaxlength = 0
   resultsheader = The pages in the translation system linking to Getting Help are:\n
   resultsheader = The pages in the translation system linking to Getting Help are:\n
Line 67: Line 67:
</DPL>
</DPL>


which excludes some pages in the main namespace(!) and includes on in the User namespace!?
which excludes some pages in the main namespace(!) and includes on in the User namespace!? Explicitely specifying namespace main gives this.
 
<DPL>
  namespace = Main
  nottitleregexp = .*(/..(-..)?|_[(].*[)])$
  include = *
  includematch = #\[\[([Ss]pecial\:[mM]y[lL]anguage/)?Getting[_ ]Help#
  includemaxlength = 0
  resultsheader = The pages in the translation system linking to Getting Help are:\n
  format = ,\n* [[%PAGE%|%TITLE%]],,
</DPL>
 
That seems reasonable, but weren't main supposed to be used by default? Lesson nra
 
On the other hand this query:
On the other hand this query:



Revision as of 18:29, 16 June 2011

Reference: DPL Manual
See also Pipesmoker's notes and this page of examples
Example UI on this Template:Catlist page


Searching for pages containing a certain text string

Matching content in pages: You need to include the contents of pages in this page (include = * does that) and then do a perl-like regexp on their contents to filter interesting pages (includematch = ...). If you are searching in translated pages (fx all Danish pages) it is often advantageous to have namespace = Translations set; otherwise you will get both all full pages and all translation units containing matching text — that could be a very long output.

<DPL>
  titlematch = %/da
  namespace = Translations
  include = *
  includematch = /albummet/
  resultsheader = Danish translation units containing the string "albummet"
  format = ,\n* [[%PAGE%|%TITLE%]]\n,,
</DPL>


All English pages linking to a given page

<DPL>
  namespace=Main |User
  nottitleregexp = .*(/..(-..)?|_[(].*[)])$
  include = *
  includematch = #\[\[[Ss]pecial\:[mM]y[lL]anguage/Getting[_ ]Help|\[\[Getting[_ ]Help#
  includemaxlength = 0
  resultsheader = The pages in the translation system linking to Getting Help are:\n
  format = ,\n* [[%PAGE%|%TITLE%]],,
</DPL>

Extension:DynamicPageList3 (DPL3), version 3.5.3: 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

Somehow this is broken. Without the namespace clause we get

Extension:DynamicPageList3 (DPL3), version 3.5.3: 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

which excludes some pages in the main namespace(!) and includes on in the User namespace!? Explicitely specifying namespace main gives this.

Extension:DynamicPageList3 (DPL3), version 3.5.3: 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

That seems reasonable, but weren't main supposed to be used by default? Lesson nra

On the other hand this query:

<DPL>
  linksto = Getting_Help
  nottitleregexp = .*(/..(-..)?|_[(].*[)])$
  resultsheader = \n----\nThere are %TOTALPAGES% pages linking to Getting Help. These are:\n
  format = ,\n* [[%PAGE%|%TITLE%]],,
</DPL>


There are 16 pages linking to Getting Help. These are:

finds a page (with an old-stye link) that I just can't find using any variation on the above query. There seems to be some interaction between the various clauses in the query — maybe their order is significant. I can't find anything in the doc page, though.

Kopete Subpages in 3 columns

<DPL>
  titlematch = Kopete/%
  notnamespace = Translations
  columns = 3
  format = ,\n* [[%PAGE%|%TITLE%]],,
</DPL>

Akonadi Subpages in Danish

<DPL>
  titlematch = Akonadi%/da
  notnamespace = Translations
  format = ,\n* [[%PAGE%|%TITLE%]],,
</DPL>

Archived pages

<DPL>
  titlematch = %
  namespace = Archive
  columns = 2
  format = ,\n* [[%PAGE%|%TITLE%]],,
  resultsheader = There are %TOTALPAGES% pages in the Archive namespace. These are:\n
</DPL>

NoIndexed pages

<DPL>
  titlematch = %
  category = Noindexed_pages
  columns = 2
  format = ,\n* [[%PAGE%|%TITLE%]],,
  resultsheader = There are %TOTALPAGES% pages in the Archive namespace. These are:\n
</DPL>

Ignoring Deleted Pages

"As for DPL. If you hit a page with ?action=purge attached to the URL (i.e. http://en.wikinews.org/wiki/Template:Latest_news?action=purge ), it will dump all the removed pages."

Remaining old-style translations

<DPL>
  titlematch = %_(%)
  notcategory = Template
  notnamespace = Thread
  notnamespace = Summary
  columns = 2
  format = ,\n* [[%PAGE%|%TITLE%]],,
  resultsheader = There are %TOTALPAGES% pages (partly) remaining in old-style translations. These are:\n
</DPL>

Pages with old i18n bar

<DPL>
  titlematch = %
  namespace = Main
  uses = Template:I18n/Language Navigation Bar
  columns = 3
  format = ,\n* [[%PAGE%|%TITLE%]],,
  resultsheader = There are %TOTALPAGES% pages that still display the old i18n language bar\n
</DPL>

Pages with old i18n bar but w/o old-way-translated ones

<DPL>
  nottitlematch = %_(%)
  namespace = Main
  uses = Template:I18n/Language Navigation Bar
  columns = 3
  format = ,\n* [[%PAGE%|%TITLE%]],,
  resultsheader = There are %TOTALPAGES% relevant pages that still display the old i18n language bar\n
</DPL>

Pages not updated since 1st July 2010

<DPL>
  namespace = Main
  lastrevisionbefore = 201007010000
  columns = 2
  ordermethod=lastedit
  format = ,\n* (%DATE%) [[%PAGE%|%TITLE%]],,
  resultsheader = There are %TOTALPAGES% pages without recent updates\n
</DPL>

Listing Non-Translation Pages

<DPL>
  nottitlematch = %/__|%/zh-%|%(%)
  titlematch = Amarok%
  namespace = Main
  columns = 1
  format = ,\n* [[%PAGE%|%TITLE%]],,
  resultsheader = There are %TOTALPAGES% Amarok pages, not counting translations\n
</DPL>

List all pages in a specific namespace

<DPL>
  nottitlematch = %/__|%/zh-%|%pt-%|%(%)
  namespace = MediaWiki
  columns = 3
  format = ,\n* [[%PAGE%|%TITLE%]],,
  resultsheader = These %TOTALPAGES% pages are in the Mediawiki namespace\n
</DPL>

To count translated pages in a specific language:

<DPL>
  titlematch = %/en
  notnamespace = Translations
  columns = 3
  format = ,\n* [[%PAGE%|%TITLE%]],,
  resultsheader = There are %TOTALPAGES% pages (partly) translated to English. These are:\n
</DPL>

There are 832 pages (partly) translated to English. These are: