Examples/Parameter: secseparators (example 2)
Example
[edit source]
This list pages in category Fruit examples using listseparators (alias for format) to define a table with three columns and headers. It also specifies the content for the first column as the page name. The includepage parameter specifies a template used on each page, along with the "grows" and "notes" parameter value for each row.
format=Startall,Start,End,Endall where Startall, Start, End and Endall are wiki tags used to separate the list items:
Startallbefore all — e.g., may specify wikitext to begin a table (including headers).Startbefore each — e.g., may specify wikitext to begin row, its cell and cell content.Endafter each — e.g., may specify content to end a cell or row.Endallafter all — e.g., may specify content to end a table.
|debug = 5 can be added to view any resultant wikitext given, and should always be put at the top of the statement, a value of 0 disables it.
Assuming the chapter on "Notes" contains a long text, it can be truncated (e.g., shortened to 40 characters) by specifying the text for truncation after the number to truncate ([40 more...]. A link direct to those chapters is generated automatically. Be aware that truncating with [ ] can break text formatted with wikitext or tags such as <nowiki>.
- Code
{{#dpl:
|category = Fruit examples
|listseparators = {¦class="wikitable" ¶!Fruit ¶!Grows on ¶!Notes,¶¦-¶¦[[%PAGE%|%TITLE%]],,¶¦}
|includepage = {Fruit-Infobox}:grows,#Notes[40 more...]
|secseparators = \n¦
|count = 5
}}
- Result
| Fruit | Grows on | Notes |
|---|---|---|
| Apple | On trees |
There are multiple varieties of more... Apples skins contain more fiber more... |
| Grape | On vines | |
| Orange | On trees | |
| Plum | ||
| Banana | On a tree-like plant |