1

I am seeking to create a link on a joomla page that sends mail to a&b@blahblah.com. No matter how I try and do it the final page will attempt to send mail to

a& <script type='text/javascript'> <!-- var prefix = 'ma' + 'il' + 'to'; var path = 'hr' +
 'ef' + '='; var addy60868 = 'b' + '@'; addy60868 = addy60868 + 'blahblah' + '.' + 'com'; 
document.write('<a ' + path + '\'' + prefix + ':' + addy60868 + '\'>'); 
document.write(addy60868); document.write('<\/a>'); //-->\n </script><script
 type='text/javascript'> <!-- document.write('<span style=\'display: none;\'>'); //--> 
</script>This email address is being protected from spambots. You need JavaScript enabled to
 view it. <script type='text/javascript'> <!-- document.write('</'); document.write('span>');
 //--> </script>

(I had to garble that a bit to make it fit) Hopefully it is clear that that is not what I am aiming for. I have looked at lots of ampersand related problems and they are to do with replacing with either & amp; or %26 but neither of these solves the problem. In my own limited understanding it looks like the joomla editor (JCK) interprets it one way and then the page itself another afterwards. Thank you for any help you can give.

NYoung
  • 157
  • 1
  • 14

2 Answers2

0

I would suggest you to create or use a module for this task.

If you still want to do it manually, please try to set editor to "Editor - None" to the administrator user that you are using in order to work without an editor that may break your markup.

You also have to set: Global configuration -> text filters -> "No Filtering" to super users.

emmanuel
  • 9,607
  • 10
  • 25
  • 38
  • Do you have any ideas which modules would be appropriate? Thank you. – NYoung Jul 18 '14 at 10:47
  • if your javascript code is correct, following the steps above should work. – emmanuel Jul 18 '14 at 11:32
  • I don't want to do it manually. The editor is very useful everywhere else and this is a user-maintained site so I can't have pages with no editors. Do you know of any modules with this functionality? – NYoung Jul 21 '14 at 07:31
  • You could create a custom plugin and trigger that to send the mail. Here is the tutorial how you could do that [Creating a Plugin for Joomla](http://docs.joomla.org/J2.5:Creating_a_Plugin_for_Joomla) – emmanuel Jul 24 '14 at 09:54
0

This isn't going to be the answer you want, but it it a bit long for a comment. Are you aware that unless users really work at their browser settings Chrome blocks mailto? You will be better off making a contact record for anyone you want to list the email for and use a pop up link to a contact form for that person. It's not the same as opening someone's email client but I suspect lots of users also don't have those correctly set up either.

Community
  • 1
  • 1
Elin
  • 6,507
  • 3
  • 25
  • 47
  • All of the users are using internet explorer with group settings to allow mailto. What you suggest may be good anyway – NYoung Jul 21 '14 at 07:33
  • You might also want to ask the JCK people if there is an issue .. can you see how the email address is saving in the database? – Elin Jul 21 '14 at 12:21
  • I don't know how to do that. I can perhaps find out but I don't think I will. – NYoung Jul 24 '14 at 08:57
  • I'm not sure what "that" you are referring to, but turn off the editor (change to "none" for your editory) and open the article. To find the extension developer use Google or go to the extensions directory. – Elin Jul 25 '14 at 11:33
  • Thank you. If I get access to the database I might check out how the email address is saving. Thank for your thought for thought. – NYoung Jul 30 '14 at 13:21