Template:Searchnews: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
|shownamespace=false
|shownamespace=false
|ordermethod=sortkey
|ordermethod=sortkey
|titlematch=%{{{find}}}%{{ #foreach: find$n$ |{{!}}%{{{find$n$}}}%}}
|includematch={{Jb_makeregexp_pre}}{{{find}}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}}{{Jb_makeregexp_post}}
|includematch={{Jb_makeregexp_pre}}{{{find}}}{{!}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}}{{Jb_makeregexp_post}}
|order=descending
|order=descending
|addauthor=false
|addauthor=false
Line 23: Line 22:
|dominantsection=1
|dominantsection=1
|count={{#if:{{{articlecount|}}}|{{{articlecount}}}|100}}
|count={{#if:{{{articlecount|}}}|{{{articlecount}}}|100}}
}}</includeonly>
}}</includeonly><pre><nowiki>
{{Jb_makeregexp_pre}}{{{find}}}{{!}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}}{{Jb_makeregexp_post}}
{{Jb_makeregexp_pre}}{{{find}}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}}{{Jb_makeregexp_post}}
|titlematch=%{{{find}}}%{{ #foreach: find$n$ |{{!}}%{{{find$n$}}}%}}</pre></nowiki>
<noinclude>
<noinclude>
__TOC__
__TOC__

Revision as of 19:18, 16 February 2009

<nowiki>
{{Jb_makeregexp_pre}}{{{find}}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}}{{Jb_makeregexp_post}}
|titlematch=%{{{find}}}%{{ #foreach: find$n$ |{{!}}%{{{find$n$}}}%}}

</nowiki>

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 |namespace=News |notcategory=Disputed |notcategory=Not_published |shownamespace=false |ordermethod=sortkey |includematch=/\|\s*[cC]lopidogrel{{ #foreach: find$n$ ||{{{find$n$}}}}}\s*\|/s |order=descending |addauthor=false |reset=categories |addfirstcategorydate=true |userdateformat=Y-m-d (D) |mode=userformat |format = ,,, |noresultsheader=  |distinct=true |resultsheader= |includepage={newsarticle}.dpl,{newsarticle2}.dpl |secseparators = \n,\n |dominantsection=1 |count=10

}}

<nowiki>
{{Jb_makeregexp_pre}}{{{find}}}{{ #foreach: find$n$ |{{!}}{{{find$n$}}}}}{{Jb_makeregexp_post}}
|titlematch=%{{{find}}}%{{ #foreach: find$n$ |{{!}}%{{{find$n$}}}%}}

</nowiki>