الگو:Needs

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

The templates in this series are designed to be used in a راهنما:جدول‌ها to make a cell with text in that cell, with an appropriately colored background. They are commonly used in رده:مقایسه‌ها.

For example, {{yes}} makes a cell with a green background. The text in the cell is taken from the راهنما:الگو; {{yes|Sure}} would output "Sure" otherwise it defaults to "Yes". Most templates allow authors to override the default text in this way, some require text put after the template call and some also need a vertical bar in between: {{table cell template}} text or {{table cell template}} | text. This information, the colors and default texts are found in the table below.

If you want to use other attributes for the table cells, e.g. colspan or rowspan, they need to be put before the template call and there must be no vertical bar | in between them:

آری نه
آری/نه
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...

الگوها[ویرایش]

الگوهای خانه جدول
کلاس[۱] دستورهای پیش‌فرض پیش‌نمایش (پیش‌فرض) دستورهای سفارشی پیش‌نمایش (سفارشی)
table-rh {{rh}} | Row header[۲] Row header {{rh|align=right}} | Row header Row header
{{سر ۲}} | Row header[۲] Row header {{سر ۲|align=right}} | Row header Row header
table-yes {{آری}} آری {{آری|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
{{ya}} Yes {{ya|Customized alt text|link=WP:ALT}} Customized alt text
table-no {{نه}} نه {{نه|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
{{na}} Red XN {{na|Customized alt text|link=WP:ALT}} Red XN
{{به‌زودی}} به‌زودی
{{بد}} بد {{بد|F}} F
{{حذف‌شده}} حذف‌شده
table-siteactive {{تارنما فعال}} فعال
table-siteinactive {{تارنما غیرفعال}} غیرفعال
table-yes2 {{خوب}} خوب {{خوب|A}} A
{{yes2}} {{yes2|Text}} Text
{{برد}} برنده {{won|text=white|color=darkblue}} برنده
{{won|place=1}} 1 {{won|place=Gold}} Gold
{{won|place=2}} 2 {{won|place=Silver}} Silver
{{won|place=3}} 3 {{won|place=Bronze}} Bronze
table-no2 {{no2}} {{no2|Text}} Text
{{نامزد}} نامزدشده {{nom|5}} 5
{{sho}} کوتاه‌شده
{{TBA}} ن/م {{TBA|To be announced}} To be announced
table-partial {{بخشی}} بخشی {{partial|Almost done}} Almost done
{{بله-نه}} آری/نه
{{okay}} بی‌طرف {{okay|C}} C
{{some}} برخی
table-any {{any}} هیچ
table-na {{ن-م}}
{{سیاه}} {{{1}}}
table-unknown {{dunno}} ؟ {{dunno|Custom [[نوشته ساده]]}} Custom نوشته ساده
{{ناشناخته}} ناشناخته {{ناشناخته|?}} ?
table-depends {{depends}} وابسته {{depends|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-included {{included}} گنجانده‌شده
table-dropped {{dropped}} رهاشده
{{terminated}} پایان‌یافته
table-beta {{beta}} بتا
{{table-experimental}} آزمایشی {{table-experimental|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-maybe {{شاید}} شاید {{maybe|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-free {{free}} رایگان {{free|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-proprietary {{مالکیتی}} مالکیتی {{proprietary|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-nonfree {{غیر آزاد}} غیر آزاد {{nonfree|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-needs {{needs}} نیاز است {{needs|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-nightly {{شبانه}} ساخت شبانه {{nightly|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-release-candidate {{release-candidate}} نامزد انتشار {{release-candidate|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
no class {{مساوی}} مساوی {{مساوی|Text}} Text
no class {{incorrect}} نادرست {{incorrect|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
no class {{no result}} بی‌نتیجه {{no result|N.R.}} N.R.
no class {{در جریان}} در انتظار
no class {{غیررسمی}} غیررسمی
no class {{معمولا}} معمولاً
no class {{به ندرت}} به ندرت
no class {{sometimes}} گاهی
no class {{CMain}} اصلی
no class {{CRecurring}} دوره‌ای
no class {{CGuest}} مهمان
no class {{active fire}} فعال (12%)
no class {{contained}} مشمول

کد[ویرایش]

Common code to most if not all the templates in this series:

style="background: white; color: black; vertical-align: middle; text-align: {{{هم‌ترازی|center}}}; {{{سبک|}}}" class="Needs table-Needs"| {{{1|{{{متن}}}}}}

Code specific to this template:

style="background: #FF9090; color: black; vertical-align: middle; text-align: center; " class="need table-needs"|نیاز است

To make a new table cell template you can use:

style="background: white; color: black; vertical-align: middle; text-align: <nowiki>{{{هم‌ترازی|</nowiki>center<nowiki>}}}</nowiki>; <nowiki>{{{سبک|}}}</nowiki>" class="{{BASEPAGENAME}} table-{{BASEPAGENAME}}"| <nowiki>{{{1|</nowiki>{{{متن}}}<nowiki>}}}</nowiki>

You should leave out the align parameter and often the class parameter is unnecessary, too.

Add the new template to the table in the common documentation afterwards. Please consider reusing one of the other templates and please choose the color sensibly.

If you find a table cell template that does not take a parameter and you want to be able to change the text in the cell, do not duplicate the template! Instead, edit the template and change the text to a default parameter substitution. For example, if a template's text is Dropped, change that to {{{1|Dropped}}}.

جستارهای وابسته[ویرایش]

  • {{GPL-lic}}
  • {{chg}}: calculate and display changes between two values

پانویس[ویرایش]

  1. The HTML class of table cell templates may be referenced in a user stylesheet to change appearance.
  2. ۲٫۰ ۲٫۱ Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.