• Home
  • Random
  • Log in
  • Settings
  • About English Wikipedia @ Freddythechick
English Wikipedia @ Freddythechick

Template:Drop down list/sandbox

  • Language
  • Watch
  • View source
< Template:Drop down list


__EXPECTUNUSEDTEMPLATE__This is the template sandbox page for Template:Drop down list (diff).
Template documentation[view] [edit] [history] [purge]
Collapsible templates
Help:Collapsing
Guideline:Hidden content
Article namespace
  • {{collapse}}
  • {{collapsible list}}
    • {{collapse top}}
    • {{collapse bottom}}
  • {{hidden}}
    • {{hidden begin}}
    • {{hidden end}}
Infoboxes
  • {{collapsed infobox section begin}}
  • {{collapsed infobox section end}}
Navigation templates
  • {{sidebar with collapsible lists}}
  • {{navbox with collapsible groups}}
Talk namespace
  • {{hidden archive top}}
  • {{hidden archive bottom}}
  • v
  • t
  • e

Contents

  • 1 Usage
  • 2 Parameters
    • 2.1 Name
    • 2.2 Values
    • 2.3 Id
    • 2.4 Colors

Usage

This template can be transcluded to display a Drop down list. This template had 3 parameters (described below). The Id parameter is very important if you are using 2 drop down lists on the same page.

Parameters

This template contains 11 parameters for different purposes:

Name

This is the name parameter that shall display the name of the list, defaults to 'Text'. To set the name parameter type {{Drop down list|Name=Items|Value1=One|Value2=Two|Value3=Three}} which will render as:

Items  

One
Two
Three




As another examples, links can also be used as names, as shown below:

{{Drop down list|Name=[[WP:TW|TW]]}} renders as

TW  






Values

The list can hold up to 8 values i.e the text within the list. To add the values type {{Drop down list|Name=Name|Value1=Hello|Value2=Wikipedia|Value3=Blah!}} and so on until

Value8 .
The values support both Wikilinks and external links i.e you can also type <syntaxhighlight lang="text" inline>

Name  

Hello
'pedia
Google



</syntaxhighlight> which will render as

Name  

Hello
'pedia
Google




Note that any blank parameters will be omitted when rendering the template.

Id

If you are using more than one drop down list on the same page this parameter is very important. The Id parameter for each list should be different and unique (if using more than one on the same page).

Hence the for example
{{Drop down list|Name=text1|id=IdName1|Value1=a|Value2=b|Value3=c}}
{{Drop down list|Name=text2|id=IdName2|Value1=aaaaaaaaaaaaaaaaaaaaa|Value2=bb|Value3=ccccc}}
renders as

text1  

a
b
c




text2  

aaaaaaaaaaaaaaaaaaaaa
bb
ccccc




Colors

Additionally, the background and border of the dropdown can also be customized. When either parameter is left blank, it will default to the template's white background and grey-ish border colors.

To change the background color, set a value for the parameter background-color.

{{Drop down list|background-color=#444654|Name=Items|Value1=One|Value2=Two|Value3=Three}}

Which will render as:

Items  

One
Two
Three





This can be set to none to effectively disable the background.

{{Drop down list|background-color=none|Name=Items|Value1=One|Value2=Two|Value3=Three}}

which will render as:

Items  

One
Two
Three




Similarly, you can change the border color by setting a value for the parameter border-color.

{{Drop down list|border-color=black|Name=Items|Value1=One|Value2=Two|Value3=Three}}

which will render as:

Items  

One
Two
Three




This can also be set to none to also disable the border, for example

{{Drop down list|border-color=none|Name=Items|Value1=One|Value2=Two|Value3=Three}} will render as:

Items  

One
Two
Three



The above documentation is transcluded from Template:Drop down list/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://enwiki.freddythechick.net/index.php?title=Template:Drop_down_list/sandbox&oldid=8938954"
Last edited on 9 May 2023, at 10:57

Languages

      This page is not available in other languages.

      English Wikipedia @ Freddythechick
      • This page was last edited on 9 May 2023, at 10:57.
      • Content is available under Creative Commons Attribution-ShareAlike 4.0 unless otherwise noted.
      • About English Wikipedia @ Freddythechick
      • Desktop