How To/

[pl] Nie można dodać atrybutu class do elementu <a /> lub innych elementów.
[en] I can't add class or id attribute to <a /> (link) or <img /> element.


1. It is not bug. Joomla blockc class attribute for <a /> element in tinyMCE.

2. Find joomla's tinyMCE file: /mambots/editors/tinymce.php.

3. Find line containing definitions of allowed attibutes and change it, eg.:

extended_valid_elements : "a[name|href|target|title|onclick], img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name], $elements",

change to:

extended_valid_elements : "a[class|name|href|target|title|onclick], img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name], $elements",

Please notice added "class" to allowed attributes in <a /> element.

4. Now it should work. You can mail me if it helped: mynthon@o2.pl.