Robert, the "read more" link doesn't work, it adds the link to the original news after the link of site. I need to change this :

$output .= '<br /><span class="feed-item-link">' . l(t('read more'), $item->link) . '</span> <span class="feed-item-source">[<a href="/' . $item->flink . '">' . $item->ftitle . '</a>] ' . $blog_icon . '</span>';

by this :

$output .= '<br /><span class="feed-item-link"> <a href="/' . $item->link . '">' . t('read more') . '</a> </span> <span class="feed-item-source">[<a href="/' . $item->flink . '">' . $item->ftitle . '</a>] ' . $blog_icon . '</span>';

and it works for me (but there could be an other way !)

Thanks, regards,

Eric.

Comments

robert castelo’s picture

Mmmh, that's strange - the "Read more" link works fine for me. Could you check again please?

What HTML does it output for you?

You can do it the way you have, but this is the more Drupal like way:

l(t('read more'), $item->link)
ec’s picture

Robert, let me say that it's on my test site on my own laptop, running linux, apache 2, php 4.3.11 and I'm not using clean URL. With your code I've got something like http://localhost/my_site/?q=http://the_url_of_the_news this give me a "page not found". With my code I've got the right url http://the_url_of_the_news. In fact I just do what you did for the link to the source of the news the one in the [] . The l(t('read more'), $item->link) adds the base url of my test site to the url of the news. eric.

robert castelo’s picture

Thanks.

The answer is that l() and url() are for internal links, and I was trying to use it for an external link.

I've just changed the line with the read more link to:

<a href="' . $item->link . '">' .t('read more') . '</a>

One more bug squished...

ec’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

robert castelo’s picture

Status: Fixed » Closed (fixed)