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.

How to selectively auto-link URLs and email addresses?

August 13, 2012 5:30pm

Subscribe [1]
  • #1 / Aug 13, 2012 5:30pm

    ocaorg

    8 posts

    Good evening,

    Our developer built a new EE site for us last year atop EE 2.1.x, and in many places he leaned on the then-existing behavior of auto-linking prefix-less URLs, e.g. http://www.example.com would become a link with href to http://www.example.com/ . Upgrading to 2.5.x when this “bug” was “fixed” (in our view, we’d word it by saying that this key behavior changed without sufficient warning), we’ve had many subtle things break throughout the site. We’re still finding random broken things.

    One thing we’re needing to do is turn off auto-linking in some channels. (If we had it to do over again, we’d just turn it off globally and start from there, but we have to keep things working as best we can.) When we do that, what’s the best way to auto-link just one section at a time? I think I’ve seen the answer before, but 20 solid minutes of searching everything I can think of hasn’t yielded the answer.

    For example, we have a parish directory that might mention a parish homepage, the priest’s email address, and a link to the parish Facebook page. The way our site is designed, we cannot have the Facebook page’s URL be auto-linked, but we need the parish homepage and priest’s email address to be auto-linked.

    Thanks for your time.

    Ryan Platte
    Technical Manager, Orthodox Church in America

  • #2 / Aug 13, 2012 5:40pm

    ocaorg

    8 posts

    Ah, I found it… {exp:auto_linker}http://example.com/{/exp:auto_linker}

    https://github.com/EllisLab/Auto-Linker

  • #3 / Aug 13, 2012 6:49pm

    ocaorg

    8 posts

    Actually, my issue isn’t totally resolved yet…is there a tag to do the encryption of the email address selectively?

  • #4 / Aug 14, 2012 5:48pm

    Dan Decker

    7338 posts

    Hi ocaorg,

    …is there a tag to do the encryption of the email address selectively?

    Not really, ExpressionEngine encodes those automatically for spam avoidance. What’s the use-case where you would want them in the clear?

    I look forward to your reply!

    Cheers,

  • #5 / Aug 14, 2012 11:56pm

    ocaorg

    8 posts

    We had to disable the autolinker/autoencryption for that channel because it was breaking things in several places, as I tried to explain in the first paragraph of my original post. I’m asking how to get that functionality back in a certain place, like we can with the auto_linker plugin I mentioned above for the web URLs.

  • #6 / Aug 16, 2012 11:49am

    Dan Decker

    7338 posts

    Hi ocaorg!

    Apologies for my misunderstanding! Try the encode tag.

    ~

  • #7 / Aug 16, 2012 11:52am

    ocaorg

    8 posts

    Ah, perfect, thanks very much. It would be super helpful if the documentation for the channel setting to disable this mentioned the auto_linker plugin and encode tag. I was hitting Google and your search feature pretty hard and not coming up with it.

  • #8 / Aug 16, 2012 1:45pm

    ocaorg

    8 posts

    Actually, not perfect. We need to support automatic encoding of email addresses that appear in freeform text. This worked great before we had to turn off the “magic” option on this channel, and neither the auto_linker nor the {encode} can handle this the same way.

    Here’s the content of one field we need to encrypt emails within:

    <div class="contact">
    <div class="name">Rev. Firstname Lastname</div>
    <div class="description">Priest-in-Charge</div>
    <div class="phone"><span>Home: </span>888-555-1212</div>
    <div class="email">[email protected]</div>
    </div>

    We also have email addresses appear in the body of news posts sometimes and need to encode those. Any suggestions?

  • #9 / Aug 17, 2012 2:27pm

    Dan Decker

    7338 posts

    Actually, not perfect.

    Well darn, there goes my record 😉


    How about Custom Typography?

    That plugin can be used selectively on your channel fields. If the parameter to encode email is used, it could fix you right up.

    ~

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

ExpressionEngine News!

#eecms, #events, #releases