SLP Badge Transparent.png
Read the
State Legislative Tracker
New edition available now!

Help:DPL basic formatting

From Ballotpedia
Jump to: navigation, search

Ordering your results

  • You can change the order of the entries in a dpl by adding the criteria: “|ordermethod = “. Possible orderings include:
CodeSort Category
|ordermethod = sizeSorts by pages size. (Need “|addpagesize = true” in the code)
|ordermethod = firstedit/lasteditSorts by the page creation or the last time the page was edited. (Need “|addeditdate = true” in the code)
|ordermethod = titleSorts by title, default sort.
|ordermethod = categoryaddSorts by the date that the page was added to the first category listed.
More Here
  • You can change the order from ascending to descending using “|order= “ and either “ascending” or “descending”
  • These changes will all work on Ballotpedia. Regretfully the DPL code on Judgepedia is currently broken and all DPL’s require the code, “|ordermethod = firstedit/lastedit”[1]

Formatting your results

  • DPL’s naturally format as a bulleted list of entries and include only the name of the page.
  • You can use the “|format = “ criteria to override this and edit the information how you would like it to appear.
  • The code for the format line contains four important elements and each element is separated by a comma:
  • “|format = TEXT1,TEXT2,TEXT3,TEXT4”
  • TEXT1: Information and code that should appear in front of the entire DPL appears before the first comma in the code.
  • TEXT2: Information and code that should appear at the front of every individual page entry goes after the first comma but before the second.
  • TEXT3: Information and code that should appear at the end of every individual page entry goes after the second comma but before the third.
  • TEXT4: Finally information that goes at the end of the DPL goes after the third comma
  • Any wiki or HTML code can be added in these sections to edit the font, build a table with the information (HTML only) or change it from bulleted to numbered lists.
  • \n* = indicates that every entry will start on a new line with a bullet
  • \n# = indicates that every entry will start on a new line with a number
  • All punctuation MUST use html numbers which can be found here in column 3.[2]
  • IMPORTANT NOTE: including a format line requires you to tell the DPL where in the format you want the page title to appear. This can be done by using the code [[%PAGE%{{!}}%TITLE%]] for a linked title or %TITLE% for a nonlinked title.

More on editing format lines will come in Lesson 6.


Example:  Formatted numbered list
|category = Former federal judge
|notnamespace = Category
|ordermethod = firstedit
|format = <center>This is a list of former federal judges:<center><hr>,\n#Judge [[%PAGE%{{!}}%TITLE%]],is awesome., ,<br/>List completed!
|count = 10
Complex formatting with a numbered list.

Extension:DynamicPageList (DPL), version 2.01 : Warning: No results.


You'll notice that the references did not carry through. That is because DPL's currently delete all references above them. You should be cautious where you place them on your page.