Share to:

Predloga:Calculator codex radio/dok

Usage

This is to create a codex-style radio {{calculator}} widget. A radio button is used when there is multiple options and the user should only be able to select one.

Please see https://doc.wikimedia.org/codex/latest/components/demos/radio.html#guidelines for best practices.

Example

{{Calculator codex radio|id=myradio|name=group1|label=First option|description=Additional text describing the first option}}

produces:

First optionAdditional text describing the first option

Generally radio buttons form a group. In order for best accessibility, the group of radio buttons all with the same name should be collected into a div with role="radiogroup". If you want to group related radio controls together consisting of multiple radio groups, use role=group for that. The group should have its own label referenced by aria-labelledby. For example:

<div role="radiogroup" aria-labelledby="mygrouplabel" id="myradiogroup">
{{calculator label|codex=1|label=This is a group of options|id=mygrouplabel}}
{{Calculator codex radio|id=myradio1|name=group2|label=First option|description=Additional text describing the first option}}
{{Calculator codex radio|id=myradio2|name=group2|label=Second option|description=Additional text describing the first option}}
{{Calculator codex radio|id=myradio3|name=group2|label=Third option}}
</div>
This is a group of options
First optionAdditional text describing the first option
Second optionAdditional text describing the first option
Third option

You can also have options inline:

<div role="radiogroup" aria-labelledby="mygrouplabel2" id="myradiogroup2">
{{calculator label|codex=1|label=A bunch of inline options|id=mygrouplabel2}}
{{Calculator codex radio|id=myradioin3|name=group3|label=First|inline=1}}
{{Calculator codex radio|id=myradioin2|name=group3|label=Second|inline=1}}
{{Calculator codex radio|id=myradioin1|name=group3|label=Third|inline=1}}
</div>
A bunch of inline options
First
Second
Third

Template data

Add a radio button for calculator gadget in codex style

Parametri predloge[Urejanje podatkov predloge]

ParameterOpisVrstaStanje
codex-div-classcodex-div-class

additional css classes for outer wrapper

Nizneobvezno
idid

id value of calculator widget. Can be referenced by other calculator templates

Neznanozahtevano
namename

Name of radio group. All radio buttons in the same group should have the same name

Nizzahtevano
stylestyle

CSS to style the radio button widget

Nizneobvezno
formulaformula

Formula to control if button is on or off.

Neznanoneobvezno
readonlyreadonly

Make button read only. Read only buttons can be adjusted by formula but not by user interaction

Boolneobvezno
class-liveclass-live

extra css classes to add only if gadget is enabled

Neznanoneobvezno
classclass

extra css class

Nizneobvezno
defaultdefault

Whether to start in a checked or unchecked state

Predlagane vrednosti
1 0
Nizneobvezno
descriptiondescription

Additional description to add after the label

Vsebinaneobvezno
labellabel

Label for radio button

Neznanozahtevano
inlineinline

Make radio buttons be inline (Multiple on one line) instead of being a separate line for each

Boolneobvezno
custominputcustominput

Add another calculator widget as part of the label for a radio button

Zgled
{{calculator codex text|default=42|id=foo}}
Vsebinaneobvezno


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
Prefix: a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

Portal di Ensiklopedia Dunia

Kembali kehalaman sebelumnya