Dplmatrix/test matrix: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
No edit summary
m (GRASP: Reverted edits by 192.41.13.71 (talk) for "Vandalism", requested by Magiczocker.)
Line 1: Line 1:
{{PAGENAME}} has been vandalized. {|border=1 width=100% cellspacing=0
{|border=1 width=100% cellspacing=0
|style=padding-left:5px width=120px id=n-Test | '''Test'''
|style=padding-left:5px width=120px id=n-Test | '''Test'''
|style=padding-left:5px | matrix
|style=padding-left:5px | matrix

Revision as of 22:29, 1 May 2020

Test matrix

generating a matrix from an indented list

Input is:

one
 oho
 aha
two ~~ Two
 ehem
three
four
 aha
 uhui ~~ UHU
two ~~ Two
   uhui ~~ UHU

Output is:

normal flipped
{{#dplmatrix:a simple demo matrix||||
one
 oho
 aha
two ~~ Two
 ehem
three
four
 aha
 uhui ~~ UHU
two ~~ Two
   uhui ~~ UHU
}}
{{#dplmatrix:a simple demo matrix|<big>•</big>|.|flip|
one
 oho
 aha
two ~~ Two
 ehem
three
four
 aha
 uhui ~~ UHU
two ~~ Two
   uhui ~~ UHU
}}

{{#dplmatrix:a simple demo matrix|||| one

oho
aha

two ~~ Two

ehem

three four

aha
uhui ~~ UHU

two ~~ Two

  uhui ~~ UHU

}}

{{#dplmatrix:a simple demo matrix||.|flip| one

oho
aha

two ~~ Two

ehem

three four

aha
uhui ~~ UHU

two ~~ Two

  uhui ~~ UHU

}}

  • "from" items ("source") start in col 1
  • "to" items ("target") are indented by at least one space
  • source appears in input sequence
  • target is sorted by alphabet
  • items are treated as pages and shown as a link
  • the label can be defined by adding it after the iterm, separated by "~~"
  • symbols for "yes" and "no" can be defined
  • via the stylesheet in Mediawiki:Common.css you can control the layout (class=dplmatrix)

Links to DPL Manual pages

Now we use two nested DPL queries and what would be a separate page, Test matrix2, to generate the indented list:

{{#dplmatrix:''links from articles to the DPL manual''|'''x'''|-|flip|
  {{#dpl:
    |debug=1
    |category=DPL Manual
    |format=,%PAGE% ~~ %TITLE%\n²{:Test matrix2¦page=%PAGE%¦category=DPL Manual¦namespace=}²,
  }}
}}

Contents of Test matrix2:

{{#dpl:
 |debug=1
 |{{#if:{{{namespace|}}}|{{#ifeq:{{{namespace}}}|main|namespace=|namespace={{{namespace}}}|}}}}
 |{{#if:{{{category|}}}|category={{{category}}}}}
 |linksfrom={{{page}}}
 |shownamespace=no
 |format=,   %PAGE% ~~ %TITLE%\n,
}}

{{#dplmatrix:links from articles to the DPL manual|x|-|flip|

 {{#dpl:
   |debug=1
   |category=DPL Manual
   |format=,%PAGE% ~~ %TITLE%\n²{:Test matrix2¦page=%PAGE%¦category=DPL Manual¦namespace=}²,
 }}

}}