2

In my navigation snippet I have some immutable external links and I just used a standard a tag with a hard-coded href attribute. No problems and it worked nicely.

So I figured there was "no trick" to external links, but ...

I am trying to display news which is actually created offsite at our financial reporting service website. I created a news channel with fields for an excerpt, a pubdate and the external url (which stores the URL as an absolute link [http://www...com].

When I tried to display the news in my template (code below), I am getting the text of the external URL field displaying as a hyperlink and the title of the article as static text (no link). Also, when I click on the exposed link, the URL that tries to load is "http://dev-edrweb.edrtrust.com/%3Ca%20href=".

It's pretty obvious I don't understand templating and external links. Any help is appreciated.

Here's the code from the template:

<ul class="news-feed">
  {exp:channel:entries channel="news" limit="5" disable="pagination"}
      <li>
          <h4>
              <a href="{full_article_url}" target="_blank">{title}</a>
          </h4>
          <span class="news-date">
              {publish_date format="%j %M %y"}&nbsp;|&nbsp;
          </span>
          <span class="news-summary">
              {excerpt}
          </span>
      </li>
  {/exp:channel:entries}
</ul>
4

It sounds like maybe ExpressionEngine is parsing the hyperlink for you. So you are in effect trying to add an anchor element into your href attribute of an exsiting anchor element. Either output {full_article_url} without surrounding it in an tag or turn off this setting for the channel.

http://ellislab.com/expressionengine/user-guide/cp/admin/channels/channel_edit_preferences.html#automatically-turn-urls-and-email-addresses-into-links

| improve this answer | |
  • I turned off the "Auto Create URLS and Emails" (not the real text) option for the channel and it works. THANKS!!! – jgravois Apr 22 '13 at 15:50
  • I'am using EEv1.6.8 and your post help me to resolve the same problem. Thank you very much!!! – user6140 Mar 17 '15 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.