Moodle
  1. Moodle
  2. MDL-30039

Be able to inject meta | link tags to headers programatically

    Details

    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Rank:
      19580

      Description

      This is a followup created because of MDL-29213 . It should be possible to add/modify meta | link head tags programmatically, modules. They can be needed for various (real) purposes IMO.

        Issue Links

          Activity

          Hide
          Dan Marsden added a comment -

          +1 from me!!! - this is the 2nd time I've had to make the ugly hack used in MDL-29213 - the other time was for some non-core code that needed extra meta - we used to be able to do this in 1.9 using standard print_header calls.

          Show
          Dan Marsden added a comment - +1 from me!!! - this is the 2nd time I've had to make the ugly hack used in MDL-29213 - the other time was for some non-core code that needed extra meta - we used to be able to do this in 1.9 using standard print_header calls.
          Hide
          Hubert Chathi added a comment -

          For meta http-equiv, would it be sufficient to just inject actual HTTP headers using the header() function? Or does IE just check for X-UA-Compatible the meta tag and not the HTTP header?

          Show
          Hubert Chathi added a comment - For meta http-equiv, would it be sufficient to just inject actual HTTP headers using the header() function? Or does IE just check for X-UA-Compatible the meta tag and not the HTTP header?
          Hide
          Dan Marsden added a comment -

          don't think we could use header()... - more info on X-UA here:
          http://msdn.microsoft.com/en-us/library/cc288325

          Show
          Dan Marsden added a comment - don't think we could use header()... - more info on X-UA here: http://msdn.microsoft.com/en-us/library/cc288325
          Hide
          Hubert Chathi added a comment -

          Hmpf. I shouldn't be surprised that IE doesn't behave well. :-P

          Show
          Hubert Chathi added a comment - Hmpf. I shouldn't be surprised that IE doesn't behave well. :-P
          Hide
          Hubert Chathi added a comment - - edited

          I'm guessing the best way to do this would be to add something to $PAGE->requires to specify extra head entries (maybe $PAGE->requires->head($tag, $contents, $attributes)?), and then modify page_requirements_manager::get_head_code to fetch those tags. This way, there won't be any modifications required for themes.

          This functionality would also be helpful for, e.g. adding "prev" and "next" link tags for modules that have a defined sequence.

          Show
          Hubert Chathi added a comment - - edited I'm guessing the best way to do this would be to add something to $PAGE->requires to specify extra head entries (maybe $PAGE->requires->head($tag, $contents, $attributes)?), and then modify page_requirements_manager::get_head_code to fetch those tags. This way, there won't be any modifications required for themes. This functionality would also be helpful for, e.g. adding "prev" and "next" link tags for modules that have a defined sequence.
          Hide
          Michael de Raadt added a comment -

          Raising the priority of this issue as it is growing in importance.

          Show
          Michael de Raadt added a comment - Raising the priority of this issue as it is growing in importance.
          Hide
          Davo Smith added a comment -

          Just commenting here as 2 years after the priority of this was raised to 'critical', I'm still regularly having to make core modifications to client sites in order to make various SCORM work in IE9+ (by forcing the 'X-UA-Compatible' header in scorm/player.php to always output, so it catches IE10/11 as well as IE9, forcing it to be the first item in $CFG->additionalhtml head, forcing that to be the first item output by standard_head_html and then editing all themes in use to make sure that outputs before any other head tags).

          Show
          Davo Smith added a comment - Just commenting here as 2 years after the priority of this was raised to 'critical', I'm still regularly having to make core modifications to client sites in order to make various SCORM work in IE9+ (by forcing the 'X-UA-Compatible' header in scorm/player.php to always output, so it catches IE10/11 as well as IE9, forcing it to be the first item in $CFG->additionalhtml head, forcing that to be the first item output by standard_head_html and then editing all themes in use to make sure that outputs before any other head tags).

            People

            • Votes:
              7 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated: