Help:DPL section transclusion

From Ballotpedia
Jump to: navigation, search

Include criteria

  • The “|include = “ criteria is the essential criteria for adding all substantial content from any given page.
  • Using the includes criteria you can add 1.sections by their location, 2.Sections by their title, and 3.information from inclusion templates.
  • Multiple pieces of information from multiple sources are separated by a comma within the include criteria.
  • Formatting the information in an understandable fashion will be covered in Lesson 6. If you run a DPL without proper formatting, it will list the requested information at the end of each DPL entry.

Including sections by location

  • You can add a section based on its location on the page using the code:
“|include = %1,%6,%-1”
  • The %sign indicates you are pulling a section. The above code pulls three different sections assuming that the page is at least 7 sections long.
  • The sections are ordered on the page without considering level.
  •  %-1 is a special character that includes the final section of a page.  %-2 and up DO NOT exist. This final section should usually be the references and will almost always include all of the pages templates.

Example

Example:  Section transclusion by location
Code:  
{{#dpl:
|title = Joe Donnelly
|ordermethod = firstedit
|include = %1,%4,%-1
|eliminate = categories
|format = ,[[%PAGE%]],,
}}
Description:  
Will produce a single item list including the page with the title “Joe Donnelly” and incorporating the first, fourth and final sections of the page.
Example:  
Joe Donnelly

Donnelly was born in Queens, New York. He graduated from the University of Notre Dame with a B.A. in Government in 1977. Donnelly also graduated from the University of Notre Dame Law School in 1981.[1]

Political offices
Preceded by
Richard Lugar
U.S. Senate - Indiana
2013-Present
Succeeded by
'
Preceded by
Chris Chocola
U.S. House of Representatives - Indiana, District 2
2007–2013
Succeeded by
Jackie Walorski
Preceded by
'
School Board for Mishawaka Marian High School, Indiana
1997 to 2001
Succeeded by
'
Preceded by
'
Indiana State Election Board
1988-1989
Succeeded by
'


Including sections by title

  • There are two ways to include sections based on heading text.
  • You can use the exact heading of the section, i.e.:
  • “|include = #Political_career”
  • Headings must match up exactly.
  • Headings cannot include punctuation.
  • Multi-word headings must include underscores between words.
  • DPL’s will pull both headings if the page has more than one heading with the same name.
  • You can include all headings which contain a string of characters, i.e.:
  • “|include = ##.*career.*”
  • This will include the heading “Political career”, “Federal political career” or any other heading with “career” in it.
  • DPL’s will pull both headings if the page has more than one heading with the same text string.
  • This is useful if the headings your are trying to pull have punctuation or are inexact.

Example

Example:  Section transclusion by heading
Code:  
{{#dpl:
|title = Richard Lugar
|ordermethod = firstedit
|include = #Career
|format = ,[[%PAGE%]],,
}}
Description:  
Will produce a single item list including the page with the title “Richard Lugar” and incorporating the section "Career".
Example:  
Richard Lugar


Limiting the size of the section

You can limit the size of a section of transcluded text by placing a filter immediately after the text. The filter code looks like:

[CHARACTERLIMIT LINKTEXT]

Example

Example:  Limited section transclusion by heading with redirect.
Code:  
{{#dpl:
|title = Richard Lugar
|ordermethod = firstedit
|include = #Career[25 ...for the full section go here]
|format = ,[[%PAGE%]],,
}}
Description:  
Will produce a single item list including the page with the title “Richard Lugar” and incorporating the section "Career" and limiting the text that will appear to 25 character and providing a redirecting link.
Example:  
Richard Lugar


Example:  Limited section transclusion by location without redirect.
Code:  
{{#dpl:
|title = Richard Lugar
|ordermethod = firstedit
|include = %2[25]
|format = ,[[%PAGE%]],,
}}
Description:  
Will produce a single item list including the page with the title “Richard Lugar” and incorporating the section "Career" and limiting the text that will appear to 25 character and allowing for the natural redirect link.
Example:  
Richard Lugar