Template:IsNew: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(updated doc)
(add "range" parameter (defaults to 90 days), so that a separate range can be specified in NewWork for the date categorization)
Line 1: Line 1:
<includeonly>{{#ifexpr:{{#time:Ymd | {{{1|1900-01-01}}} }} > {{#time:Ymd | -3 months}} |yes|no}}</includeonly><noinclude>
<includeonly>{{#ifexpr:{{#time:Ymd | {{{1|1900-01-01}}} }} > {{#time:Ymd | -{{{range|90 days}}}}} |yes|no}}</includeonly><noinclude>
{{DisplayBox|bgcolor=g|text=
{{DisplayBox|bgcolor=g|text=
<center><big>'''Documentation'''</big></center>
<center><big>'''Documentation'''</big></center>


This template affects the behaviour of template [[:Template:NewWork|NewWork]]: if the date passed as parameter falls inside this template's date range (currently 3 months), a "yes" is returned, forcing the template NewWork to:
;Usage: <tt><nowiki>{{</nowiki>IsNew{{!}}''<yyyy-mm-dd>''<nowiki>}}</nowiki></tt>
# Show an icon ([[Image:NewScore.gif]]) in front of the edition's CPDL#
:<tt><nowiki>{{</nowiki>IsNew{{!}}''<yyyy-mm-dd>''{{!}}range=''<nn days>''<nowiki>}}</nowiki></tt>
# Insert the page in which it is contained in category [[:Category:New works|New works]]


The template returns "yes" or "no" depending upon whether the date passed is within the range of the current date.  In the first case the range defaults to 90 days, but in the second case it is given explicitly.


;Usage: <tt><nowiki>{{</nowiki>IsNew{{!}}''<yyyy-mm-dd>''<nowiki>}}</nowiki></tt>
This template affects the behaviour of template {{CiteTemp|NewWork}} in two ways:
 
# If the date passed as parameter falls inside this template's default date range (currently 90 days), a "yes" is returned, forcing the template NewWork to:
#* Show an icon ([[Image:NewScore.gif]]) in front of the edition's CPDL#
#* Insert the page in which it is contained in category {{CiteCat|New works}}
# If the date passed (''yyyy-mm-dd'') falls inside the alternate date range value (currently 10 days), a "yes" is returned, forcing the template NewWork to
#* Categorize the page in the [[Category:''yyyy-mm-dd'']]
}}[[Category:Templates|{{PAGENAME}}]]</noinclude>
}}[[Category:Templates|{{PAGENAME}}]]</noinclude>

Revision as of 16:25, 27 February 2009


Documentation
Usage
{{IsNew|<yyyy-mm-dd>}}
{{IsNew|<yyyy-mm-dd>|range=<nn days>}}

The template returns "yes" or "no" depending upon whether the date passed is within the range of the current date. In the first case the range defaults to 90 days, but in the second case it is given explicitly.

This template affects the behaviour of template NewWork in two ways:

  1. If the date passed as parameter falls inside this template's default date range (currently 90 days), a "yes" is returned, forcing the template NewWork to:
    • Show an icon (NewScore.gif) in front of the edition's CPDL#
    • Insert the page in which it is contained in category New works
  2. If the date passed (yyyy-mm-dd) falls inside the alternate date range value (currently 10 days), a "yes" is returned, forcing the template NewWork to
    • Categorize the page in the