Forum
Perch RSS Feed not recognising posts.
Hi Guys,
Trying to set up an RSS Feed for a Blog, I've followed the docs and installation video but haven't managed to get it to work.
If you visit the page (https://www.activegloucestershire.org/news/funding_feed.php), you'll see that the RSS Feed is being recognised, but no posts are showing.
Here's my funding_feed.php template:
<?php include('../cms/runtime.php'); ?>
<?php
$domain = 'https://'.$_SERVER['HTTP_HOST'];
PerchSystem::set_var('domain', $domain);
header('Content-Type: application/rss+xml');
echo '<'.'?xml version="1.0" encoding="UTF-8"?'.'>';
?>
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
<channel>
<title>Active Gloucestershire Funding News</title>
<link><?php echo PerchUtil::html($domain); ?>/news/</link>
<description>Learn more about funding available for sport and physical activity in Gloucestershire. </description>
<atom:link href="<?php echo PerchUtil::html($domain); ?>/news/funding_feed.php" rel="self" type="application/rss+xml" />
<?php
perch_blog_custom(array(
'template' => 'rss_post.html',
'tag' => 'funding',
'sort' => 'postDateTime',
'sort-order' => 'DESC'
));
?>
</channel>
</rss>
and here's the rss_post.html template:
<item>
<title><perch:blog id="postTitle" /></title>
<link><perch:blog id="domain" /><perch:blog id="postURL" /></link>
<guid><perch:blog id="domain" /><perch:blog id="postURL" /></guid>
<description><![CDATA[<perch:blog id="excerpt" encode="false" />]]></description>
<pubDate><perch:blog id="postDateTime" format="D, d M Y H:i:s O" /></pubDate>
<media:content type="image/jpg" url="https://activegloucestershire.org<perch:blog id="banner_image" type="image" width="320" height="240" crop="true"/>" height="768" width="630"/>
</item>
Any ideas on what's going wrong?
Please post your Diagnostics Report - we need this with any post to the forum and it will speed up getting an answer if you include it.
Hi Rachel,
Thanks for your reply.
Here's the report.
Hi Harry, if you view the page source, the posts are showing. I think rss might be having a problem with displaying the
<media:content
parts. Removing them seems to make it function more as expected. It might be the formatting/syntax of those.There is an RSS Feed Validator here which shows an error: https://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.activegloucestershire.org%2Fnews%2Ffunding_feed.php
Thanks for the help guys,
I was using this template to feed into Campaign Monitor, and so needed the image to feed in.
As a resolution, I've separated this feed and the Campaign Monitor feed into different templates, and I'm now no longer using the images in my RSS feed.
Thanks! Harry