Examples/Parameter: title (example 1): Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
m (Update to include the confirmation that if there's more than one with the same name, they're displayed one after the other (this was not made clear in the manual, only became clear in further examples))
imported>FrozenPlum
m (Cross link the examples that show different outcomes for different output formatting of nearly the same statement (the behaviour is different enough that it warrants explaining).)
Line 6: Line 6:
==Example==
==Example==


This example will include the contents of the "Notes" section/heading of the [[Apple]] article, in the main namespace. If there is '''more than one section with the same name''', the contents of each are displayed one after the other.
This example will include the contents of the "Notes" section/heading of the [[Apple]] article, in the main namespace. If there is '''more than one section with the same name''', the contents of each are displayed one after the other. Note that when such content is formatted instead using <code>{{DPL|table}}</code>, each heading with the same name appears in a separate result row, as can be seen in [[Controlling output volume#include page sections|this example]].

{{note|Inclusion of page sections currently '''does not''' respect '''"noinclude"''' or '''"onlyinclude"''' tags. This page is being miscategorized into [[:Category:Fruit examples]] as a result, despite the [[Apple]] page having that category wrapped in ''noinclude'' tags.|warn}}
<pre>
<pre>
{{#dpl:
{{#dpl:
|title=Apple
|title = Apple
|include=#Notes
|include = #Notes
|eliminate = categories
}}
}}
</pre>
</pre>
Line 18: Line 19:


{{#dpl:
{{#dpl:
|title=Apple
|title = Apple
|include=#Notes
|include = #Notes
|eliminate = categories
}}
}}



Revision as of 03:52, 22 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 example will include the contents of the "Notes" section/heading of the Apple article, in the main namespace. If there is more than one section with the same name, the contents of each are displayed one after the other. Note that when such content is formatted instead using table, each heading with the same name appears in a separate result row, as can be seen in this example.

{{#dpl:
|title     = Apple
|include   = #Notes
|eliminate = categories 
}}

Result

{{#dpl: |title = Apple |include = #Notes |eliminate = categories }}