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!
===columns=== {{DPL parameter |name = columns |purpose= Define a column layout for the output. }} Syntax: {{DPL syntax|columns=''ncols''}} '''Example:''' <pre><nowiki> <dpl></nowiki> category = Help nottitlematch = %DPL% includesubpages = false columns = 3 rowcolformat = width=100% count = 6 </dpl> </pre> Simply displays non-DPL articles and subcategories in [[:Category:Help]] in 3 columns ({{dpl3|rowcolformat}} is used to make the table width 100%). <dpl> category = Help nottitlematch = %DPL% includesubpages = false columns = 3 rowcolformat = width=100% count = 6 </dpl> Note: {{dpl3|columns}} is currently bugged (possible combatibility issue between [[mw:MediaWiki 1.31|Mediawiki 1.31.2]] and DPL3 v3.3.3) <ref name="columns bug"/>.<br/> For a 3-column dpl, css can be used to achieve the desired results: <pre><nowiki> <div style="-webkit-column-count:3;column-count:3;"> <dpl> category = Help nottitlematch = %DPL% includesubpages = false columns = 3 rowcolformat = width=100% count = 6 </dpl></div></nowiki></pre> <div style="-webkit-column-count:3;column-count:3;"> <dpl> category = Help nottitlematch = %DPL% includesubpages = false columns = 3 rowcolformat = width=100% count = 6 </dpl></div> '''More complex example:''' In {{dpl3|mode|=userformat}} the outer tags from {{dpl3|listseparators}} will be repeated for each column. <pre><nowiki> <div style="-webkit-column-count:3;column-count:3;"> <dpl></nowiki> category = Help nottitlematch = %DPL% includesubpages = false addpagesize = true ordermethod = size listseparators = {|class=sortablewikitable id=2\n!Rank\n!Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|style="text-align:right;"|%SIZE%,\n|-,\n|} columns = 2 count = 6 </dpl></div> </pre> This output contains a list of the largest non-DPL articles in [[:Category:Help]]. Each column consists of a table which has itself three columns: rank, article name and size. <div style="-webkit-column-count:3;column-count:3;"> <dpl> category = Help nottitlematch = %DPL% includesubpages = false addpagesize = true ordermethod = size listseparators = {|class=sortablewikitable id=2\n!Rank\n!Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|style="text-align:right;"|%SIZE%,\n|-,\n|} columns = 2 count = 6 </dpl></div>
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