Difference between revisions of "Template:If"

From Chevy Wiki
Jump to navigation Jump to search
(uploaded "Image:1969 red Chevrolet Camaro SS side.JPG": Importing image file)
m (1 revision)
 
Line 1: Line 1:
{{Documentation subpage}}
{{{{{subst|}}}p{{{{{subst|}}}#ifeq:{{{1}}}|eq|1|2}}|{{{{{subst|}}}p{{{{{subst|}}}#ifeq:{{{2}}}|{{{3}}}|1|2}}|{{{4|}}}|{{{5}}}}}|{{{{{subst|}}}p{{{{{subst|}}}#if{{{1}}}:{{{2}}}|1|2}}|{{{3}}}|{{{4|}}}}}}}<noinclude>{{documentation}}</noinclude>
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{Infobox Film
| name          = {{{name}}}
| image          = {{{image}}}
| image_size    = {{{image_size}}}
| caption        = {{{caption}}}
| director      = {{{director}}}
| producer      = {{{producer}}}
| writer        = {{{writer}}}
| narrator      = {{{narrator}}}
| starring      = {{{starring}}}
| music          = {{{music}}}
| cinematography = {{{cinematography}}}
| editing        = {{{editing}}}
| studio        = {{{studio}}}
| distributor    = {{{distributor}}}
| released      = {{{released}}}
| runtime        = {{{runtime}}}
| country        = {{{country}}}
| language      = {{{language}}}
| budget        = {{{budget}}}
| gross          = {{{gross}}}
| preceded_by    = {{{preceded_by}}}
| followed_by    = {{{followed_by}}}
}}
'''Infobox Film''' may be used to summarize information about a film.
 
==Usage==
The infobox may be added by pasting the template as shown below into an article, typically at the top an an article above the lead section. All parameters are optional; any unused parameters should be left blank or omitted.
<pre style="width: 15em;">{{Infobox Film
| name          =
| image          =
| image_size    =
| caption        =
| director      =
| producer      =
| writer        =
| narrator      =
| starring      =
| music          =
| cinematography =
| editing        =
| studio        =
| distributor    =
| released      =
| runtime        =
| country        =
| language      =
| budget        =
| gross          =
| preceded_by    =
| followed_by    =
}}</pre><br clear="all" />
 
==Parameters==
''Note: Do not link to an article more than once in the infobox. All parameters are optional. See also [[MOS:FILM]].''
 
{| class="wikitable"
! style="text-align: left" | Parameter
! style="text-align: left" | Explanation
|-
| <code>name</code>
| Insert the full common name of the film (defaults to <code><nowiki>{{PAGENAME}}</nowiki></code> if empty).
|-
| <code>image</code>
| Insert a relevant image for the film. Ideally this should be a film poster, but a DVD/VHS cover, screenshot, or other film-related image may also be used.  Only use the actual file name, i.e. <code>image = [[:Image:Forrest Gump poster.jpg|Forrest Gump poster.jpg]]</code>.
|-
| <code>image_size</code>
| The infobox automatically resizes images to a default width of 200px. Use this parameter '''only''' if the image being used is ''smaller'' than 200px.
|-
| <code>caption</code>
| Insert image caption, which should describe the type of image used.
|-
| <code>director</code>
| Insert the name(s) of the director(s). Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). In addition, link each director to his/her appropriate article if possible.
|-
| <code>producer</code>
| Insert the name(s) of the producer(s). Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). In addition, link each producer to his/her appropriate article if possible.
|-
| <code>writer</code>
| Insert the name(s) of the writer(s). Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). In addition, link each writer to his/her appropriate article if possible.
|-
| <code>narrator</code>
| Insert the name(s) of the narrator(s). Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). In addition, link each narrator to his/her appropriate article if possible.
|-
| <code>starring</code>
| Insert the name(s) of the actor(s) who had major roles in the film. Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). In addition, link each actor to his/her appropriate article if possible.
|-
| <code>music</code>
| Insert the name(s) of the composer(s) of original music. Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). In addition, link each composer to his/her appropriate article if possible.
|-
| <code>cinematography</code>
| Insert the name(s) of the cinematographer(s). Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). In addition, link each cinematographer to his/her appropriate article if possible.
|-
| <code>editing</code>
| Insert the name(s) of the editor(s). Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). If a credit for an "additional editor" is shown, add the tag "(addl)". Link each editor to his/her article if possible.
|-
| <code>studio</code>
| Insert the company that produced the film. Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). In addition, link each company to its appropriate article if possible.
|-
| <code>distributor</code>
| Insert the company name(s) of the distributor(s). Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>). In addition, link each distributor to its appropriate article if possible.
|-
| <code>released</code>
| Insert only the most relevant release date(s) of the film (see [[WP:FilmRelease]] for a detailed guideline). If multiple entries are required, separate with line breaks (<code><nowiki><br /></nowiki></code>).
|-
| <code>runtime</code>
| Insert an approximate time duration of the film in minutes.
|-
| <code>country</code>
| Insert the country or countries that the film was produced in. Link each country to its appropriate article if possible.
|-
| <code>language</code>
| Insert the language '''primarily''' used in the film. Databases often give every language spoken within the film, even if they only reflect a few lines in the overall script. Only in rare cases of clearly bilingual or multilingual films, enter separate entries with a line break (<code><nowiki><br /></nowiki></code>). In the case of a single language without any additional text, it will automatically link to the language article (and the film article will also be put automatically in the category concerned). In other cases, give the wikitext for the desired linked text.
|-
| <code>budget</code>
| Insert the approximate budget of the film.
|-
| <code>gross</code>
| Insert the gross revenue accrued by the film. This information is available for most pictures at [http://www.boxofficemojo.com/ Box Office Mojo]. Worldwide gross is preferred.
|-
| <code>preceded_by</code>
| If the film is part of a series, insert the film(s) that preceded it in the series. Please note that per [[MOS:TITLE]], film titles should always be ''italicized''. Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>).
|-
| <code>followed_by</code>
| If the film is part of a series, insert the film(s) that followed it in the series. Please note that per [[MOS:TITLE]], film titles should always be ''italicized''. Separate multiple entries with a line break (<code><nowiki><br /></nowiki></code>).
|-
| <code>website</code>
| rowspan=3 | '''These parameters are now deprecated following extensive discussion.''' Links to these websites can be added to the "External links" section of an article by using the following templates:
* {{tlx|official}}
* {{tlx|imdb title}}
* {{tlx|amg movie}}
|-
| <code>imdb_id</code>
|-
| <code>amg_id</code>
|}
 
==IMDb, Allmovie, and other external links==
External links to resources such as the [[Internet Movie Database]] (IMDb), [[Allmovie]] and any official website are no longer included in this template. Nevertheless, these resources and others may be usefully added to the External Links section of the article using the following templates:
 
*{{tlx|Amg movie|id{{=}}amg_id|title{{=}}film title}}
*{{tlx|Mojo title|id{{=}}bom_id|title{{=}}film title}}
*{{tlx|imdb title|id{{=}}imdb_id|title{{=}}film title}}
*{{tlx|Metacritic film|id{{=}}mc_id|title{{=}}film title}}
*{{tlx|rotten-tomatoes|id{{=}}rt_id|title{{=}}film title}}
*{{tlx|tcmdb title|id{{=}}tc_id|title{{=}}film title}}
*{{tlx|ymovies title|id{{=}}ym_id|title{{=}}film title}}
 
For the imdb and allmovie templates, the ids can be copied directly from the fields that are present in many existing infobox template calls. The fields can then be removed from the template.
 
===History===
When this infobox template was first created, in December 2004, one of the parameters created an external link to the [[Internet Movie Database]] (IMDb). Irrespective of the fact that IMDb is not used as a [[Wikipedia:Reliable sources|reliable source]] for [[Wikipedia:Verifiability|verifying]] content in Wikipedia articles, it still is a resource that many people, including editors ''and'' readers of Wikipedia, often turn to.
 
In more recent years, additional external websites have become increasingly useful resources, including [[Allmovie]], [[Box Office Mojo]], [[Metacritic]] and [[Rotten Tomatoes]]. Also, modern films almost invariably have an official website. As a consequence, new external links were added to and removed from the infobox as [[Wikipedia:Consensus#Consensus can change|consensus changed]] on the subject.
 
Discussions about the fate of these links took place in numerous places over some time, with a number of people advocating removal of all external links from the infobox, if not the article as a whole. Others spoke of the value of having at least a link to IMDb in the infobox. Eventually, a far from undisputed consensus arose to remove all external links from the infobox and to move them to the External links section where appropriate in view of the [[Wikipedia:External links|External links guideline]].
 
Important points towards this [[Wikipedia:Consensus|consensus]] included fact that the infobox could not include all of the available links and that it would be inappropriate to pick and choose one or a few of those links over others. Suggestions that losing access to the most useful of the available links (typically IMDb) would damage the usefulness of film articles were not found persuasive by many since such links could still be included in the External links section and the table of contents linking to the external links section having ''all'' of the useful external links is adjacent the infobox.
 
==Microformat==
{{UF-hcal}}
 
== See also ==
* [[Template:Infobox Television Film]] - for TV movies and miniseries
* [[Template:Infobox Korean Film]]
* [[Template:Infobox Chinese Film]]
* [[Template:Infobox Hollywood cartoon]]
* [[Template:Infobox Film Bond]]
* {{tiw|Infobox movie certificates}}
 
<includeonly>
{{pp-template|small=yes}}
{{#ifeq:{{NAMESPACE}} | Template |
{{intricate template}}
 
<!-- EDIT CATEGORIES BELOW THIS LINE-->
[[Category:Film infobox templates{{!}}Infobox]]
 
<!-- EDIT INTERWIKI LINKS BELOW THIS LINE -->
[[als:Vorlage:Infobox Film]]
[[ar:قالب:معلومات فيلم]]
[[az:Şablon:Infobox Film]]
[[be-x-old:Шаблён:Фільм]]
[[bg:Шаблон:Филм]]
[[bn:Template:তথ্যছক চলচ্চিত্র]]
[[br:Patrom:Infobox Film]]
[[bs:Šablon:Film]]
[[ca:Plantilla:Infobox Movie]]
[[cs:Šablona:Infobox film]]
[[cy:Nodyn:Gwybodlen Ffilm]]
[[da:Skabelon:Infoboks film]]
[[de:Vorlage:Infobox Film]]
[[de:Vorlage:Infobox Film]]
[[el:Πρότυπο:Κουτί πληροφοριών ταινίας]]
[[eo:Ŝablono:Informkesto filmoj]]
[[es:Plantilla:Ficha de película]]
[[et:Mall:Infobox Film]]
[[fa:الگو:جعبه فیلم]]
[[fi:Malline:Elokuva]]
[[fr:Modèle:Infobox Film]]
[[hr:Predložak:Film]]
[[hsb:Předłoha:Infobox Film]]
[[hu:Sablon:Film infobox]]
[[id:Templat:Infobox Movie]]
[[it:Template:Film]]
[[ja:Template:Infobox Film]]
[[ka:თარგი:ინფოდაფა კინო]]
[[kab:Talɣa:Asaru]]
[[kk:Үлгі талқылауы:Infobox Film]]
[[ko:틀:영화 정보]]
[[la:Formula:Pellicula]]
[[mk:Шаблон:Инфокутија Филм]]
[[ml:ഫലകം:Infobox Film]]
[[ms:Templat:Filem]]
[[nl:Sjabloon:Infobox Film]]
[[no:Mal:Infoboks film]]
[[pl:Szablon:Film infobox]]
[[pt:Predefinição:Cinema/Ficha Técnica]]
[[ro:Format:Infobox film]]
[[ru:Шаблон:Фильм]]
[[simple:Template:Infobox Movie]]
[[sk:Šablóna:Infobox Film]]
[[sq:Stampa:Movie-Box]]
[[sr:Шаблон:Филм]]
[[sv:Mall:Filmfakta]]
[[ta:வார்ப்புரு:Infobox Film]]
[[th:แม่แบบ:กล่องข้อมูล ภาพยนตร์]]
[[tl:Template:Infobox Film]]
[[tr:Şablon:Film]]
[[uk:Шаблон:Фільм]]
[[ur:سانچہ:Infobox Film]]
[[vi:Tiêu bản:Thông tin phim]]
[[zh:Template:Infobox Film]]
[[zh-min-nan:Template:Infobox Film]]
}}
</includeonly>

Latest revision as of 15:12, 3 February 2009

{{p{{#if{{{1}}}:{{{2}}}|1|2}}|{{{3}}}|}}

[edit] Template-info.svg Template documentation

With this template the parser functions of the ParserFunctions collection with names starting with "#if" can be used in a way such that they do not strip spaces and newlines from the "then" and "else" part. Spaces still do not affect the outcome of the condition.

Usage

  • {{if||x| p | q }} gives " p "
  • {{if|expr|2<3| p | q }} gives " p "
  • {{if|eq| u |u| p | q }} gives " p "
  • {{if|exist| Help:Link | p | q }} gives " q "
  • {{if|error|{{#expr:x}}| p | q }} gives " p "

Compare:

  • {{#if:x| p | q }} gives "p"
  • {{#ifexpr:2<3| p | q }} gives "p"
  • {{#ifeq: u |u| p | q }} gives "p"
  • {{#ifexist: Help:Link | p | q }} gives "q"
  • {{#iferror:{{#expr:x}}| p | q }} gives "p"

For full substitution, use e.g. {{subst:if|expr|2<3| p | q |subst=subst:}}. If the condition contains a parser function or template etc., that should be substituted too. Optionally the "then" or "else" part can also be substituted.

See also

  • m:Template:if (backlinks, edit)