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.

Simple Tip: Fields containing links as content, having content starting with http:// or www. with same effect

July 13, 2011 12:17am

Subscribe [1]
  • #1 / Jul 13, 2011 12:17am

    ryanvosburg

    50 posts

    Quick little tip that will be useful for editorial or entries that contain a source link.

    A lot of the time these source links are pasted into the source link field without regard of starting with http:// vs or www. Here is a short snippet of php code that will detect what the entry starts with and auto formats the correct way. Just make sure in channel preferences you have automatically convert email addresses and links to OFF. Also compatible with matrix.

    <a href="http://&lt?php">Source</a>

    Hope it’s useful to someone!

    EDIT: wont let me post the entire code… php truncates a lot of it…

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

ExpressionEngine News!

#eecms, #events, #releases