Template:Searchnews: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>{{#dpl:
<includeonly>{{#dpl:
category=Published
debug=4
|category=Published
|namespace=News
|namespace=News
|notcategory=Disputed
|notcategory=Disputed
Line 15: Line 16:
|format  = ,,,
|format  = ,,,
|noresultsheader=&nbsp;
|noresultsheader=&nbsp;
|debug=4
|distinct=true
|distinct=true
|resultsheader=
|resultsheader=
|includepage={newsarticle}.dpl,{newsarticle2}.dpl
|includepage={newsarticle}.dpl,{newsarticle2}.dpl
|secseparators  = \n,\n
|secseparators  = \n,\n
|dominantsection=1
|dominantsection=1{{#if:{{{articlecount|}}}|{{!}}count={{{articlecount}}}}}
{{#if:{{{articlecount|}}}|{{!}}count={{{articlecount}}}}}
}}</includeonly>
}}</includeonly>
{{ #foreach: find$n$ |{{Jb_makeregexp|{{{find$n$}}}}},}}
{{ #foreach: find$n$ |{{Jb_makeregexp|{{{find$n$}}}}},}}

Revision as of 18:42, 16 February 2009

{{ #foreach: find$n$ |/\|\s*{{{find$n$}}}\s*\|/s,}}

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=4 |category=Published |namespace=News |notcategory=Disputed |notcategory=Not_published |shownamespace=false |ordermethod=sortkey |includematch={{ #foreach: find$n$ |/\|\s*{{{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 }} {{ #foreach: find$n$ |/\|\s*{{{find$n$}}}\s*\|/s,}}