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

Add a modname class to body

XMLWordPrintable

      The current classList for the document body includes a number of classes, including:

      • the cmid;
      • the contextid; and
      • the path of a page.

      Unfortunately it does not include anything to indicate that the current page relates to a specific activity. Whilst the path does include the activity name, in the case of a page belonging to a core subsystem, shown in the context of a specific activity, there is no indication as to this link.

      This issue proposes to add the activity name to the classList of the body for any course module, in addition to the cmid and other classes.

      This will allow developers and designers to accentuate or hide information in core subsystem pages (such as question pages) for a specific activity where the information is more or less relevant.

      In fact, our use case is to be able to use some CSS in StudentQuiz to hide some fields on the question editing form which students don't need to see. Without this change, there is not way to targe stule rules to only affect questions being edited that belong to a StudentQuiz.

            vuvanhieu143 Hieu Vu
            vuvanhieu143 Hieu Vu
            Tim Hunt Tim Hunt
            Andrew Lyons Andrew Lyons
            John Edward Pedregosa John Edward Pedregosa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 23 minutes
                1h 23m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.