Template:Listnews: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#dpl:
<includeonly>{{#dpl:
category=Published
category=Published{{#if:{{{cat|}}}|{{{cat}}}}}
|namespace=News
|namespace=News
|notcategory=Disputed
|notcategory=Disputed
|notcategory=Not_published
|notcategory=Not_published
|shownamespace=false
|shownamespace=false
|ordermethod=category,sortkey
|ordermethod=sortkey
|order=descending
|order=descending
|addauthor=false
|addauthor=false
Line 15: Line 15:
|noresultsheader=&nbsp;
|noresultsheader=&nbsp;
|distinct=true
|distinct=true
|resultsheader=<h3>Wikidoc Daily News</h3>
|resultsheader=
|includepage={newsarticle}.dpl
|includepage={newsarticle}.dpl,{newsarticle2}.dpl
|secseparators  = \n,\n
|secseparators  = \n,\n
|count=30
|dominantsection=1
|count={{#if:{{{articlecount|}}}|{{{articlecount}}}|100}}
}}</includeonly>
}}</includeonly>
<noinclude>
<noinclude>
__TOC__
=== Template usage ===
=== Template usage ===
* use like
* use like
** <nowiki>{{Listnews}}</nowiki> to display today's news
** <nowiki>{{Listnews}}</nowiki> to display recent news (30 articles by default)
** <nowiki>{{Listnews|prev=1}}</nowiki> to display today & yesterday's news.
** <nowiki>{{Listnews|articlecount=1}}</nowiki> to display most recent 1 news article.
** <nowiki>{{Listnews|len=200}}</nowiki> to display today's news and limit display length per article.
** <nowiki>{{Listnews|articlecount=50}}</nowiki> to display 50 recent news articles.
** <nowiki>{{Listnews|prev=1|len=200}}</nowiki> to display today & yesterday's news with length limit.
* Note: default article display limit is set by [[:Template:Newsarticle.dpl]]
* Note: default limit is 300 chars
* Note: default number of articles is 30 articles


=== Template customization ===
* [[:Template:newsarticle.dpl|Edit display per article in news listing]]
* [[:Template:newsarticle|Edit display of summary in article contents]]
* [[:Template:NewsStub|View use of news article template]]


=== example display (last 20 days' news) ===
=== example display (last recent news with defaults) ===
{{listnews}}
{{listnews|articlecount=10}}
</noinclude>
</noinclude>

Latest revision as of 17:03, 19 February 2009


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: category=Published |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= |includepage={newsarticle}.dpl,{newsarticle2}.dpl |secseparators = \n,\n |dominantsection=1 |count=10 }}