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
Comment #1
robert castelo commentedMmmh, 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:
Comment #2
ec commentedRobert, 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_newsthis give me a "page not found". With my code I've got the right urlhttp://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 [] . Thel(t('read more'), $item->link)adds the base url of my test site to the url of the news. eric.Comment #3
robert castelo commentedThanks.
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:
One more bug squished...
Comment #4
ec commentedComment #5
(not verified) commentedComment #6
(not verified) commentedComment #7
(not verified) commentedComment #8
(not verified) commentedComment #9
(not verified) commentedComment #10
(not verified) commentedComment #11
(not verified) commentedComment #12
robert castelo commented