Editing
Template:Form calculator field/doc
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{documentation}} This template is for creating form calculators in a standardised way, used with [[Template:Form calculator]]. This implements the syntax of [[Brighter Shores:Calculators/Form calculators]] as a template. ==Usage== <pre>{{Form calculator |page = name of the page the calculator is on: use {{subst:FULLPAGENAME}} |cat = set to no to remove category |template = the form's template to call |form = unique id for the form |result = unique id for the result |outputtype = type of output |forminit = intial text in the form area |resultinit = initial text in the result area |field1 ={{Form calculator field |param = name of the first parameter |label = label for parameter 1 |default = default value for parameter 1 |type = type of parameter 1 |range = range of parameter 1 }} ... |fieldX ={{Form calculator field |param = name of the Xth parameter |label = label for parameter X |default = default value for parameter X |type = type of parameter X |range = range of parameter X }} }} }}</pre> ==About== {{main|Template:Form calculator}} Any number of parameters can be defined. Each parameter defines a row in the form, and has 7 components: * param * label * default * type * range * toggles * help {{TemplateData|<templatedata> { "description": "This template is for creating form calculators in a standardised way, used with [[Template:Form calculator]].", "format": "block", "params": { "param": { "label": "Parameter Name", "description": "This is the name of the parameter which will be passed to the template when submitted.", "required": true, "type": "string" }, "label": { "label": "Label", "description": "The [user-friendly] label to display in the form. The label can contain most normal wikitext: links, images, spans with styles and titles (hover-overs), etc.", "default": "{{{param}}}", "suggested": true, "type": "line" }, "type": { "label": "Type", "description": "The type of input for this param. This can be used to restrict user input, or change the input field to a different type.", "suggestedvalues": [ "string", "group", "article", "number", "int", "select", "buttonselect", "combobox", "check", "toggleswitch", "togglebutton", "hs", "rsn", "fixed", "hidden", "semihidden" ], "default": "string", "example": "\n; string : Text input field, no restriction.\n; group : Used to group other inputs together.\n; article : Text input field, no restrictions. Enables autocomplete for this field, based on the `suggestns` parameter.\n; number : Numbers. Text input field, set to number. Will prevent non-numbers being submitted.\n; int : Integers. Text input field, set to number. Will prevent non-integers being submitted.\n; select : Drop-down menu generated from the corresponding range parameter.\n; buttonselect : A series of buttons for selecting an option (only 1 selected at a time).\n; combobox : Text input with a drop-down menu that automatically filters a dropdown list generated from the range parameter.\n; check : Checkbox for submitting a boolean choice.\n; toggleswitch : Same function as checkbox but is a toggle instead.\n; togglebutton : Same function as checkbox but is a button (toggles on/off).\n; hs : Text input field, no restriction. Generates a lookup button to get data from hiscores, and updates the other fields as defined by the range parameter.\n; rsn : A special field for player names (when used by the calculator and not to populate another field).\n; fixed : The default value provided is shown but cannot be changed. Can be used as a separator or for in-form notes.\n; hidden : The default value provided is hidden from the form entirely. Used to pass things to the template that shouldn't be seen or changed by the user.\n; semihidden : The default value provided is hidden in the form, but still present in the HTML. This is for inter-script usage.\n", "suggested": true, "type": "string" }, "range": { "label": "Range", "description": "The range for the parameter, or any other configuration.", "type": "string" }, "default": { "label": "Default Value", "description": "The default value for the parameter in the form. This is pre-filled into the form when loaded.", "default": "\n; string, article : Defaults to empty.\n; number, int : Defaults to empty. Should respect the range given.\n; select, buttonselect, combobox : One of the options given in the range.\n; check : Unticked by default. Will be ticked by default if defined as “true” or the same as “value if true” in the range.\n; fixed, hidden, semihidden : Can't be changed away from.\n", "type": "string" }, "toggles": { "label": "Toggles", "description": "The inputs or groups of inputs toggled by this widget. Applies to select, buttonselect, combobox, check, toggleswitch, togglebutton, int and number param types. Toggles are given in the format `value=toggles`. Note that when an option is chosen, all the groups/fields listed for other options (that aren't listed on the selected option) will be hidden.", "type": "string" }, "help": { "label": "Help Text", "description": "Help text for the form field. If text is Defaults to displaying an (i) icon that can be clicked to display the help.", "type": "content" } } } </templatedata>}} <includeonly> [[Category:Calculator templates|* field]] [[Category:Form calculators|* field]] </includeonly>
Summary:
Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see
Brighter Shores:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Templates used on this page:
Template:Documentation
(
edit
)
Template:Form calculator field
(
edit
)
Template:Main
(
edit
)
Template:TemplateData
(
edit
)
Module:Array
(
edit
)
Module:DPLlua
(
edit
)
Module:DependencyList
(
edit
)
Module:Documentation
(
edit
)
Module:Hatnote
(
edit
)
Module:Main article
(
edit
)
Module:Paramtest
(
edit
)
Module:Tooltip
(
edit
)
Module:Yesno
(
view source
) (semi-protected)
This page is a member of a hidden category:
Category:Templates using TemplateData
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
British English
Views
Read
Edit source
View history
More
Refresh
Search
Discord
Discord
Navigation
About us
User help
Random page
Recent changes
Shimmering Tangfruit
54m
ago
-
Alsang
Orange Tangfruit
54m
ago
-
Alsang
Red Tangfruit
54m
ago
-
Alsang
Purple Tangfruit
54m
ago
-
Alsang
Show more...
Brighter Shores
Professions
Factions
Episodes
Premium Pass
Monsters
Quests
Community
Policies
Tools
What links here
Related changes
Special pages
Page information