Examples/Module: dplmatrix (example 2)

From DynamicPageList3 Manual
Revision as of 05:14, 11 April 2023 by imported>FrozenPlum (move example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

Example

This uses the #dplmatrix module to create a matrix, whose first parameter (name) is set to "Page". The second parameter is set to (indicating a link/marker), the third is set to . (indicating no link/marker), and the fourth is set to flip (the matrix layout mode) to flip what is in normal column position to rows instead.

The fifth parameter specifies the indented list contents. Since the mode is flipped, the first items listed (non-indented, as column titles) are article names as the source, and then the (indented) article names as the row title targets. From this, DPL3 determines which target is listed under which source. For example, the "apple" article appears in both the "one" and "Two" source sections of the indented list provided, so they are each marked with an "x" by DPL3 in the corresponding table column and row.

{{#dplmatrix:Page|✓|.|flip|
one
 apple
 apricot
two ~~ Two
 banana
 apple
three
four
 grape
 mango ~~ MANGO
two ~~ Two
   mango ~~ MANGO
}}

Result

{{#dplmatrix:Page|✓|.|flip| one

apple
apricot

two ~~ Two

banana
apple

three four

grape
mango ~~ MANGO

two ~~ Two

  mango ~~ MANGO

}}