Single-select list (drop-down or radio buttons)
The single select list field type can be displayed in the submission form as radio buttons or drop-down list. In both cases the user can choose one option from a pre-defined list of values.
Single-select list settings
The above images show the possible settings for this field.
1) Display as drop-down or radio buttons
2) If drop-down is selected, add an empty value text like - make a choice - and check the empty choice checkbox!
3) Add the options to the list. For value it is only possible to use basic characters and no spaces.
4) Add an attribute if you wish:
Example: class="select_list"
Adding the the single-select list data in your article
The template parameter used to 'paste' the content into the article. In this case it would be the choice made and can either be the value or the text.
Template parameter:
{$FIELDNAME} = the value (first column, see image)
{$FIELDNAME_TEXT} = the display text (second column, see image)
*(where FIELDNAME = the unique field name filled out in the settings)
Example:Setting a color in a Joomla article
Single-select lists are great to add some dynamic features to your template. In this example we will assume a drop-down list (field name = background_color) in a submission form with the following values.
Value Display text
0F0 Green
F00 Red
CCC Grey
The submission form will display a drop-down list of the color names White, Red and Grey.
In our F2C (main) article template we can add the following code
*note there are some extra spaces in the html tags to prevent rendering