Skip to content
Snippets Groups Projects

Note about title attributes in anchor tags

Merged homotechsual requested to merge github/fork/demeritcowboy/title-attributes into master

Created by: demeritcowboy

Separated out from https://github.com/civicrm/civicrm-dev-docs/pull/751

This might not make complete sense on its own without 751, but it seems difficult to get the wording for this part right so separating it out.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
101 101 ```
102
102
103 For `title` attributes in `<a>` links, within CiviCRM these usually only appear in links that aren't within a larger block of text or where there is no clickable text, such as a datepicker icon. In this situation, the title text needs to be translated:
104
105 !!! failure "Bad"
106
107 ```smarty
108 {ts}<a href="https://www.example.org/civicrm/contact/view?cid=1" title="Go to the contact page">View Contact</a>{/ts}
109 ```
110
111 !!! failure "Less bad"
112
113 ```smarty
114 <a href="https://www.example.org/civicrm/contact/view?cid=1" title="{ts}Go to the contact page{/ts}">{ts}View Contact{/ts}</a>
115 ```
  • homotechsual
    homotechsual @homotechsual started a thread on commit 94f6c994
  • 101 101 ```
    102
    102
    103 For `title` attributes in `<a>` links, within CiviCRM these usually only appear in links that aren't within a larger block of text or where there is no clickable text, such as a datepicker icon. In this situation, the title text needs to be translated:
    104
    105 !!! failure "Bad"
    106
    107 ```smarty
    108 {ts}<a href="https://www.example.org/civicrm/contact/view?cid=1" title="Go to the contact page">View Contact</a>{/ts}
    109 ```
    110
    111 !!! failure "Less bad"
    112
    113 ```smarty
    114 <a href="https://www.example.org/civicrm/contact/view?cid=1" title="{ts}Go to the contact page{/ts}">{ts}View Contact{/ts}</a>
    115 ```
  • homotechsual
    homotechsual @homotechsual started a thread on commit 94f6c994
  • 101 101 ```
    102
    102
    103 For `title` attributes in `<a>` links, within CiviCRM these usually only appear in links that aren't within a larger block of text or where there is no clickable text, such as a datepicker icon. In this situation, the title text needs to be translated:
    104
    105 !!! failure "Bad"
    106
    107 ```smarty
    108 {ts}<a href="https://www.example.org/civicrm/contact/view?cid=1" title="Go to the contact page">View Contact</a>{/ts}
    109 ```
    110
    111 !!! failure "Less bad"
    112
    113 ```smarty
    114 <a href="https://www.example.org/civicrm/contact/view?cid=1" title="{ts}Go to the contact page{/ts}">{ts}View Contact{/ts}</a>
    115 ```
    • Created by: demeritcowboy

      I was basing the example on existing defacto usage and I'm not clear myself whether there is a "good" way to do title attributes. I put "less bad" because you don't have the context that they go together.

  • homotechsual
    homotechsual @homotechsual started a thread on commit 94f6c994
  • 101 101 ```
    102
    102
    103 For `title` attributes in `<a>` links, within CiviCRM these usually only appear in links that aren't within a larger block of text or where there is no clickable text, such as a datepicker icon. In this situation, the title text needs to be translated:
    104
    105 !!! failure "Bad"
    106
    107 ```smarty
    108 {ts}<a href="https://www.example.org/civicrm/contact/view?cid=1" title="Go to the contact page">View Contact</a>{/ts}
    109 ```
    110
    111 !!! failure "Less bad"
    112
    113 ```smarty
    114 <a href="https://www.example.org/civicrm/contact/view?cid=1" title="{ts}Go to the contact page{/ts}">{ts}View Contact{/ts}</a>
    115 ```
    Please register or sign in to reply
    Loading