Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Switch Button

From MoodleDocs


Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.


Moodle User Interface Guidelines > Guideline template

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.

This is a guideline for a Moodle Interface Guidelines. Comments: developer forum thread

Problem

There is a setting/mode that users need to switch on or off, but there is no space for a form with a submit button.

Example: Progressive disclosure#Problem

Further information: Mandatory Elements Present

Context

Forces (factors that affect selection)

  • A form with a checkbox and a submit button may clutter up the user interface too much
  • The user needs to see what state the setting/mode is in currently
  • The user needs to be able to predict what will be the resulting state when after they click the control

Solution

UNSOLVED. One of the alternatives need to be determined as Moodle standard so users will know what to expect.

Alternatives:

  • An element, the label of which describes the end state: [Turn off edit mode]
    • Does not reflect the current state but users have to guess
  • An element (link/button) that shows the status
    • Button/link text should always reflect the target state, variation confuses
  • Combination; first show status and then a button to change: Edit mode: On [Turn off]
    • Takes more space
  • Replace toggle buttons but AJAX-based forms that appear with a click of a "Settings" link

Examples and implementation

Related issues in the tracker

(Optional) Further information / Sources