Difference between revisions of "TemplatedPageList"

From Wiki4Intranet
Jump to: navigation, search
(Created page with "== Syntax and options == Syntax is backwards compatible with Wikimedia's DynamicPageList syntax, except for 'firstcategor...")
 
(Page selection)
Line 12: Line 12:
 
=== Page selection ===
 
=== Page selection ===
  
  namespace = Main|Talk|...       restrict list to some namespaces
+
; namespace = Main|Talk|...: Restrict list to some namespaces
  category = A|B|C
+
; category = A|B|C<br /> category = D|E: Restrict page list to pages which are in one of these categories. This option may be specified multiple times, following occurrences will be appended as a conjunction, i.e., the resulting expression will be (A or B or C) & (D or E). This is compatible with Wikimedia's DynamicPageList syntax, but allows more complex queries.
  category = D|E
+
; notcategory = A: Exclude pages which are in category A
    Restrict page list to pages which are in one of these categories.
+
; parent = P: Restrict listing to subpages of P
    this option may be specified multiple times, following occurrences
+
; level = L or MIN..MAX: Set wanted subpage nesting levels (i.e. number of '/' in title) it must be equal to L or be within MIN..MAX.
    will be appended as a conjunction, i.e., the resulting expression will be
+
; deepness = D or MIN..MAX: Set wanted subpage nesting levels, relative to parent.
    (A or B or C) & (D or E). This is compatible with Wikimedia's DynamicPageList
+
; ignore = L1|L2|...: Ignore pages which match L1 or L2 or ... LIKE patterns:
    syntax, but allows more complex queries.
+
:* '\_' and ' ' match single space
  notcategory = A                 exclude pages which are in category A
+
:* '_' matches any single character
  parent = P                     restrict listing to subpages of P
+
:* '%' matches any substring
  level = L or MIN..MAX           set wanted subpage nesting levels (i.e. number of '/' in title)
+
:* '\%' matches single '%' character
                                  it must be equal to L or be within MIN..MAX
+
; redirect = yes|no: restring listing to redirect or non-redirect pages
  deepness = D or MIN..MAX       set wanted subpage nesting levels, relative to parent
+
  ignore = L1|L2|...             ignore pages which match L1 or L2 or ... LIKE patterns:
+
                                  '\_' and ' ' match single space
+
                                  '_' matches any single character
+
                                  '%' matches any substring
+
                                  '\%' matches single '%' character
+
  redirect = yes|no               restring listing to redirect or non-redirect pages
+
  
 
=== Ordering ===
 
=== Ordering ===

Revision as of 01:11, 28 June 2011

Syntax and options

Syntax is backwards compatible with Wikimedia's DynamicPageList syntax, except for 'firstcategorydate' related stuff. The text inside <subpagelist> is preprocessed, so you can use templates, magic words and parser functions inside it. Options are specified one per line.

Open tag

<subpagelist> (you can also use <DynamicPageList> or <subpages> for compatibility)

Page selection

namespace = Main|Talk|...
Restrict list to some namespaces
category = A|B|C
category = D|E
Restrict page list to pages which are in one of these categories. This option may be specified multiple times, following occurrences will be appended as a conjunction, i.e., the resulting expression will be (A or B or C) & (D or E). This is compatible with Wikimedia's DynamicPageList syntax, but allows more complex queries.
notcategory = A
Exclude pages which are in category A
parent = P
Restrict listing to subpages of P
level = L or MIN..MAX
Set wanted subpage nesting levels (i.e. number of '/' in title) it must be equal to L or be within MIN..MAX.
deepness = D or MIN..MAX
Set wanted subpage nesting levels, relative to parent.
ignore = L1|L2|...
Ignore pages which match L1 or L2 or ... LIKE patterns:
  • '\_' and ' ' match single space
  • '_' matches any single character
  • '%' matches any substring
  • '\%' matches single '%' character
redirect = yes|no
restring listing to redirect or non-redirect pages

Ordering

 order|ordermethod = Y1 [asc|desc],Y2 [asc|desc],...
   Sort pages by Y1,Y2,..., asc|desc can be specified right after Yi, each Yi is one of:
     title
     titlewithoutnamespace
     lastedit
     user
     created|firstedit
     length|size
     popularity|pagecounter
 order = ASC or DESC             ascending or descending sort order for all Yi (compatibility)
 count|limit = N                 show at most N pages
 offset = M                      skip first M pages

Output

 template = X
   Use template:X for output. The template will be preprocessed just like when included
   into listed article. I.e. all standard MediaWiki magic variables (TemplatedPageList 28 etc)
   will generate values corresponding to listed articles.
   Additionally, the following parameters are passed to this template:
     {{{index}}}                 list index, beginning at 0
     {{{number}}}                list index, beginning at 1
     {{{odd}}}                   is {{{number}}} odd? (1 or 0)
     {{{ns_N}}}                  N is namespace index, value is 1
     {{{title}}}                 full title
     {{{title_rel}}}             title relative to parent specified in options
 suppresserrors|noerrors|silent = true
   suppress errors

Close tag

</subpagelist>