پرش به محتوا

الگو:Parameter names example/توضیحات: تفاوت میان نسخه‌ها

از ویکی‌هزاره
صفحه‌ای تازه حاوی «{{زیرصفحه توضیحات}} <!----Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see ویکی‌پدیا:ویکی‌داده)----> {{تغییرمسیر الگو|Generic template demo|Pnex}} {{لوآ|Module:Parameter names example}} {{الگو|Parameter names example}} – or, alternatively, {{الگو|Generic template demo}} – is intended to assist ویکی‌پدیا:م...» ایجاد کرد
 
بدون خلاصۀ ویرایش
 
خط ۱: خط ۱:
{{زیرصفحه توضیحات}}
{{زیرصفحه توضیحات}}
<!----Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[ویکی‌پدیا:ویکی‌داده]])---->
<!----Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[ویکی‌هزاره:ویکی‌داده]])---->
{{تغییرمسیر الگو|Generic template demo|Pnex}}
{{تغییرمسیر الگو|Generic template demo|Pnex}}
{{لوآ|Module:Parameter names example}}
{{لوآ|Module:Parameter names example}}


{{الگو|Parameter names example}}&nbsp;– or, alternatively, {{الگو|Generic template demo}}&nbsp;– is intended to assist [[ویکی‌پدیا:مستندات الگو|template documentation]] by producing a generic instance of the template that uses [[راهنما:الگو|parameters' names]] as those parameters' values.
{{الگو|Parameter names example}}&nbsp;– or, alternatively, {{الگو|Generic template demo}}&nbsp;– is intended to assist [[ویکی‌هزاره:مستندات الگو|template documentation]] by producing a generic instance of the template that uses [[راهنما:الگو|parameters' names]] as those parameters' values.
{{پاک‌کن}}
{{پاک‌کن}}


خط ۳۹: خط ۳۹:


== See also ==
== See also ==
* [[ویکی‌پدیا:مستندات الگو]]
* [[ویکی‌هزاره:مستندات الگو]]
* [[Template:Parameters]] and [[پودمان:Parameters]] – generates a list of parameter names for a given template
* [[Template:Parameters]] and [[پودمان:Parameters]] – generates a list of parameter names for a given template


<includeonly>{{Sandbox other|
<includeonly>{{Sandbox other|
| <!----Categories below this line, please; interwikis at Wikidata---->
| <!----Categories below this line, please; interwikis at Wikidata---->
[[رده:الگو:مفید ویکی‌پدیا]]
[[رده:الگو:مفید ویکی‌هزاره]]
[[رده:الگو:فضای نام الگو]]
[[رده:الگو:فضای نام الگو]]
[[رده:الگو:دستیاری مستندات]]
[[رده:الگو:دستیاری مستندات]]
}}</includeonly>
}}</includeonly>

نسخهٔ کنونی تا ‏۲۴ ژانویهٔ ۲۰۲۵، ساعت ۲۳:۱۵

{{Parameter names example}} – or, alternatively, {{Generic template demo}} – is intended to assist template documentation by producing a generic instance of the template that uses parameters' names as those parameters' values.

Example

The example opposite for {{Infobox}}, for instance, was produced by:

{{{title}}}
{{{above}}}
{{{subheader}}}
{{{subheader2}}}
{{{image}}}
{{{caption}}}
{{{header1}}}
{{{label2}}}{{{data2}}}
{{{label3}}}{{{data3}}}
{{{header4}}}
{{{data5}}}
{{{data6}}}
{{{below}}}
{{Parameter names example
|_template=Infobox
|title |above |subheader |subheader2 |image |caption 
|header1 |label2 |data2 |label3 |data3 |header4 
|data5 |data6 |below
}}

Usage notes

When {{Parameter names example}} is used on an immediate subpage of its target template – e.g. on the target template's /doc page – its own |_template= parameter identifying the target template may be omitted. In other words, the code above, if used on Template:Infobox/page (where page could be "doc", "testcases", etc.), would become:

{{Parameter names example
|title |above |subheader |subheader2 |image |caption 
|header1 |label2 |data2 |label3 |data3 |header4 
|data5 |data6 |below
}}

One exception to this is the "sandbox" subpage. If the module is called from a page ending in "/sandbox", it uses that page to generate the template output, not the base page. To override this behaviour you can specify the |_template= parameter explicitly.

The formatting of the parameter names can be changed with the |_display= parameter. By default, the parameter names are shown in triple braces (the parameter standard, e.g. {{{name}}}), but if |_display=italics or |_display=italic is set, they are shown in italics.

A custom value for a parameter may be supplied by using |[parameter name]=[value] in place of |[parameter name]. Any formatting for such a value – including, for instance, italics – must be supplied as part of the value (e.g. |parameter=''value''<br/>). Custom values cannot be used for parameters whose names begin with an underscore ("_").

See also