Can we have a différent 'title' than the content of the link (fix accessibility error) in email, print and edit :
File :
joomla-cms/components/com_content/helpers/icon.php
Can we have a different Jtext for the title like : JGLOBAL_EMAIL_TITLE
File :
joomla-cms/components/com_content/helpers/icon.php
Can we have a different Jtext for the title like : JGLOBAL_PRINT_TITLE
File :
joomla-cms/components/com_content/helpers/icon.php
Can we have a different Jtext for the title like : JGLOBAL_EDIT_TITLE
6.2.4
Pour chaque lien composite ayant un titre de lien (attribut title), le contenu de cet attribut est-il > pertinent ?
Labels |
Added:
?
|
I guess I do understand.
Basically, for accessibility reasons, @cr2a-graphique says that the text displayed for these buttons should be different from the title of the link.
I.e. $attribs['title'] = JText::_('JGLOBAL_EMAIL');
should use another string than $text = '<span class="icon-envelope"></span>' . JText::_('JGLOBAL_EMAIL');
For example, we have for email:
<li class="email-icon">
<a rel="nofollow" onclick="window.open(this.href,'win2','width=400,height=350,menubar=yes,resizable=yes'); return false;" title="E-mail" href="/trunkgitnew/component/mailto/?tmpl=component&template=protostar&link=e2ff909fd70c5e96eb1d6a5d32cf1770afd9852d">
<span class="icon-envelope"></span>
E-mail
</a>
</li>
Therefore he proposes we patch in order to get:
<li class="email-icon">
<a rel="nofollow" onclick="window.open(this.href,'win2','width=400,height=350,menubar=yes,resizable=yes'); return false;" title="JGLOBAL_EMAIL_TITLE" href="/trunkgitnew/component/mailto/?tmpl=component&template=protostar&link=ffa35a7825e020c5c730bbf9258ea430f5071995">
<span class="icon-envelope"></span>
Email
</a>
</li>
Where JGLOBAL_EMAIL_TITLE
could be
JGLOBAL_EMAIL_TITLE="Email this link to a friend"
JGLOBAL_EDIT_TITLE="Edit article"
JGLOBAL_PRINT_TITLE="Print article"
Patch would be (btw we have to add a title for Edit as it is missing):
diff --git a/components/com_content/helpers/icon.php b/components/com_content/helpers/icon.php
index 421bc82..febfe38 100644
--- a/components/com_content/helpers/icon.php
+++ b/components/com_content/helpers/icon.php
@@ -108,5 +108,5 @@
}
- $attribs['title'] = JText::_('JGLOBAL_EMAIL');
+ $attribs['title'] = JText::_('JGLOBAL_EMAIL_TITLE');
$attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;";
$attribs['rel'] = 'nofollow';
@@ -224,4 +224,5 @@
}
+ $attribs['title'] = JText::_('JGLOBAL_EDIT_TITLE');
$output = JHtml::_('link', JRoute::_($url), $text, $attribs);
@@ -267,5 +268,5 @@
}
- $attribs['title'] = JText::_('JGLOBAL_PRINT');
+ $attribs['title'] = JText::_('JGLOBAL_PRINT_TITLE');
$attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;";
$attribs['rel'] = 'nofollow';
plus evidently the new language strings
I can make a PR but as I am not a specialist of accessibility, better wait for a comment here.
From an accessibility point of view using the title tag here is probably useless and not recommended http://webaim.org/articles/gonewild/#title
hi,
Thanks to @infograf768 who understand me
In fact, using the title tag can be useless. But i think it's better to improved the title cause the term 'email' or 'print' don't explain what's realy hapen next.
A title like
title="print this article"
are better
or
title="print the article : <name of article>"
are much better
No title tag or title tag improved are valid. but, for sure title and link can't be the same term.
Can we do something ?
@infograf768 will you be able to do a PR for this ?
@infograf768 will you be able to do a PR for this ?
I gone try as soon as possible
I will if you don't :)
yes, i don't realy know how, so if you can do this @infograf768 it's cool
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-03-11 09:41:47 |
Closed_By | ⇒ | brianteeman |
Closed as we have a PR for testing - thanks
Closing as we have a patch
I am sorry I do not understand what you are asking
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8694.