الگو:Election box candidate with party link

از ویکی‌پدیا، دانشنامهٔ آزاد
پرش به ناوبری پرش به جستجو

|- class="vcard" ! style="background-color: {{Template:{{{party}}}/meta/color}}; width: 5px;" | | class="org" style="width: 130px" | [[{{{party}}}|{{Template:{{{party}}}/meta/shortname}}]] | class="fn" | {{{candidate}}} | style="text-align: right; margin-right: 0.5em" | {{{votes}}} | style="text-align: right; margin-right: 0.5em" | {{{percentage}}} | style="text-align: right; margin-right: 0.5em" | {{{change}}}

|-

توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

Usage[ویرایش]

Party Links[ویرایش]

A more sophisticated effect can be achieved using Template:Election box candidate with party link. This adds a link to the candidate's party and also adds a color tab to the left of the candidate. For example:

For example:

 {{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
 {{Election box candidate with party link|
   |party      = Labour Party (UK)
   |candidate  = Tony Blair
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box candidate with party link|
   |party      = Conservative Party (UK)
   |candidate  = Michael Howard
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box end}}
 

Will create this:

General Election 2005: Strangford
حزب نامزد آرا % ±%
Labour Tony Blair 9,999 50.0 +10.0
Conservative Michael Howard 9,999 50.0 +10.0

However, this does rely on some additional setup for each party. See below for more details.

Party set up[ویرایش]

It is necessary to do some a little bit of setup for each party in the election. This involves creating two simple templates for the article that you will be linking to (eg حزب کارگر (بریتانیا)). These contain the identifying color of the party and the short name that will be used as the link caption (as the full wikipedia page name will probably not be suitable).

The two templates that you will need to create are:

  • Template:ArticleName/meta/color
  • Template:ArticleName/meta/shortname

The color template will just contain the party's identifying color (eg red), and the shortname template will just contain the name of the party as you want it to appear on the link (eg Labour).

You should also add something to the main article's talk page to indicate that these two templates exist. There is a template Template:Election box metadata that can be used to do this.

Step by step instructions[ویرایش]

Following are some easy step-by-step instructions for adding the two sub-pages:

  1. First, go to the article about the party that you want to set up. Eg حزب کارگر (بریتانیا).
  2. Click on the discussion tab to get to article's talk page.
  3. Click on the edit this page tab to start editing the page.
  4. Add the text {{Election box metadata}} somewhere on the page. This will create a section on the page that provides links to the meta pages, however they don't exist yet.
  5. Save the page.
  6. Click on the red link to the page ArticleName/meta/color. As this page does not yet exist, this will take you directly to the page creation screen.
  7. Enter just the identifying color of the party. This can be a color name, such as red or an RGB code such as #FF0000. If you use an RGB code you will need to type it as <nowiki>#FF0000</nowiki> otherwise it will be treated as a list element.
  8. Put the text For Template:Election box in the Edit Summary field (otherwise someone will flag it for speedy deletion)!
  9. Save the page.
  10. Repeat the previous four steps for the ArticleName/meta/shortname sub-page.

Example[ویرایش]

Microformat[ویرایش]

The HTML markup produced by this template includes an hCard microformat, which makes the person's details parsable by computers, either acting automatically to catalogue articles across Wikipedia or via a browser tool operated by a reader, to (for example) add the subject to an address book or database. For more information about the use of microformats on Wikipedia, please see the microformat project.

Sub-templates[ویرایش]

Date-of-birth ("bday") information will only be included in the microformat if {{تاریخ تولد}}, یا {{تاریخ تولد و سن}} are used in the infobox. (اگر تاریخ قبل از ۱۵۸۳ است از این الگوها استفاده نکنید). Be cautious about using these if the person is still living, per زندگی‌نامه زندگان.

شامل یک آدرس، استفاده کنید از {{نشانی وب}}.

Please do not remove instances of these sub-templates.

Classes[ویرایش]

hCard uses HTML classes including:

  • adr
  • agent
  • bday
  • birthplace
  • category
  • country-name
  • deathdate
  • deathplace
  • extended-address
  • family-name
  • fn (required)
  • given-name
  • honorific-prefix
  • honorific-suffix
  • label
  • locality
  • n
  • nickname
  • note
  • org
  • role
  • url
  • vcard

Please do not rename or remove these classes nor collapse nested elements which use them.

See also[ویرایش]
https://fa.wikipedia.org/wiki/%D8%A7%D9%84%DA%AF%D9%88:Election_box_candidate_with_party_link
fa.wikipedia.org
crawl=CC-MAIN-2018-26
62068
application/http; msgtype=response
sha1:DYFQ2LHBAAUR6P2KQIYPGWXMHGRXYUNP
<urn:uuid:ddb89084-fcf3-4b5a-8de5-6d63ad5c8fd0>
2018-06-21T20:23:35Z
208.80.154.224
text/html
sha1:JDBSY5A3FZW4VPKU63WJYRIJXKV7O52K
<urn:uuid:181179cf-8cf3-4078-b65c-4e488ccd2561>
https://fa.wikipedia.org/wiki/%D8%A7%D9%84%DA%AF%D9%88:Election_box_candidate_with_party_link
response
<urn:uuid:3b46ae60-3da9-45fd-8661-23d70e47e7e1>
robots: classic
hostname: ip-10-144-111-253.ec2.internal
software: Nutch 1.6 (CC)
isPartOf: CC-MAIN-2018-26
operator: Common Crawl Admin
description: Wide crawl of the web for June 2018
publisher: Common Crawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf