Template:Searchnews: Difference between revisions
Jump to navigation
Jump to search
Jacki Buros (talk | contribs) No edit summary |
Jacki Buros (talk | contribs) No edit summary |
||
Line 20: | Line 20: | ||
|include={newsarticle}.dplsearch,{newstitle}.dpl | |include={newsarticle}.dplsearch,{newstitle}.dpl | ||
|includematch=/({{{find}}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}})/si | |includematch=/({{{find}}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}})/si | ||
|count={{#if:{{{articlecount|}}}|{{{articlecount}}}| | |count={{#if:{{{articlecount|}}}|{{{articlecount}}}|10}} | ||
}}</includeonly> | }}</includeonly> | ||
|titlematch=%{{{find}}}%{{ #foreach: find$n$ |{{!}}%{{{find$n$}}}%}} | <!-- |titlematch=%{{{find}}}%{{ #foreach: find$n$ |{{!}}%{{{find$n$}}}%}} --> | ||
<noinclude> | <noinclude> | ||
__TOC__ | __TOC__ | ||
== Template usage == | |||
* use like | * use like | ||
** <nowiki>{{ | ** <nowiki>{{Searchnews}}</nowiki> to display all news titles (10 articles by default) | ||
** <nowiki>{{ | ** <nowiki>{{Searchnews|articlecount=1}}</nowiki> to display most recent 1 news article. | ||
** <nowiki>{{ | ** <nowiki>{{Searchnews|articlecount=5|find=pci}}</nowiki> to search for pci (case insensitive). | ||
* | ** <nowiki>{{Searchnews|articlecount=5|find=pci|find1=STEMI}}</nowiki> to search for pci OR STEMI (case insensitive). | ||
* | ** <nowiki>{{Searchnews|articlecount=5|find=pci|find1=\bMI\b}}</nowiki> to search for pci OR MI (case insensitive, MI occuring as a whole word). | ||
=== | === Notes on usage=== | ||
* | # First search term (parameter 'find') is required -- | ||
* [[:Template: | ** Can use as many additional search terms (find1, find2, ... find#) | ||
** All search terms are joined by OR statement. | |||
# Article results are sorted by most recent, according to date passed to [[:Template:Newsarticle]] | |||
# All searches are case-insensitive. Can specify word-breaks using \b (end-of-word) | |||
# Default title display is set by [[:Template:Newsarticle.dplsearch]] | |||
# Default number of articles is 10 | |||
=== example display (last recent news with defaults) === | == Template customization == | ||
* [[:Template:newsarticle.dplsearch|Edit display per article in news listing]] | |||
== See also == | |||
* [[:Template:Listnews]] which lists news titles + summary (no search capacity) | |||
== example display (last recent news with defaults) == | |||
'''<nowiki>{{searchnews|articlecount=10|find=PCI|find1=intervention|find2=STEMI}}</nowiki>''' | |||
{{searchnews|articlecount=10|find=PCI|find1=intervention|find2=STEMI}} | {{searchnews|articlecount=10|find=PCI|find1=intervention|find2=STEMI}} | ||
</noinclude> | </noinclude> |
Revision as of 23:43, 16 February 2009
Template usage
- use like
- {{Searchnews}} to display all news titles (10 articles by default)
- {{Searchnews|articlecount=1}} to display most recent 1 news article.
- {{Searchnews|articlecount=5|find=pci}} to search for pci (case insensitive).
- {{Searchnews|articlecount=5|find=pci|find1=STEMI}} to search for pci OR STEMI (case insensitive).
- {{Searchnews|articlecount=5|find=pci|find1=\bMI\b}} to search for pci OR MI (case insensitive, MI occuring as a whole word).
Notes on usage
- 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.
- Article results are sorted by most recent, according to date passed to Template:Newsarticle
- All searches are case-insensitive. Can specify word-breaks using \b (end-of-word)
- Default title display is set by Template:Newsarticle.dplsearch
- Default number of articles is 10
Template customization
See also
- Template:Listnews which lists news titles + summary (no search capacity)
example display (last recent news with defaults)
{{searchnews|articlecount=10|find=PCI|find1=intervention|find2=STEMI}} {{#dpl: debug=3 |category=Published |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= |distinct=true |resultsheader= |include={newsarticle}.dplsearch,{newstitle}.dpl |includematch=/(PCI{{ #foreach: find$n$ ||{{{find$n$}}}}})/si |count=10 }}