Forum

Thread tagged as: Problem

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?

Harry Ray

Harry Ray 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

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.

PERCH INFORMATION

Perch: 2.8.31
Production mode: Production (100)
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_shop_paypal (1.2.3), perch_forms (1.8.3), perch_blog (5.0), perch_comments (1.2), perch_members (1.5), perch_twitter (3.5.1)
DB driver: PDO
DB tables: perch2_blog_authors (4), perch2_blog_comments (2), perch2_blog_index (469), perch2_blog_posts (10), perch2_blog_posts_to_tags (22), perch2_blog_sections (1), perch2_blog_tags (14), perch2_blogs (1), perch2_categories (1), perch2_category_counts (0), perch2_category_sets (3), perch2_comments (10), perch2_comments_votes (0), perch2_content_index (4227), perch2_content_items (1223), perch2_content_regions (324), perch2_courses (1), perch2_forms (2), perch2_forms_responses (9), perch2_members (0), perch2_members_forms (1), perch2_members_member_tags (0), perch2_members_sessions (1), perch2_members_tags (0), perch2_navigation (4), perch2_navigation_pages (45), perch2_page_templates (21), perch2_pages (78), perch2_resource_log (3994), perch2_resource_tags (6), perch2_resources (780), perch2_resources_to_tags (6), perch2_settings (37), perch2_shop_categories (11), perch2_shop_courses (3), perch2_shop_log (3), perch2_shop_orders (2), perch2_shop_product_options (0), perch2_shop_products (4), perch2_shop_products_to_categories (0), perch2_shop_products_to_courses (0), perch2_twitter_scheduled_tweets (0), perch2_twitter_settings (1), perch2_twitter_tweets (909), perch2_user_passwords (0), perch2_user_privileges (81), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (9)
Users: 9
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog',
        'perch_members',
        'perch_twitter',
        'perch_forms',
        'perch_comments',
        'perch_shop_paypal'
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Scheduled tasks for perch_comments: delete_spam_comments (1440 mins)
Scheduled tasks for perch_twitter: post_tweets (1 mins), update_tweets (30 mins)
Editor plug-ins: markitup
H1: ef3923fbeb3bbfc5c7d69e48b72db948
L1: decc131a5977ddd7a8d783c56351db03
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.25: done
latest_version: 2.8.15
on_sale_version: 2.8.31
headerScheme: light
perch_blog_site_name:
perch_blog_post_url: /news/post.php?s={postSlug}
perch_blog_slug_format: {postTitle}-{postID}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 1
content_frontend_edit: 0
perch_blog_comment_notify: 1
perch_blog_update: 5.0.1
perch_members_update: 1.4
perch_twitter_update: 3.5
perch_members_login_page: /members/login.php?r={returnURL}
update_2.8.31: done
perch_shop_update: 1.0.6
perch_comments_akismet_key:
perch_comments_max_spam_days: 0
perch_shop_price_tax_mode: exc
perch_shop_site_url: https://
perch_shop_product_url: /training-and-courses/product.php?s={productSlug}
perch_shop_default_currency:
perch_shop_reporting_currency:
perch_shop_invoice_number_format: Invoice%d
perch_shop_display_oos: 1
perch_shop_paypal_email: info@activegloucestershire.org
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: activeglos_live
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: admin_activeglos_live
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: info@activegloucestershire.org
PERCH_EMAIL_FROM_NAME: Active Gloucestershire
PERCH_LOGINPATH: /cms
PERCH_PATH: /var/www/vhosts/activegloucestershire.org/httpdocs/cms
PERCH_CORE: /var/www/vhosts/activegloucestershire.org/httpdocs/cms/core
PERCH_RESFILEPATH: /var/www/vhosts/activegloucestershire.org/httpdocs/cms/resources
PERCH_RESPATH: /cms/resources
PERCH_HTML5: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /var/www/vhosts/activegloucestershire.org/httpdocs/cms/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.4.13
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 5.5.30
MySQL server: 5.5.30
Free disk space: 4.06 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, sockets, mbstring, tokenizer, xml, cgi-fcgi, curl, dom, fileinfo, gd, imagick, imap, json, ldap, exif, mcrypt, mysql, mysqli, odbc, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, Phar, snmp, sqlite3, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, mhash, ionCube Loader
GD: Yes
ImageMagick: Yes
PHP max upload size: 128M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
PATH: /sbin:/usr/sbin:/bin:/usr/bin
PP_CUSTOM_PHP_INI: /var/www/vhosts/system/activegloucestershire.org/etc/php.ini
PP_CUSTOM_PHP_CGI_INDEX: fastcgi
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
REQUEST_URI: /cms/core/settings/diagnostics/?extended
QUERY_STRING: extended
REQUEST_METHOD: GET
SERVER_PROTOCOL: HTTP/1.0
GATEWAY_INTERFACE: CGI/1.1
REMOTE_PORT: 33387
SCRIPT_FILENAME: /var/www/vhosts/activegloucestershire.org/httpdocs/cms/core/settings/diagnostics/index.php
SERVER_ADMIN: jamesh@thirdfloordesign.co.uk
DOCUMENT_ROOT: /var/www/vhosts/activegloucestershire.org/httpdocs
REMOTE_ADDR: 82.35.54.156
SERVER_PORT: 80
SERVER_ADDR: 205.186.165.244
SERVER_NAME: www.activegloucestershire.org
SERVER_SOFTWARE: Apache
SERVER_SIGNATURE: <address>Apache Server at www.activegloucestershire.org Port 80</address>
HTTP_COOKIE: __utma=1.28334944.1465223411.1465223411.1465223411.1; __utmz=1.1465223411.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); __utma=1.28334944.1465223411.1465223411.1465223411.1; __utmz=1.1465223411.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); _ga=GA1.2.28334944.1465223411; __atuvc=61%7C29%2C55%7C30%2C2%7C31%2C1%7C32%2C10%7C33; cmsa=1; PHPSESSID=9u2a8pbbdj9qecjc0c1piah0o0
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_REFERER: https://www.activegloucestershire.org/cms/core/settings/diagnostics/
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_CONNECTION: close
HTTP_X_ACCEL_INTERNAL: /internal-nginx-static-location
HTTP_X_FORWARDED_FOR: 82.35.54.156
HTTP_X_REAL_IP: 82.35.54.156
HTTP_HOST: www.activegloucestershire.org
UNIQUE_ID: V7blCM26pfQAAA2cUuwAAAAC
FCGI_ROLE: RESPONDER
PHP_SELF: /cms/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1471603976.8927
REQUEST_TIME: 1471603976
Simon Clay

Simon Clay 127 points

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.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

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