Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Search
Editing
DPL3/Parameters: Controlling output format
(section)
From KB42
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
Edit source
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=====multisecseparators===== {{DPL parameter |name = multisecseparators |purpose= put a tag between multiple transcluded parts which refer to the same template or chapter. }} Syntax: {{DPL syntax|multisecseparators=''sep1'',''sep2'',...}} The tags correspond to the transcluded section (see {{dpl3|includepage|=name1,name2,...}}). Symbolic replacements of {{tt|%PAGE%}} etc. take place as described in {{dpl3|listseparators}}. In addition, the variable {{tt|%SECTION%}} can be used to refer to the section found (works only for chapter headings). It will give you the precise name of each heading even if you used a regular expression (double ##) in the include statement. If an article uses the same template more than once you will get all references with {{tt|sepN}} as a separator. Example:<!-- <pre><nowiki><- ---original dpl example, changed below to present a working example--- -> <dpl> category=TestSSt includepage={interfaces_overview} dpl mode=userformat listseparators=¶{|class=sortable ¶!Interface ¶!Source system ¶!Target system ¶!Technology,¶|-¶|[[%PAGE%]] ¶,¶,¶|} secseparators = \n| multisecseparators=¶|-¶|&nbsp;| </dpl> </nowiki></pre>--> {| class="dpl multisec" |- class="dpl pre" |colspan=2|<pre><nowiki> <dpl> titlematch = DPL% nottitlematch = %volume%|%page selection% uses = Template:DPL Parameter include = {dpl manual}:[[%PAGE%|%TITLE%]],{dpl parameter}:name:purpose[50] mode = userformat listseparators = ¶{|class="wikitable sortable" ¶!colspan=3|Fields cannot be formatted within the include¶|-¶!Page ¶!Name ¶!Purpose,¶|-,¶|-¶|class="dpl blue-background" colspan=3|¶|-,¶|} secseparators = ¶|,,¶|class="dpl dark-background"|, multisecseparators= ,\n|-¶|¶|class="dpl light-background"| </dpl> </nowiki></pre> |- |colspan=2| {| |<dpl> titlematch = DPL% nottitlematch = %volume%|%page selection% uses = Template:DPL Parameter include = {dpl manual}:[[%PAGE%|%TITLE%]],{dpl parameter}:name:purpose[50] mode = userformat listseparators = ¶{|class="wikitable sortable" ¶!colspan=3|Fields cannot be formatted within the include¶|-¶!Page ¶!Name ¶!Purpose,¶|-,¶|-¶|class="dpl blue-background" colspan=3|¶|-,¶|} secseparators = ¶|,,¶|class="dpl dark-background"|, multisecseparators= ,\n|-¶|¶|class="dpl light-background"| </dpl> |} |- |colspan=2|Values cannot be formatted within {{dpl3|include}}, as formatting can only occur in formatting statements (in these examples {{dpl3|listseparators}}, {{dpl3|secseparators}}, and {{dpl3|multisecseparators}}). {{tt|%VARIABLES%}} can be omitted from the {{dpl3|include}}, and instead be placed in these formatting statements, for further formatting.<br/> We can achieve some field formatting by changing some of the above dpl statements: |- class="dpl cols2 pre" | include = {dpl manual}:{{code|%TITLE%|class="dpl light-background"}},{dpl parameter}:name:purpose[50] listseparators = ¶{|class="wikitable sortable" ¶!colspan=3|Fields... secseparators¶|-¶!Page ¶!Name ¶!Purpose,¶|-,¶|-¶|class="dpl blue-background" colspan=3|¶|-,¶|} secseparators = ¶|{{code|<nowiki>[[%PAGE%|{{#explode:,|:|1}}]]</nowiki>|class="dpl light-background"}},¶|class="dpl dark-background"|, | include = {dpl manual}:{{code||class="dpl light-background"}},{dpl parameter}:name:purpose[50] listseparators = ¶{|class="wikitable sortable" ¶!colspan=3|%VARIABLES%... listseparators¶|-¶!Page ¶!Name ¶!Purpose,¶|-{{code|<nowiki>¶|[[%PAGE%|{{#explode:%TITLE%|:|1}}]]</nowiki>|class="dpl light-background"}},¶|-¶|class="dpl blue-background" colspan=3|¶|-,¶|} secseparators = {{code||class="dpl light-background"}},,¶|class="dpl dark-background"|,{{code|<nowiki>,¶|,</nowiki>|class="dpl light-background"}} |- class="dpl cols2" |<dpl> titlematch = DPL% nottitlematch = %volume%|%page selection% uses = Template:DPL Parameter include = {dpl manual}:%TITLE%,{dpl parameter}:name:purpose[50] mode = userformat listseparators = ¶{|class="wikitable sortable" ¶!colspan=3|These fields are formatted within secseparators¶|-¶!Page ¶!Name ¶!Purpose,¶|-,¶|-¶|class="dpl blue-background" colspan=3|¶|-,¶|} secseparators = ¶|[[%PAGE%|{{#explode:,|:|1}}]],¶|class="dpl dark-background"|, multisecseparators= ,\n|-¶|¶|class="dpl light-background"| </dpl> |<dpl> titlematch = DPL% nottitlematch = %volume%|%page selection% uses = Template:DPL Parameter include = {dpl manual}:,{dpl parameter}:name:purpose[50] mode = userformat listseparators = ¶{|class="wikitable sortable" ¶!colspan=3|%TITLE% is added and formatted within listseparators¶|-¶!Page ¶!Name ¶!Purpose,¶|-¶|[[%PAGE%|{{#explode:%TITLE%|:|1}}]],¶|-¶|class="dpl blue-background" colspan=3|¶|-,¶|} secseparators = ,,¶|class="dpl dark-background"|,,¶|, multisecseparators= ,\n|-¶|¶|class="dpl light-background"| </dpl> |- |colspan=2|Formatting handled by a phantom template (eg. [[Template:DPL_parameter_dpl]]) will apply to both {{dpl3|secseparators}} and {{dpl3|multisecseparators}}.<br/>If separate formatting is required, it needs to be assigned to their respective parameters (as shown below). |- |colspan=2|To prevent truncated words, see [[Template:DPL_parameter_dpl.nowordbreak]] (which uses [[Template:nowordbreak]]). |- |colspan=2|<pre><nowiki> titlematch = DPL% nottitlematch = %volume%|%page selection% uses = Template:DPL Parameter include = {dpl manual}:,{DPL parameter} dpl mode = userformat listseparators = ¶{|class="wikitable sortable" ¶!colspan=3|Includes a phantom template¶|-¶!Page ¶!Name ¶!Purpose,¶|-¶|[[%PAGE%|{{#explode:%TITLE%|:|1}}]],¶|-¶|class="dpl blue-background" colspan=3|¶|-,¶|} secseparators = ,,¶|class="dpl dark-background"|,,¶|, multisecseparators= ,\n|-¶|¶|class="dpl light-background"| </nowiki></pre> |- class="dpl cols2" |<dpl> titlematch = DPL% nottitlematch = %volume%|%page selection% uses = Template:DPL Parameter include = {dpl manual}:,{DPL parameter} dpl mode = userformat listseparators = ¶{|class="wikitable sortable" ¶!colspan=3|Includes a phantom template¶|-¶!Page ¶!Name ¶!Purpose,¶|-¶|[[%PAGE%|{{#explode:%TITLE%|:|1}}]],¶|-¶|class="dpl blue-background" colspan=3|¶|-,¶|} secseparators = ,,¶|class="dpl dark-background"|,,¶|, multisecseparators= ,\n|-¶|¶|class="dpl light-background"| </dpl> |<dpl> titlematch = DPL% nottitlematch = %volume%|%page selection% uses = Template:DPL Parameter include={dpl manual}:,{DPL parameter} dpl.nowordbreak mode = userformat listseparators = ¶{|class="wikitable sortable" ¶!colspan=3|Includes a phantom template with Template:nowordbreak¶|-¶!Page ¶!Name ¶!Purpose,¶|-¶|[[%PAGE%|{{#explode:%TITLE%|:|1}}]],¶|-¶|class="dpl blue-background" colspan=3|¶|-,¶|} secseparators = ,,¶|class="dpl dark-background"|,,¶|, multisecseparators= ,\n|-¶|¶|class="dpl light-background"| </dpl> |} As you can see, the results resemble the list generated on the [[Extension:DPL3/Manual|title page]] of this manual, whose dpl is as follows: <pre><nowiki> <dpl> nottitlematch=%volume%|%page selection% namespace = Help uses = Template:DPL parameter mode = userformat replaceintitle = @DPL Manual/@, include = {DPL Manual}:[[%PAGE%|%TITLE%]],{DPL parameter}/dpl listseparators={|class=wikitable,\n|-\n|,,\n|} secseparators=,,\n|\n{|class="wikitable sortable" width=100%\n!width=140px|name\n!purpose\n|-\n|,\n|} multisecseparators=,\n|-\n| allowcachedresults = true </dpl> </nowiki></pre> <dpl> nottitlematch=%volume%|%page selection% namespace = Help uses = Template:DPL parameter mode = userformat replaceintitle = @DPL Manual/@, include = {DPL Manual}:[[%PAGE%|%TITLE%]],{DPL parameter}/dpl listseparators={|class=wikitable,\n|-\n|,,\n|} secseparators=,,\n|\n{|class="wikitable sortable" width=100%\n!width=140px|name\n!purpose\n|-\n|,\n|} multisecseparators=,\n|-\n| allowcachedresults = true </dpl> See also {{dpl3|Test article structure}}.
Summary:
Please note that all contributions to KB42 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
KB42:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
DONATE
Wiki tools
Wiki tools
Special Pages
Categories
Import Pages
Cargo data
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs