email address not encoded
Posted: 11 September 2008 10:54 AM   [ Ignore ]
Newbie
Rank
Total Posts:  15
Joined  2008-03-08

I am trying to show a list of emails, and would prefer to have them javascript encoded.  So here is what I did:

{exp:user:users group_id="9|10|1"}
<li>{exp:member:custom_profile_data member_id="{member_id}"}<a href="mailto:{email}">{screen_name}</a>{/exp:member:custom_profile_data}</li>
{/exp:user:users}

But the html output is no different from when I do this:

{exp:user:users group_id="9|10|1"}
<li><a href="mailto:{email}">{screen_name}</a></li>
{/exp:user:users}

Shouldn’t there be?  Am I mistaken about what it means for an email address to be javascript encoded?

P.S.  I posted this in the EE forums first, thinking it had to do with the inner tag, but they suggested I try here instead.

Profile
 
 
Posted: 12 September 2008 08:28 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

jvanschaijik,

My guess would be that User is bypassing any encoding of this.

However, If you try this code anywhere in a template, you’ll get nasty garble:

{exp:member:custom_profile_data member_id="{member_id}"}<a href="mailto:{email}">{screen_name}</a>{/exp:member:custom_profile_data}

The {email} variable does not like to be controlled any further with A Href, A Href Names as the Javascript already does that.

What I’m getting at is even if User did not bypass/overwrite this functionality, you would not be able to customize the link like this. This is how it would have to be: smile

{exp:member:custom_profile_data member_id="{member_id}"}{email}{/exp:member:custom_profile_data}

All of that said, I was able to get this to work: smile

{exp:user:users group_id="9|10|1"}
<li>{encode="{email}"}</li>
{/exp:user:users}

 Signature 
Profile
 
 
Posted: 12 September 2008 11:20 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  15
Joined  2008-03-08

Thanks Pie Man.  That’s a lot simpler.  I didn’t know about that bit of code.

Profile
 
 
Posted: 15 September 2008 08:16 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18
jvanschaijik - 12 September 2008 11:20 AM

I didn’t know about that bit of code.

Haha, neither did I!
After I did some researching, I relized that’s what’s used in the Publish/Edit Entry screen in the CP when using the “Insert Email” function… wink

 Signature 
Profile