A (non-ideal) solution as follows:
In the "replaceInsertTags" function in Controll.php I added the following case statement after the 'email' one
Code:
case 'emailxx':
if (strlen($elements[1]))
{
$this->import('String');
$strEmail = $this->String->encodeEmail($elements[1]);
$arrCache[$strTag] = substr($strEmail,0,strcspn($strEmail,">")-1);
}
break;
This allows me to use the following in my tailored list_fd_xxx.tpl template:
Code:
{{emailxx::<?php echo $fields['mkmail']['content'];?>}}?Subject=blablabla "><img src=..../></a>
This 'case emailxx' is a direct copy of the 'case email' code except with the sixth line altered. $fields['mkmail']['content'] is my efg form field that contains an email address; this will always give (in TL2.8, where the 'mailto:' is now also encoded):
encoded-email-address
no matter how it is treated (as the email address is recognised and processed as part of the page rendering - I assume).
The {{emailxx ::...}} inserttag will now only return (by stripping out everything from the first '>' and the preceeding ' " ' to the end in the string):
<a href="encoded-mailto:encoded-email-address
This allows the addition of further email info (e.g. subject information using other form fields), and also the assignment of an image. This is definitely a kludge, but it seems to be the only way (at present) that I can get an image associated with the mailto: link and still have the address encoded. Any other (better) solutions?
Bookmarks