Template:Searchnews: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 19: Line 19:
|resultsheader=
|resultsheader=
|include={newsarticle}.dplsearch,{newstitle}.dpl
|include={newsarticle}.dplsearch,{newstitle}.dpl
|includematch=/({{{find}}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}})/s
|includematch=/({{{find}}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}})/mi
|count={{#if:{{{articlecount|}}}|{{{articlecount}}}|100}}
|count={{#if:{{{articlecount|}}}|{{{articlecount}}}|100}}
}}</includeonly>
}}</includeonly>

Revision as of 23:23, 16 February 2009

|titlematch=%{{{find}}}%{{ #foreach: find$n$ ||%{{{find$n$}}}%}}

Template usage

  • use like
    • {{Listnews}} to display recent news (30 articles by default)
    • {{Listnews|articlecount=1}} to display most recent 1 news article.
    • {{Listnews|articlecount=50}} to display 50 recent news articles.
  • Note: default article display limit is set by Template:Newsarticle.dpl
  • Note: default number of articles is 30 articles

Template customization

example display (last recent news with defaults)

{{#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$}}}}})/mi |count=10 }} |titlematch=%PCI%{{ #foreach: find$n$ ||%{{{find$n$}}}%}}

{{#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=/(STEMI{{ #foreach: find$n$ ||{{{find$n$}}}}})/mi |count=10 }} |titlematch=%STEMI%{{ #foreach: find$n$ ||%{{{find$n$}}}%}}