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.

Member Email Address

September 13, 2011 1:27pm

Subscribe [3]
  • #1 / Sep 13, 2011 1:27pm

    lmclaney

    3 posts

    Hello,

    I’ve recently started using EE so I’m sorry if this is really obvious.

    I’m creating a website for a local design studio and I’m using the Custom Profile Data Tag to create a profile page for each member of the team.

    On each profile page I have a group of icons for the members various social networks and one icon for the members email.

    I was hoping I could link to the members email like the following, but it doesn’t work:

    <a href="http://{email}">{site_url}images/email_icon.png</a>

    Is there an alternative email tag or a method of achieving this?

    Thanks in advance!

    Liam

  • #2 / Sep 13, 2011 1:56pm

    glenndavisgroup

    436 posts

    Hi lmclaney,

    All of the following member variables are available from any template:

    {screen_name}
    {location}
    {email}
    etc…

    These are all global variables and you can access them without the Custom Profile tag. You only need the CP Tag if you want to display your own custom fields that you created. You can read more about it here:

    http://ellislab.com/expressionengine/user-guide/modules/member/custom_profile_data.html

    I hope that helps.

    Mike

  • #3 / Sep 13, 2011 2:07pm

    lmclaney

    3 posts

    Hi lmclaney,

    All of the following member variables are available from any template:

    {screen_name}
    {location}
    {email}
    etc…

    These are all global variables and you can access them without the Custom Profile tag. You only need the CP Tag if you want to display your own custom fields that you created. You can read more about it here:

    http://ellislab.com/expressionengine/user-guide/modules/member/custom_profile_data.html

    I hope that helps.

    Mike

    Thanks Mike,

    I understand the tags that are available, it’s just that if I use

    {email}

    then it’s going to create a hyperlink with the members email address as the link text. Instead I need to get the email address without any auto url conversion or encoding so I can then create a link with my email icon like so:

    <a href="mailto:[email protected]">images/email_icon.png</a>

    Is this possible or is there a plugin to achieve this?

    I tried creating a custom member field to try and bypass this, but it seems like EE automatically converts any email address to a hyperlink and encodes it.

  • #4 / Sep 13, 2011 3:45pm

    glenndavisgroup

    436 posts

    Which version of EE are you using? Can you post your code as well please.

    Mike

  • #5 / Sep 13, 2011 4:33pm

    lmclaney

    3 posts

    I’m using EE 2.2.2

    My code looks like this:

    {exp:member:custom_profile_data member_id="{segment_3}"}
    
    <ul id="profile_icons">
         <li><a href="http://{email_address}">{site_url}images/email_icon.png</a></li>
    </ul>
     
    {/exp:member:custom_profile_data}

    It looks like all custom member fields auto format if you have a url or email address and there is no in-built method for stopping this. I tried using a plugin called Hacksaw to remove the HTML formatting, it works on normal URL’s but doesn’t remove the encoding and javascript from email addresses.

    I think I might have to use the query module instead and just not use custom_profile_data.

  • #6 / Sep 13, 2011 4:47pm

    W3 | 84ideas

    22 posts

    Hi Liam,

    I guess disabling the function ‘automatically turn urls into links’ feature would do the job. Check Sue’s video for more details:
    http://www.youtube.com/watch?v=jwibnDnMJO4

    Otherwise you could use a plugin like Brett DeWoody’s Hacksaw plugin: http://devot-ee.com/add-ons/hacksaw

    <a href="http://{exp:eehive_hacksaw}{facebook}{/exp:eehive_hacksaw}" title="{username}'s Facebook">Facebook</a>

    Hope this helps.

    Cheers,
    Mike

  • #7 / Sep 13, 2011 5:07pm

    lmclaney

    3 posts

    Hi Mike,

    Thanks for your comments. Sue’s video just relates to Channels and there doesn’t seem to be the same option for Member Fields.

    I’ve already tried Hacksaw, it does stop auto converting urls to links but it doesn’t work for email addresses. If you try an email address even with hacksaw it will be converted to a link and encoded.

    I’m going to use the query module instead, I can’t see any alternative.

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

ExpressionEngine News!

#eecms, #events, #releases