The Joomla menu item type "Single News Feed" allows one to display a feed from an item in the News Feed component. No problems so far. It's a simple matter of going to Components » New Feeds » Feed and entering values for Title and Link.
I've got a problem with most of the news feeds that my client wants but here is one example. This is the URL of the feed: https://www.copybook.com/military/rss/news.xml
The problem comes about when you add the menu item linked to this feed. Yes, it displays a lovely list of news items (and images) but the links on the J! 3 website are all wrong. The links use the guid information.
My client's problems began when she had a J! 1.5 website that was brutally hacked. No worries, I was able to salvage a working version which I quickly migrated to J! 3.8.5 and the rebuild is starting to look OK. On the original [J! 1/5 site] the newsfeed displays the RSS feed and the URLs are all good. The same cannot be said of the J! 3.8 site. There's been a change in the way that newsfeeds generate the links.
In J! 3.8, the URLs are generated by lines 94-95 of /components/com_newsfeeds/views/newsfeed/tmpl/default.php
Code: Select all
<?php $uri = !empty($this->rssDoc[$i]->guid) || $this->rssDoc[$i]->guid !== null ? trim($this->rssDoc[$i]->guid) : trim($this->rssDoc[$i]->uri); ?>
<?php $uri = strpos($uri, 'http') !== 0 ? $this->item->link : $uri; ?>
Code: Select all
<?php if ( !is_null( $item->get_link() ) ) : ?>
<a href="<?php echo $item->get_link(); ?>" target="_blank">
Code: Select all
<item>
<title>South Korea, U.S. Begin Joint Naval Drills Amid North Korean Threat</title>
<description><p>SEOUL, South Korea - South Korean and U.S. troops have begun five days of joint naval drills amid North Korea's renewal of its threat to fire missiles near the American territory of Guam.</p> <div><img src="https://www.copybook.com/img/nm8676s52762/south-korea-us-begin-joint-naval-drills-amid-north-korean-threat.jpg?v=1509463589" /></div></description>
<link>https://www.copybook.com/news/south-korea-u-s-begin-joint-naval-drills-amid-north-korean-threat</link>
<author>Charley Wheeler</author>
<guid>https://www.copybook.com/news/south-korea-u-s-begin-joint-naval-drills-amid-north-korean-threat Mon, 16 Oct 2017 09:31:21 +0000</guid>
<pubDate>Mon, 16 Oct 2017 09:31:21 +0000</pubDate>
</item>
It looks like J! 3.8 uses the <guid> element and J! 1.5 used the <link> element.
In the example case above, the link in the <guid> leads to a 404 "not found" whereas the <link> URL is the correct one.
Two questions:
1) Is this a defect in J! 3.8; and
2) Regardless of whether the XML file follows the recommendations of the W3C, was there another good reason to use the <guid> path in J! 3.8 instead of the <link> path?