Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-10505

Add group name to rendered elements for better CSS control

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.8, 1.9
    • Fix Version/s: None
    • Component/s: Forms Library
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      If we add the group name to the rendered tags of the groups elements (<div> & <fieldset>), developers can have more control over the display through CSS.

      My suggestion is to change line 1399 in formslib.php as follows:

      'fieldset'=>"\n\t\t".'<div id="

      {name}div" class="fitem {advanced}<!-- BEGIN required -> required<!- END required ->"><div class="fitemtitle"><div class="fgrouplabel">{label}<!- BEGIN required ->{req} <!- END required -->{advancedimg}</div>{help}</div><fieldset id="{name}

      fs" class="felement

      {type}

      <!-- BEGIN error -> error<!- END error ->"><!- BEGIN error --><span class="error">

      {error}

      </span><br /><!-- END error -->

      {element}

      </fieldset></div>',

      This adds the "id" attribute to the containing div and fieldset tags, using the name of the group. Alternatively, the name could be used in the class list if the "id" in not desired.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                timhunt Tim Hunt
                Reporter:
                mchurch Mike Churchward
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: