Examples/Parameter: secseparators (example 2): Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
(example parcelled out to separate page for transclusion back, and made working)
 
imported>FrozenPlum
m (Consistency fix)
Line 13: Line 13:
{{#dpl:
{{#dpl:
|category = Fruit examples
|category = Fruit examples
|listseparators = {¦ class="wikitable" ¶!Fruit ¶!Grows on ¶!Notes,¶¦-¶¦[[%PAGE%|%TITLE%]],,¶¦}
|listseparators = {¦class="wikitable" ¶!Fruit ¶!Grows on ¶!Notes,¶¦-¶¦[[%PAGE%|%TITLE%]],,¶¦}
|includepage = {Fruit-Infobox}:grows,#Notes[40 more...]
|includepage = {Fruit-Infobox}:grows,#Notes[40 more...]
|secseparators = \n¦
|secseparators = \n¦
Line 24: Line 24:
{{#dpl:
{{#dpl:
|category = Fruit examples
|category = Fruit examples
|listseparators = {¦ class="wikitable" ¶!Fruit ¶!Grows on ¶!Notes,¶¦-¶¦[[%PAGE%|%TITLE%]],,¶¦}
|listseparators = {¦class="wikitable" ¶!Fruit ¶!Grows on ¶!Notes,¶¦-¶¦[[%PAGE%|%TITLE%]],,¶¦}
|includepage = {Fruit-Infobox}:grows,#Notes[40 more...]
|includepage = {Fruit-Infobox}:grows,#Notes[40 more...]
|secseparators = \n¦
|secseparators = \n¦

Revision as of 20:22, 14 April 2022

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 will list articles in Category:Fruit examples using listseparators to define a table with three columns and put a link to the article in the first column of each row. The includepage parameter specifies a template used on each page, along with the "grows" parameter value for each row, and the "notes" page section value for pages that have that section name.

Assuming that the chapter on "Notes" contains a long text, it can be truncated (e.g., to 40 characters), specifying the text for the truncation after the number to truncate ([40 more...]. A link which refers directly to those chapters will be generated automatically if needed. Be aware that truncating with [ ] can break text formatted with wikitext or tags such as <nowiki>.

{{#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

{{#dpl: |category = Fruit examples |listseparators = {¦class="wikitable" ¶!Fruit ¶!Grows on ¶!Notes,¶¦-¶¦%TITLE%,,¶¦} |includepage = {Fruit-Infobox}:grows,#Notes[40 more...] |secseparators = \n¦ |count=5 }}