Examples/Parameter: format (example 3): Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
(Flesh out and explain this example in greater detail (the meaning of startall vs start, and end vs endall was not well explained, just vaguely referenced as start/end being the "innter frame" and startall/endall being the "outer frame" of contents). A more concrete explanation can be very beneficial to clarify this.)
 
imported>FrozenPlum
m (Shuffle the order of this)
Line 21: Line 21:
}}
}}
</pre>
</pre>

'''Notes:'''
* <code>''Start''</code> position of the <code>format=</code> syntax starts and formats a row of output, which is then applied to ''each'' item in the result set.
* In the case of results outside of the ''Main'' namespace, such as in the "Category" namespace, if "Category:" is not desired in the page title/link, <code><nowiki>[[%PAGE%|%TITLE%]]</nowiki></code> can be used instead.
* The {{DPL|table}} parameter, in combination with {{DPL|tablerow}} and the {{DPL|include}}/{{DPL|includepage}} parameter, can also be used to output table syntax.


OR
OR
Line 32: Line 37:
</dpl>
</dpl>
</pre>
</pre>

'''Notes:'''
* <code>''Start''</code> position of the <code>format=</code> syntax starts and formats a row of output, which is then applied to ''each'' item in the result set.
* In the case of results outside of the ''Main'' namespace, such as in the "Category" namespace, if "Category:" is not desired in the page title/link, <code><nowiki>[[%PAGE%|%TITLE%]]</nowiki></code> can be used instead.
* The {{DPL|table}} parameter, in combination with {{DPL|tablerow}} and the {{DPL|include}}/{{DPL|includepage}} parameter, can also be used to output table syntax.


==Result==
==Result==

Revision as of 04:51, 10 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:Number examples that linkto the article named Two. The results will be limited to a count of five, and the format made into a table by doing the following in the format statement (whose syntax is: format = Startall,Start,End,Endall):

  • {| in Startall position of the syntax, to specify the wikitext to begin a table.
  • ¶¦-¶¦ followed by [[%PAGE%]] in the Start position of the syntax, to specify the wikitext to begin a table row and cell, followed by a link to the page.
  • The End position of the syntax is intentionally omitted because there is no wikitext required to end a table row.
  • ¶|} in the "Endall" position of the syntax, to specify the table-end wikitext.
{{#dpl:
|category = Number examples
|linksto  = Two
|count    = 5
|format   = {¦ class="wikitable"¶!pages found,¶¦-¶¦[[%PAGE%]],,¶¦}
}}

Notes:

  • Start position of the format= syntax starts and formats a row of output, which is then applied to each item in the result set.
  • In the case of results outside of the Main namespace, such as in the "Category" namespace, if "Category:" is not desired in the page title/link, [[%PAGE%|%TITLE%]] can be used instead.
  • The table parameter, in combination with tablerow and the include/includepage parameter, can also be used to output table syntax.

OR

<dpl>
 category = Number examples
 linksto  = Two
 count    = 5
 format   = {| class="wikitable"¶!pages found,¶|-¶|[[%PAGE%]],,¶|}
</dpl>

Result

{{#dpl: |category = Number examples |linksto = Two |count = 5 |format = {¦ class="wikitable"¶!pages found,¶¦-¶¦%PAGE%,,¶¦} }}