Dplmatrix: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
mNo edit summary
imported>FrozenPlum
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DPL manual|section=dplmatrix}}
{{DPL manual|section=dplmatrix}}


This function is a side entry into DPL for which there are five parameters required in a specific order, the last of which is an indented list of article names that '''must''' be passed to DPL3 to generate a matrix view. With copy/paste a matrix can be easily transferred to Excel to polish it there, like turning column texts to vertical, highlighting cells etc.



==Syntax==
==Syntax==
<code><nowiki>{{#dplmatrix:</nowiki> ''name'' | ''yes'' | ''no'' | ''mode'' | '''indented_list''' <nowiki>}}</nowiki></code> where:
<pre><nowiki>

{{#dplmatrix: name | yes | no | mode | '''indented_list''' }}
# <code>''name''</code> – The desired name of the matrix. Appears in the upper left cell. Arbitrary wiki formatting, even images, are possible.
</nowiki></pre>
# <code>''yes''</code> – The desired text/symbol indicating a link – (default is {{tt|x}}).
# <code>''no''</code> – The desired text/symbol indicating the '''absence''' of a link – (default is empty).
# <code>''mode''</code> – The mode to display rows and columns in. Accepted mode values are:
#* <code>''flip''</code> – When specified, rows and columns are reversed or flipped.
#* <code>''normal''</code> – Normal display – (default)
# <code>''indented_list''</code> The indented list of article names.
#* ''Source'' articles must start in column 1.
#** In the {{tt|normal}} mode, these articles populate the first cell of rows, and either link to or don't, the articles listed in column headers as indicated by link symbols.
#* ''Target'' items must be indented by at least one space (in {{tt|normal}} mode, they populate ''column'' headers).
#* After the article name <code>~~</code> may be used to set article title. Row and column headers hyperlink to the articles if titles are specified they are used instead.
#* Lines which are empty or contain only spaces are silently ignored.
#* If a source line is not followed by one or more target lines, an empty table row (or column in flip mode) is shown.
#* If the same source line appears multiple times, the targets are joined (added).


==Examples==
The best way to understand how ''#dplmatrix'' functions, is to view described examples, such as the ones included below. The first examples illustrate manually created indented lists, to better understand the basic matrix functions. The idea, however, is to use DPL3 to generate indented lists automatically, and also mark the links between them automatically, which is demonstrated in the last example.



'''Example 1:'''
==Effect==
{{#lsth:Examples/Module: dplmatrix (example 1)|Example}}
This function is a side entry into DPL.
{{ViewTest|Examples|Module: dplmatrix (example 1)}}
'''Result:'''
{{#lsth:Examples/Module: dplmatrix (example 1)|Result}}


You pass an indented list and you get a matrix view back. With copy/paste you can easily transfer such a matrix to Excel and do some polishing there like turning column texts to vertical, highlight interesting cells etc…)


'''Example 2:'''
There are five parameters which MUST be given in the order listed here:
{{#lsth:Examples/Module: dplmatrix (example 2)|Example}}
# The name of the matrix. Appears in the upper left cell. Arbitrary wiki formatting (even images) are possible.
{{ViewTest|Examples|Module: dplmatrix (example 2)}}
# The symbol for cells which symbolize a link. Default is "x".
'''Result:'''
# The symbol for cells which symbolize the absence of a link. Default is 'empty cell'.
{{#lsth:Examples/Module: dplmatrix (example 2)|Result}}
# The mode ('normal' or 'flip'); default is 'normal'. When 'flip' is specified, rows and columns will be exchanged.
# The indented list.
#* source items must start in column 1
#* target items must be indented by at least one space
#* after the item name you can add ~~ and a 'label'. Row and column titles of the matrix will contain hyperlinks to the items. If labels are specified, they will be used instead of the item names.
#* lines which are empty or contain only spaces are silently ignored.
#* if a source line is not followed by one or more target lines an empty table row (or column in flip mode) will be shown.
#* if the same source line appears multiple times, the targets will be joined (added).


The idea is that you can generate the indented list by DPL statements. See the following example:


'''Example 3:'''
----
{{#lsth:Examples/Module: dplmatrix (example 3)|Example}}
{{ViewTest|Examples|Module: dplmatrix (example 3)}}
'''Result:'''
{{#lsth:Examples/Module: dplmatrix (example 3)|Result}}


==Notes==
{{/test matrix}}
{{#lsth:Examples/Module: dplmatrix (example 3)|Notes}}<!--
-->
==Template content==
{{#lsth:Examples/Module: dplmatrix (example 3)|Template content}}


[[Category:Other Modules]]
[[Category:Other Modules]]

Latest revision as of 07:17, 11 April 2023

Manual dplmatrix


This function is a side entry into DPL for which there are five parameters required in a specific order, the last of which is an indented list of article names that must be passed to DPL3 to generate a matrix view. With copy/paste a matrix can be easily transferred to Excel to polish it there, like turning column texts to vertical, highlighting cells etc.


Syntax

{{#dplmatrix: name | yes | no | mode | indented_list }} where:

  1. name – The desired name of the matrix. Appears in the upper left cell. Arbitrary wiki formatting, even images, are possible.
  2. yes – The desired text/symbol indicating a link – (default is x).
  3. no – The desired text/symbol indicating the absence of a link – (default is empty).
  4. mode – The mode to display rows and columns in. Accepted mode values are:
    • flip – When specified, rows and columns are reversed or flipped.
    • normal – Normal display – (default)
  5. indented_list The indented list of article names.
    • Source articles must start in column 1.
      • In the normal mode, these articles populate the first cell of rows, and either link to or don't, the articles listed in column headers as indicated by link symbols.
    • Target items must be indented by at least one space (in normal mode, they populate column headers).
    • After the article name ~~ may be used to set article title. Row and column headers hyperlink to the articles if titles are specified they are used instead.
    • Lines which are empty or contain only spaces are silently ignored.
    • If a source line is not followed by one or more target lines, an empty table row (or column in flip mode) is shown.
    • If the same source line appears multiple times, the targets are joined (added).


Examples

The best way to understand how #dplmatrix functions, is to view described examples, such as the ones included below. The first examples illustrate manually created indented lists, to better understand the basic matrix functions. The idea, however, is to use DPL3 to generate indented lists automatically, and also mark the links between them automatically, which is demonstrated in the last example.


Example 1: {{#lsth:Examples/Module: dplmatrix (example 1)|Example}}

Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").

Result: {{#lsth:Examples/Module: dplmatrix (example 1)|Result}}


Example 2: {{#lsth:Examples/Module: dplmatrix (example 2)|Example}}

Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").

Result: {{#lsth:Examples/Module: dplmatrix (example 2)|Result}}


Example 3: {{#lsth:Examples/Module: dplmatrix (example 3)|Example}}

Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").

Result: {{#lsth:Examples/Module: dplmatrix (example 3)|Result}}

Notes

{{#lsth:Examples/Module: dplmatrix (example 3)|Notes}}

Template content

{{#lsth:Examples/Module: dplmatrix (example 3)|Template content}}