Help:Page selection criteria

From Ballotpedia
Revision as of 10:07, 30 July 2013 by Abqualls (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Page selection

Basic DPL's are composed of the opening tag and then a number of prompts, similar to a transcluded info-box. These prompts tell the dpl which pages to collect, what information to collect from the pages and how to present it on a page. The most basic DPL merely provides a criteria for page selection. The following commands are commonly used to select certain pages to include in the DPL:

PromptCriteria included
“|category = "Summons all pages in a category.
“|notcategory = " Excludes a particular category from the list.
“|categorymatch = "Includes categories using a keyword search. For example “|categorymatch = %Kansas%” would include pages from all categories that have “Kansas” in the category name. % denote additional characters on that side of the text. I have found this works best with single words and not text strings.
“|namespace = " Summons all pages that are within a namespace including “Talk, Category, Judgepedia, WikiProject, etc.” Namespaces with multiple words use an underscore (_) between words.
“notnamespace = " Excludes a particular namespace from the list.
“|title = " Includes a specific page based on exact title.
“|titlematch = " Similar to categorymatch but with titles.
“|nottitlematch = " Excludes pages based on the presence of a specific portion of text in their title.
[1]

Examples

Example:  Category
Code:  
{{#dpl:
|category = Current member, Indiana State Senate
}}
Description:  
Will produce a bulleted list of all of the pages within the category, “Current member, Indiana State Senate”.
Example:  


Example:  Title
Code:  
{{#dpl:
|title = Governor of Michigan
}}
Description:  
Will produce a single item list including the page with the title “Governor of Michigan”
Example:  
Governor of Michigan


Example:  Matching
Code:  
{{#dpl:
|titlematch = %Kansas%
|count = 10
}}
Description:  
Will produce a list of 10 pages that have the word “Kansas” in the title.
Example:  


Complex selection criteria

  • You can create “and” “or” statements using combinations of criteria and categories.
  • Two categories separated by a pipe will summon all of the pages that contain either Category1 or Category2.
  • |category = Category1{{!}}Category2
  • Two categories listed separately will list all of the pages that contain both categories.
  • |category = Category1
    |category = Category2
  • You can restrict results to only categories or to only pages by adding controls for namespace.
  • You can add a specific page to a list by adding “|title = “ or remove a specific page using “|nottitlematch =“.
  • Whenever you add more than one criteria to a DPL it automatically creates an "and" function which requires both of those criteria to be met.[2]

Examples

Example:  And statement with restriction
Code:  
{{#dpl:
|category = Current member, Illinois State Senate
|category = State senators first elected in 1994
|notcategory = Republican Party
|count = 10
}}
Description:  
Will produce a bulleted list of all the pages that contain both the category “Current member, Illinois State Senate” and “State senators first elected in 1994” but will exclude all of the above pages with the category “Republican Party”. The count is restricted to ten pages for simplicity.
Example:  


Example:  Or Statement
Code:  
{{#dpl:
|category = Current member, Illinois State Senate{{!}}Former member, Illinois State Senate
|count = 10
}}
Description:  
Will produce a bulleted list of all of the pages within the category, “Current member, Illinois State Senate” as well as all of the pages within the category “Former member, Illinois State Senate”. These pages will be mixed together and not separated out. The count is restrict to ten for simplicity.
Example:  


Example:  Category and Limiting Namespace
Code:  
{{#dpl:
|category = Former member, Illinois House of Representatives
|notnamespace = Category
}}
Description:  
Will produce a bulleted list of all of the pages within the category, “Former member, Illinois House of Representatives” but will specifically exclude the categories that are listed within that category. Note that this is not default and any category with both pages and categories listed under it will display both regular pages and categories in a DPL. Count is limited to ten for simplicity.
Example:  


Example:  Matching title with limited namespaces
Code:  
{{#dpl:
|titlematch = %Kansas%
|notnamespace = Talk
|notnamespace = Template_talk
|notnamespace = Category_talk
}}
Description:  
Will produce a bulleted list of all pages with “Kansas” in the title but will exclude all “Talk:”, “Template talk:” and “Category talk:” pages. Count is limited to ten for simplicity.
Example:  


References

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.