CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Feature #4643

select box/option list support

Added by Thomas Ernst over 3 years ago. Updated over 2 years ago.

Status:Resolved Start date:2009-08-02
Priority:Should have Due date:
Assignee:Thomas Ernst % Done:

100%

Category:-
Target version:Version 0.4.0
Votes: 0

Description

(2) Yes/No/Maybe support
We would need three kinds of registrations: "Yes" (as today), "Maybe", and "No" (meaning the fe_user has seen the event but cannot participate - he should still be notified about changes to the event, though).

This can be accomplished by using a option list/select box control as a user field. But currently it is hard to use these controls as userfields. An improvement is required.

History

Updated by Thomas Ernst over 3 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 60 to 100

This feature has been implemented and works as following:

When defining an user field with typoscript an additional parameter "options" can be set. This parameter defines the possible options for the selection box/option list. If no translation of the options is required, the options can be defined as following:

options {
    1 = Some option
    2 = Another option
    3 = One more option
    4 = A fourth option
}

If a translation of options is needed, it can be defined similar to the translation of the field caption:
options {
    1.default = Some option
    1.de = Eine Option
    2.default = Another option
    2.de = Eine andere Option
    3.default = One more option
    3.default = Noch eine Option
    4.default = A fourth option
    4.default = Eine vierte Option
}

If an option parameter is given in the configuration of an user field, the marker ###OPTIONS### can be used in the layout of the field. It will be replaced with propper <option>...</option> tags. If the value of an option matches the value of the field, this option will be selected.

Example:

1 {
    name=Selection
    caption.default=I attend the event
    caption.de=Ich nehme teil
    default =
    options {
        1.default = Yes
        1.de = Ja
        2.default = No
        2.de = Nein
        3.default = Yes, but I'll be late
        3.de = Ja, aber ich komme später
    }
    layout {
        edit = stdWrap
        edit.dataWrap = <tr><td style="width:10px;vertical-align:top;"><b>###CAPTION###</b></td><td><SELECT SIZE=1 name="###NAME###">###OPTIONS###</SELECT></td></tr>
        show = stdWrap
        show.dataWrap = <tr><td style="width:10px;vertical-align:top;"><b>###CAPTION###</b></td><td>|</td></tr>
    }
}    

Also available in: Atom PDF