Moodle
  1. Moodle
  2. MDL-26344

Offer a new custom user profile field type: radio buttons

    Details

    • Database:
      Any
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_24_STABLE
    • Rank:
      15939

      Description

      A new radio button type would be similar to the existing menu type, but rather than displaying a <select> form field, it would output a radio button group. In Drupal CCK radio buttons are actually an alternative form of the select type. So there are two possibilities for us: 1) extend the existing menu type to offer a radio button display or 2) add an entirely new type. The latter is probably simpler for people to understand - in my first experience with Drupal I thought it didn't do radio buttons!!

      OU designers would prefer radio buttons to be offered horizontally rather than the default vertical. This can be achieved by extending the "felement fradio" class automatically assigned to these fields. It would allow more flexibility to add a horizontal or vertical option to the custom field definition form and depending on the setting chosen, add an extra "horizontal" class, which would be defined in the standard stylesheets to display inline.

      I have a number of requests for this (for our Sept 2011 release) and am more than happy to program myself and offer a patch. If whoever triages this thinks that's OK, please assign to me and I will add to the OU development schedule over the next few months.

        Activity

        Hide
        Dan Marsden added a comment -

        did you ever get round to doing this Jenny?

        Show
        Dan Marsden added a comment - did you ever get round to doing this Jenny?
        Hide
        Jenny Gray added a comment -

        Hi Dan, no I didn't. I think it got lost in a raft of bigger changes I wanted to make to profile that never got approved.

        Show
        Jenny Gray added a comment - Hi Dan, no I didn't. I think it got lost in a raft of bigger changes I wanted to make to profile that never got approved.
        Hide
        Dan Marsden added a comment -

        cool - here's an initial version that adds it (I needed something for an internal project too)
        https://github.com/danmarsden/moodle-profilefield_radio

        bit of a hack to handle vertical/horizontal stuff and it might need some css/improvments - I'll add those if I need them otherwise happy to receive patches!

        Show
        Dan Marsden added a comment - cool - here's an initial version that adds it (I needed something for an internal project too) https://github.com/danmarsden/moodle-profilefield_radio bit of a hack to handle vertical/horizontal stuff and it might need some css/improvments - I'll add those if I need them otherwise happy to receive patches!

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: