Arbeiten mit DPL3: Difference between revisions

No edit summary
No edit summary
Line 23: Line 23:
Restricting the output to a certain number of results can be done with "count" (count=2).
Restricting the output to a certain number of results can be done with "count" (count=2).


=== Example ===
 
'''Example:'''
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function).
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function).


'''Result of the function call:'''
Result of the function call:
{{#dpl:
{{#dpl:
|category=Illustration
|category=Illustration
Line 50: Line 51:
** (include={ImageMetadata}:work-title:year:%PAGE%)
** (include={ImageMetadata}:work-title:year:%PAGE%)


=== Example ===
 
'''Example:'''
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function). Some include statements only make sense in combination with specific page selection criteria.
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function). Some include statements only make sense in combination with specific page selection criteria.


'''Result of the function call:'''
Result of the function call:
{{#dpl:
{{#dpl:
|uses=Template:ImageMetadata
|uses=Template:ImageMetadata
Line 76: Line 78:
* (include={ImageMetadata}:work-title:year |table=class="wikitable imageTable", Image, Work Title, Year)
* (include={ImageMetadata}:work-title:year |table=class="wikitable imageTable", Image, Work Title, Year)


=== Example ===
 
'''Example:'''
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function). Some include statements only make sense in combination with specific page selection criteria.
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function). Some include statements only make sense in combination with specific page selection criteria.


'''Result of the function call:'''
Result of the function call:
{{#dpl:
{{#dpl:
|uses=Template:ImageMetadata
|uses=Template:ImageMetadata
Line 88: Line 91:


=== Userformat Output ===
=== Userformat Output ===
"Userformat" mode makes the output fully flexible, enabling formatting with wikitext and supported html elements. This mode has a system of three tags which are used to enclose (a) the whole output, (b) each item, (c) each transcluded section of an item.
"Userformat" mode makes the output fully flexible, enabling formatting with wikitext and supported html elements. This mode has a system of three tags which are used to enclose (a) the whole output, (b) each item, (c) each transcluded section of an item; they can also contain [https://dpl3.wikitide.org/wiki/Controlling_output_format#variables| variables]:
* listseparators
** (listseparators = <Outputstart>,<Itemstart>,<Itemend>,<Outputend>)
** (listseparators = \n ''Start of the List'' \n,~ , \n,\n ''End of the List'')
* secseparators
** (secseparators=1a,1b,2a,2b,3a,3b)
 
 
'''Example:'''
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function).
 
Result of the function call:
{{#dpl:
|uses=Template:ImageMetadata
|include={ImageMetadata}:work-title,{ImageMetadata}:year,{ImageMetadata}:id
|mode=userformat
|listseparators=A,B,C,D
|secseparators=1a,1b,2a,2b,3a,3b
}}
 
 
Result of the function call:
{{#dpl:
|uses=Template:ImageMetadata
|include={ImageMetadata}:work-title,{ImageMetadata}:year,{ImageMetadata}:id
|mode=userformat
|listseparators=A <br>, \n# B , C, <br> D
|secseparators= [[%PAGE%|%TITLE%]] a '' , '' b , c (,) d , e ''',''' f
}}
 
 
The parameter "format" implicitly sets "mode=userformat" and enables similar styling to the "listseperator" parameter.
* (format=A,B,C,D,E)
* (format=,\n<span style="font-size: ²{#expr:%NR% * 0.5}²em;">'''[[%PAGE%]]''',</span> \n ,)
* (|uses=Template:ImageMetadata |format    = «gallery mode="packed" widths="80px" heights="80px"»,%PAGE%\n,,«/gallery»)
 


==== Example ====
'''Example:'''
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function). Some include statements only make sense in combination with specific page selection criteria.
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function).


'''Result of the function call:'''
Result of the function call:
{{#dpl:
{{#dpl:
|uses=Template:ImageMetadata
|uses=Template:ImageMetadata
|include={ImageMetadata}:work-title:year
|include={ImageMetadata}:work-title,{ImageMetadata}:year,{ImageMetadata}:id
|table=class="wikitable imageTable", Image, Work Title, Year
|format=,\n<span style="font-size: ²{#expr:%NR% * 0.5}²em;">'''[[%PAGE%]]''',</span> \n ,
}}
}}




=== Table Output ===
=== Table Output ===
The "table" parameter creates a standard wikitable in wikitext syntax. If no class attribute is specified, the default class is "wikitable".
Relevant parameters are:
* table
** (table= ,Header1,Header2,Header3,Header4,Header5)
** (table= class="imageTable wikitable" style="color:seagreen; font-weight:600;", File, Title, Work Title, Year, Chapter)
* tablerow
** (tablerow=%%,%%,%%,%%,%%)
** (|include={ImageMetadata}:%TITLE%:ill-title:work-title:year:chapt |table= ,-,Image,Title,Book Title,Year of Publication,Chapter |tablerow=[[File:%%{{!}}x100px]],'''%%''',''%%'',%%,%%)
* tablesortcol (number starting at 1)
'''Example:'''
The example can be changed to see how the different parameters work in real time (using the Preview all changes can be observed while working on the parser function).
Result of the function call:
{{#dpl:
|uses=Template:ImageMetadata
|include={ImageMetadata}:ill-title:work-title:year:chapt
|table= ,Image,Title,Book Title,Year of Publication,Chapter
}}