Template:Searchnews

Revision as of 00:02, 18 February 2009 by Jacki Buros (talk | contribs)
Jump to navigation Jump to search


Template usage

  • use like
    • {{Searchnews}} to display all news titles (10 articles by default)
    • {{Searchnews|find=pci}} to search for pci (case insensitive).
    • {{Searchnews|find=pci|find1=STEMI}} to search for pci OR STEMI (case insensitive).
    • {{Searchnews|find=pci|find1=\bMI\b}} to search for pci OR MI (case insensitive, MI occuring as a whole word).

Notes on usage

  1. First search term (parameter 'find') is required --
    • Can use as many additional search terms (find1, find2, ... find#)
    • All search terms are joined by OR statement.
  2. Article results are sorted by most recent, according to date passed to Template:Newsarticle
  3. All searches are case-insensitive. Can specify word-breaks using \b (end-of-word)
  4. Default title display is set by Template:Newsarticle.dplsearch
  5. Default number of articles is 10
  6. The entire contents of the news article are NOT searched -- search occurs within the contents of page title (per mediawiki), the summary term of the Newsarticle template, and the contents of keywords optionally passed to Template:Newsarticle
  7. It is, unfortunately, not possible to pass an article count limitation on the results. Because of the intricacies of DPL extension, the searching is done among articles returned -- and, the article count limitation is used to set the number returned. SO the result is, if you use 'count=2', only the 2 most recent news articles are returned, and the search is conducted among those 2. This is insufficient for Template:Showsearchnews usage, so, unfortunately, we will have to find another way to limit search results.

Template customization

See also

example display (last recent news with defaults)

{{searchnews|find=PCI|find1=intervention|find2=STEMI}} {{#dpl: category=Published |debug=0 |uses=Template:Newstitle |namespace=News |notcategory=Disputed |notcategory=Not_published |shownamespace=false |ordermethod=sortkey |order=descending |addauthor=false |reset=categories |addfirstcategorydate=true |userdateformat=Y-m-d (D) |mode=userformat |format = ,,, |noresultsheader=* (no results - search all news) |distinct=true |resultsheader= |include={newsarticle}.dplsearch,{newstitle}.dpl |includematch=/(PCI{{ #foreach: find$n$ ||{{{find$n$}}}}})/si |count=200 }}