{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

|

        }}{{#if: |
         |   {{#ifexist:模板:Update
                  | [[Category:{{#switch:模板 |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

{{#if:||{{#ifeq:Update/doc|Update|}}}}

Usage编辑

This template can be used to mark articles or sections with old or out-of-date information.

  • Do not mark an article as needs updating, without a reason, unless it is very obvious.
  • To specify what parts of the page need updating, use the first unnamed parameter (or name it |{{SAFESUBST:#if:part|part=}} or number it |{{SAFESUBST:#if:1|1=}}): {{Update|part=the later-life and death material and the Legacy section|date=11月 2024}}
  • To use the template in one specific section, and change its wording to refer to the section instead of the page, use |{{SAFESUBST:#if:|=}}section and insert the template at the top of the section: {{Update|section|date=11月 2024}}
  • To display the date (in whatever format) of the last significant update to the page, use the second unnamed parameter (or name it |{{SAFESUBST:#if:updated|updated=}} or number it |{{SAFESUBST:#if:2|2=}}): {{Update|updated={{#time:j F Y|-1 month}}|date=11月 2024}}
    Note: The parameter name or number must be used if the first numbered/unnamed parameter is not used.
  • To add the date when the tag was added (this is used for cleanup categorization), use: {{Update|date=11月 2024}}
    You can also do: {{Update|{{subst:DATE}}}}
  • To explain that the article now has inaccuracies (not just missing information) due to being outdated, use |{{SAFESUBST:#if:inaccurate|inaccurate=}}yes: {{Update|inaccurate=yes|date=11月 2024}}
  • To link to a particular section of the talk page where the update is being discussed, use |{{SAFESUBST:#if:talk|talk=}}Section title (|{{SAFESUBST:#if:talksection|talksection=}} and |{{SAFESUBST:#if:discuss|discuss=}} are equivalent to |{{SAFESUBST:#if:talk|talk=}}): {{Update|talk=Shall we update this for 2024?|date=11月 2024}}
  • To display a reason (after the added phrase "In particular:"), use |{{SAFESUBST:#if:reason|reason=}}a short comment here, e.g. {{Update|reason=Is missing the 11月 2024 election results|date=11月 2024}}
  • These parameters can be combined, of course: {{Update|part=The Production section and follow-on material|reason=the film is released, so this needs a "Critical reception" section, too|inaccurate=yes|talk=Post-release updating|updated={{#time:F Y|-3 month}}|date=11月 2024}}

Example编辑

{{Update|documentation|date=11月 2024}} {{#switch:

 {{#if: 
 |     
 | {{#ifeq:模板|
   | main
   | other
   }} 
 }}

| main =

{{#ifeq:{{{small}}}|left|}}

| other

| #default =

}}

The template detects which namespace it is used in and changes accordingly:

Article {{#switch:
 {{#if:main 
main main other
   }} 
 }}
main = {{#ifeq:{{{small}}}|left|}} other #default =

}}

Category {{#switch:
 {{#if:category 
category main other
   }} 
 }}
main = {{#ifeq:{{{small}}}|left|}} other #default =

}}

Template {{#switch:
 {{#if:template 
template main other
   }} 
 }}
main = {{#ifeq:{{{small}}}|left|}} other #default =

}}

{{Update|section}} produces:

Article {{#switch:
 {{#if:main 
main main other
   }} 
 }}
main = {{#ifeq:{{{small}}}|left|}} other #default =

}}

Category {{#switch:
 {{#if:category 
category main other
   }} 
 }}
main = {{#ifeq:{{{small}}}|left|}} other #default =

}}

Template {{#switch:
 {{#if:template 
template main other
   }} 
 }}
main = {{#ifeq:{{{small}}}|left|}} other #default =

}}

This template will add mainspace articles to Category:Wikipedia articles in need of updating (this category is not populated by pages in other namespaces).

For factual inaccuracies, stronger wording is used and mainspace articles will be added to Category:Articles with obsolete information.

{{Update|inaccurate=yes}} {{#switch:

 {{#if:main 
 | main    
 | {{#ifeq:模板|
   | main
   | other
   }} 
 }}

| main =

{{#ifeq:{{{small}}}|left|}}

| other

| #default =

}}

TemplateData编辑

{{#if:|{{#switch:
|={{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|S|s}}ee the monthly parameter usage report for {{#if:|[[Template:]]|this template}}.

|None|none=Parameter usage report
|for|For=Parameter usage report for {{#if:|[[Template:]]|Template:Update}}.
|#default=[1]

}}|This is the {{#if:|TemplateData|TemplateData}} documentation for this template used by VisualEditor and other tools; {{#switch:

|={{#ifeq:{{safesubst:#switch: yes
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|S|s}}ee the monthly parameter usage report for {{#if:|[[Template:]]|this template}}.

|None|none=Parameter usage report
|for|For=Parameter usage report for {{#if:|[[Template:]]|Template:Update}}.
|#default=[2]

}}}}

TemplateData for Update

{{#switch:

 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:模板|模板
   | template
   | other
   }}
 }}

| template = {{#if:{{#ifeq:doc|sandbox|1}}{{#ifeq:doc|doc|1}}||

}} | other | #default = }} <templatedata> { "description": "Use this tag to alert readers that the article is out of date and may need updating.", "params": { "date": { "label": "Month and year", "description": "Provides the month and year of the citation request; e.g., 'January 2018', but not 'jan18'", "type": "string", "required": false, "autovalue": "{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}", "suggested": true }, "updated": { "aliases": [ "2" ], "label": "Last updated", "description": "Date of last significant update", "type": "date" }, "inaccurate": { "label": "Inaccurate?", "description": "Use 'yes' if the article has inaccuracies due to being out of date.", "example": "yes", "type": "boolean" }, "talksection": { "aliases": [ "discuss", "talk" ], "label": "Talk page section", "description": "Section name on talk page where the discussion takes place", "type": "string" }, "reason": { "label": "Reason", "description": "Explanation why the article is out of date", "type": "content", "suggested": true }, "type": { "aliases": [ "part", "1" ], "label": "Type (section)", "description": "Part that needs updating (e.g. to replace the word \"article\", often \"section\")", "example": "section", "type": "string", "default": "article", "autovalue": "", "suggested": true }, "demospace": { "label": "Demospace", "description": "", "type": "string", "required": false }, "cat": { "label": "Cat", "description": "Only required if a specific maintenance category is needed.", "type": "string", "required": false } }, "format": "inline", "paramOrder": [ "type", "date", "updated", "inaccurate", "talksection", "reason", "demospace", "cat" ] } </templatedata>

Alternatives编辑

See also编辑