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.

Encode email address from Channel entry?

February 24, 2011 1:22pm

Subscribe [2]
  • #1 / Feb 24, 2011 1:22pm

    Charley Parker

    60 posts

    The encode global variable allows you to encode an email address for display on a web page, but appears to require that the email address be hard-coded into the variable tag:

    {encode="[email protected]" title="Email Me!"}

    Is it possible to have an email address entered in a Channel entry for display on a web page (e.g. to make the email addresses on a Contact Us page editable by an admin panel user) be automatically encoded?

  • #2 / Feb 24, 2011 1:37pm

    Kurt Deutscher

    827 posts

    Starting with EE 2.0.x all email addresses are encoded dynamically. So any time EE finds an email address within some content, it will encode it.

    The only time you need to use the encode global variable anymore is if you want to create a “mailto:” type of link as in your example above where the email address is not displayed and “Email Me!” is instead.

    Is that what you were looking for, or did I misunderstand your question?

  • #3 / Feb 24, 2011 3:29pm

    Charley Parker

    60 posts

    Wow. I didn’t realize that!

    Brilliant feature, of course.

    Thanks!

  • #4 / Feb 24, 2011 3:32pm

    Ingmar

    29245 posts

    Glad to see that explains it. Please post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases