Difference between revisions of "DPL Example 003"
Line 26: | Line 26: | ||
table =,Country,Area,Population,#hits | table =,Country,Area,Population,#hits | ||
format =,,\n|align=right|²{#ifexpr:%COUNT%>2400¦<big>'''²{#replace:%COUNT%¦/([0-9]{3})$/¦.\1}²'''</big>¦²{#replace:%COUNT%¦/([0-9]{3})$/¦.\1}²}², | format =,,\n|align=right|²{#ifexpr:%COUNT%>2400¦<big>'''²{#replace:%COUNT%¦/([0-9]{3})$/¦.\1}²'''</big>¦²{#replace:%COUNT%¦/([0-9]{3})$/¦.\1}²}², | ||
− | tablerow=align=right|%%,align= | + | tablerow= |
+ | align=right|%%,align=right | ||
+ | ²{#if:²{#pos:%%¦133}²¦bgcolor=#ff9999¦bgcolor=#ffffaa}²|<small>%%</small> | ||
</dpl> | </dpl> |
Revision as of 22:38, 5 June 2009
back to list of examples
Create a table of articles based on template parameters, apply individual formatting to columns, add meta data
We show various template parameters. We add meta data (in this case the hit count). We format huge hit counts using a big font. We put a decimal point before the last three digits. Population is right justified and in small font. Populations with '133' occuring in the number get a red background color.
<dpl> category=African Union member states nottitlematch=Sudan addpagecounter=true includepage ={Infobox Country or territory}:area:population_estimate format =,,\n|align=right|²{#ifexpr:%COUNT%>2400¦<big>'''²{#replace:%COUNT%¦/([0-9]{3})$/¦.\1}²'''</big>¦²{#replace:%COUNT%¦/([0-9]{3})$/¦.\1}²}², table =,Country,Area,Population,#hits tablerow =align=right|%%,align=right ²{#if:²{#pos:%%¦133}²¦bgcolor=#ff9999¦bgcolor=#ffffaa}²|<small>%%</small> </dpl>
The above DPL command produces the following output:
Extension:DynamicPageList (DPL), version 3.2.1: Warning: Unknown parameter 'align' was ignored. Help: available parameters: addauthor, addcategories, addcontribution, addeditdate, addexternallink, addfirstcategorydate, addlasteditor, addpagecounter, addpagesize, addpagetoucheddate, adduser, allowcachedresults, allrevisionsbefore, allrevisionssince, articlecategory, cacheperiod, categoriesminmax, category, categorymatch, categoryregexp, columns, count, createdby, debug, distinct, dominantsection, eliminate, escapelinks, execandexit, firstrevisionsince, fixcategory, format, headingcount, headingmode, hiddencategories, hitemattr, hlistattr, ignorecase, imagecontainer, imageused, include, includematch, includematchparsed, includemaxlength, includenotmatch, includenotmatchparsed, includepage, includesubpages, includetrim, inlinetext, itemattr, lastmodifiedby, lastrevisionbefore, linksfrom, linksto, linkstoexternal, listattr, listseparators, maxrevisions, minoredits, minrevisions, mode, modifiedby, multisecseparators, namespace, noresultsfooter, noresultsheader, notcategory, notcategorymatch, notcategoryregexp, notcreatedby, notlastmodifiedby, notlinksfrom, notlinksto, notmodifiedby, notnamespace, nottitlematch, nottitleregexp, notuses, offset, oneresultfooter, oneresultheader, openreferences, order, ordercollation, ordermethod, qualitypages, randomcount, redirects, replaceintitle, reset, resultsfooter, resultsheader, rowcolformat, rows, rowsize, scroll, secseparators, showcurid, shownamespace, skipthispage, stablepages, suppresserrors, table, tablerow, tablesortcol, title, titlegt, titlelt, titlematch, titlemaxlength, titleregexp, usedby, userdateformat, uses
.
Extension:DynamicPageList (DPL), version 3.2.1: Warning: Unknown parameter '{{#if:{{#pos:%%|133}}|bgcolor' was ignored. Help: available parameters: addauthor, addcategories, addcontribution, addeditdate, addexternallink, addfirstcategorydate, addlasteditor, addpagecounter, addpagesize, addpagetoucheddate, adduser, allowcachedresults, allrevisionsbefore, allrevisionssince, articlecategory, cacheperiod, categoriesminmax, category, categorymatch, categoryregexp, columns, count, createdby, debug, distinct, dominantsection, eliminate, escapelinks, execandexit, firstrevisionsince, fixcategory, format, headingcount, headingmode, hiddencategories, hitemattr, hlistattr, ignorecase, imagecontainer, imageused, include, includematch, includematchparsed, includemaxlength, includenotmatch, includenotmatchparsed, includepage, includesubpages, includetrim, inlinetext, itemattr, lastmodifiedby, lastrevisionbefore, linksfrom, linksto, linkstoexternal, listattr, listseparators, maxrevisions, minoredits, minrevisions, mode, modifiedby, multisecseparators, namespace, noresultsfooter, noresultsheader, notcategory, notcategorymatch, notcategoryregexp, notcreatedby, notlastmodifiedby, notlinksfrom, notlinksto, notmodifiedby, notnamespace, nottitlematch, nottitleregexp, notuses, offset, oneresultfooter, oneresultheader, openreferences, order, ordercollation, ordermethod, qualitypages, randomcount, redirects, replaceintitle, reset, resultsfooter, resultsheader, rowcolformat, rows, rowsize, scroll, secseparators, showcurid, shownamespace, skipthispage, stablepages, suppresserrors, table, tablerow, tablesortcol, title, titlegt, titlelt, titlematch, titlemaxlength, titleregexp, usedby, userdateformat, uses
.
|- |Cameroon |475,442 |16,323,000 |align=right|Expression error: Unrecognized punctuation character "%". |- |Nigeria |923,768 |133,530,0001 |align=right|Expression error: Unrecognized punctuation character "%". |- |Somalia |637,657 |8,228,000 |align=right|Expression error: Unrecognized punctuation character "%".