ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Encoding e-mail adresses does not work on EE2

December 27, 2012 9:21am

Subscribe [3]
  • #1 / Dec 27, 2012 9:21am

    titm0use

    18 posts

    Somehow the global variable {encode} is not rendering on EE 2.5.3.

    It does work inside a template but not as part of a channel entry.

    I tried to change the preferences of the channel but unfortunately no result. See screenshot attached.

    Can someone please help me?

    Thanks 😊

    http://ellislab.com/expressionengine/user-guide/templates/globals/single_variables.html#encode

  • #2 / Dec 27, 2012 4:08pm

    Kevin Cupp

    791 posts

    Hi titm0use,

    I’m unable to reproduce, the encoded email address appears fine for me in 2.5.3 as well as our latest, 2.5.5. There is a known issue of encoded email addresses not working in the forums, but it should work fine inside of a channel entry.

    What does the entry output instead of the encoded email address?

    Kevin

  • #3 / Dec 28, 2012 7:02am

    allgood2

    427 posts

    We had this happen with EE 2.5.2. The issue was the related to a WYSIWYG field specifically. But also related to how ExpressionEngine now handles encode.  It was converting all the curly brackets to html_entities, which means they did get parsed.

    We solved by switching to using BBCode for encoding. This required find/replace across entries, but basically we searched for…

    then replaced with

    The find/replace code was a bit more complicated, because it required multiple passes for different email combinations for example some people used. But we tested and played with in BBEdit until we got it working, then backed up the database and ran it using EE Find/Replace tool.

    {encode="[email protected]" title="[email protected]"}
    {encode="[email protected]"} .(JavaScript must be enabled to view this email address){/encode}
    {encode="[email protected]" title="[email protected]"}

    There are probably other options you can use as well, such as modify the WYSIWYG add-on/field_type. Use a different WYSIWYG field_type, one that offers its own {encode} option, etc., or lastly, if you turn on ‘automatic conversion’ EE will encode all email addresses.

    This wasn’t really an option for us, because auto-conversion doesn’t create proper urls. In fact if EE separated out the auto-conversion into two separate options: (1) auto-convert emails, and (2) auto-convert urls this would be much better. For accessibility and standards compliance we always include titles with our <a > and auto-convert doesn’t.

  • #4 / Dec 28, 2012 12:06pm

    titm0use

    18 posts

    We had this happen with EE 2.5.2. The issue was the related to a WYSIWYG field specifically. But also related to how ExpressionEngine now handles encode.  It was converting all the curly brackets to html_entities, which means they did get parsed.

    We solved by switching to using BBCode for encoding. This required find/replace across entries, but basically we searched for…

    then replaced with

     

    Thanks for thinking with me on this issue.

    I tried the BBCode version and it worked but when you click on the link the e-mail that is composed by your e-mail client isn’t using the e-mail address that you would think it would pass through. Do you have any idea?

  • #5 / Dec 28, 2012 12:25pm

    allgood2

    427 posts

    Sorry, I was just typing from memory this morning, I should have provided the link to the BBCode reference chart. I probably entered something wrong. Here’s the code from the BBCode page:

    [email][email protected][/email]

    or

    [[email protected]]click here to email[/email]

    the UserGuide link is here.

  • #6 / Dec 28, 2012 12:57pm

    titm0use

    18 posts

    Thanks a lot! It works!!!!! 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases