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

help_icon only supports values passed in as a context

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1
    • Themes
    • None
    • MOODLE_401_STABLE

      If you have fixed content, like a form in a modal which is manually written, and you wish to add help icons, you currently have to call get_string and put the resolved stirng into the context.

      This. Is. Nuts.

      Lets use Mustache blocks, that is:

      <a class="btn btn-link p-0" role="button"
          data-container="body" data-toggle="popover"
          data-placement="{{#ltr}}right{{/ltr}}{{^ltr}}left{{/ltr}}" data-content="{{$text}}{{text}}{{/text}} {{$completedoclink}}{{completedoclink}}{{/completedoclink}}"     data-html="true" tabindex="0" data-trigger="focus">
      

      That is, adding a $text tag arouind the text.

      This will be backwards compatible but allow templates to include the help_icon:

      {{< core/help_icon }}
        {{$text}}{{#str}} somestr, moodle {{/str}}{{/text}}
        {{$completedoclink}}{{/completedoclink}}
      {{/ core/help_icon }}
      

            Unassigned Unassigned
            dobedobedoh Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

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