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.

Boring: Can't figure out how to render links properly

May 14, 2011 12:36pm

Subscribe [3]
  • #1 / May 14, 2011 12:36pm

    talbina

    20 posts

    I know this is a question that most developers don’t have an appetite to answer since it is so elementary.

    This is the code I have right now in the template:

    <a href="http://{headlineurl1}">{title}</a>

    My site (http://www.pagedistrict.ca/) is a link aggregator, so it is only one page. All links are outbound. Just in case you were asking yourself why is he not using the “URL Title” field given by EE.

    headlineurl1 is a custom field. The Field Type = Text Input, and Default Text Formatting = None.

    Here’s the bummer: when I type in a URL without http:// , the display is correct, but the link is not. It gives me http://www.pagedistrict.ca/online.wsj.com/article/SB10001424052748703567404576292902984517070.html.

    And when I do enter http:// in the field, the display is not correct. It renders the following code when I do view source:

    <a href="http://a">http://online.wsj.com/article/SB10001424052748703567404576292902984517070.html</a>">
    Canadian Economy Suffers Setback, 0.2% GDP Decline in February</a>

    I hope you understand my problem.

  • #2 / May 16, 2011 4:51am

    John Henry Donovan

    12339 posts

    talbina,

    Head to Admin -> Channel Administration -> Channels and choose the relevant channel preferences.

    Under Administrative Preferences set Automatically turn URLs and email addresses into links? to no

    Does that help?

  • #3 / May 21, 2011 12:52pm

    talbina

    20 posts

    This resolves the issue, thank you.

  • #4 / May 21, 2011 1:58pm

    Greg Salt

    3988 posts

    Hi Talbina,

    Glad that you got this figured out. Please post again if you have further questions.

    Cheers

    Greg

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

ExpressionEngine News!

#eecms, #events, #releases