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

Add HTML class to elements of link_arrow_left/right to allow theme styling

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Themes
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      The functions link_arrow_left and _right provide a standardised, accessible way to create links with arrows like this:

      < Go back

      The programmer can also add CSS classes for specific uses (e.g. different style arrows). However I want to add additional classes so that these elements can be styled by the theme wherever they are used. (Background: In particular, I have a theme which defaults to underlining links - for these arrows I want it to not underline the link, except on hover, where it should underline only the part with the text and not the arrow character. However these classes should provide full 'themeability' for pretty much every situation.)

      I've made a patch which adds these classes. There is already a class on the arrow character; this adds one on the whole link, and one on just the text (not including the non-breaking space).

      With line breaks added for readability, the HTML output looks like this (note that actual arrow, whether it's a character or an image or whatever, depends on the theme)...

      Before my patch:

      <a href="..." title="Go back">
      <span class="arrow ">◄</span>
       
      Go back
      </a>

      After:

      <a class="arrow_link" href="..." title="Go back">
      <span class="arrow ">◄</span>
       
      <span class="arrow_text">Go back</span>
      </a>

      OK to check this in to HEAD?

        Attachments

          Activity

            People

            • Assignee:
              quen Sam Marshall
              Reporter:
              quen Sam Marshall
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10