ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

RSS “feed contains no entries”

March 15, 2010 3:00pm

Subscribe [3]
  • #1 / Mar 15, 2010 3:00pm

    Phil Norton

    41 posts

    Pretty sure I’ve come across this before, but I’m drawing a blank with regards to the solution. Here’s the scenario: we’ve got a jobs weblog, that holds, as you’d imagine, job vacancies within the company. Today, at 5pm GMT, the only job we had expired, and so is no longer showing on our site. Yay for expiry dates. However, the RSS feed for our jobs data has been updated with “This feed contains no entries”.

    Is this the expected behaviour? Technically, the RSS feed is correct: there ARE no entries (as the only one has now since expired) but this seems a little untidy to me. Does anything have to be shown if there are no entries?

  • #2 / Mar 15, 2010 4:45pm

    Ingmar

    29245 posts

    No, I’m afraid if there are no entries your feed won’t be able to display one. You could probably have a “placeholder” entry, or perhaps use a no_results conditional.

  • #3 / Mar 16, 2010 11:09am

    Phil Norton

    41 posts

    Hmm, but it seems as though EE is putting this text in. Here’s my EE template:

    {assign_variable:master_weblog_name="jobs"}
    {exp:rss:feed weblog="{master_weblog_name}"}
    <?xml version="1.0" encoding="{encoding}"?>
    <rss version="2.0"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:admin="http://webns.net/mvcb/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:content="http://purl.org/rss/1.0/modules/content/">
    
        <channel>
        
        <title>{exp:xml_encode}Work At Company Name Here{/exp:xml_encode}</title>
        <link>{weblog_url}</link>
        <description>Work At Company Name Here</description>
        <dc:language>{weblog_language}</dc:language>
        <dc:creator>{email}</dc:creator>
        <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
        <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
        <admin:generatorAgent rdf:resource="http://expressionengine.com/" >
        
    {exp:weblog:entries weblog="{master_weblog_name}" limit="10" rdf="off" dynamic="off" dynamic_start="on" disable="categories|category_fields|member_data|pagination|trackbacks"}
        <item>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <link>{page_url}</link>
          <guid>{page_url}</guid>
          <description>{exp:xml_encode}{job_intro}{/exp:xml_encode}</description>
          <dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
          <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
        </item>
    {/exp:weblog:entries}
        
        </channel>
    </rss>
    {/exp:rss:feed}

    and here’s the output when the jobs have expired:

    <?xml version="1.0" encoding="utf-8"?>
    <rss version="2.0">
        <channel>
        <title>Title Goes Here</title>
        <link>http://www.example.com/</link>
        <description></description>
        <docs>http://www.rssboard.org/rss-specification</docs>
        <generator>ExpressionEngine v1.6.8 <a href="http://expressionengine.com/&lt/generator&gt">http://expressionengine.com/</generator&gt</a>;
        <item>
         <title>This feed contains no entries</title>
         <description>This feed contains no entries</description>
         Tue, 16 Mar 2010 14:03:55 GMT</pubDate>
        </item>
        </channel>
    </rss>

    so I think EE is manually inserting the “This feed contains no entries” string of text and I don’t think the conditional statements would sort that, would they?

  • #4 / Mar 16, 2010 11:17am

    Sue Crocker

    26054 posts

    Phil, there is a language file for the RSS feeds. lang.rss.php

    'empty_feed' =>
    'This feed contains no entries',

    You can of course change the value of that text string. (Around line 26)

    Does that help?

  • #5 / Mar 16, 2010 11:21am

    Phil Norton

    41 posts

    Hi Sue

    That’s great; I really should have thought about looking there!! I can change this to say something more meaningful now.

    Thanks again,
    Phil

  • #6 / Mar 16, 2010 11:24am

    Sue Crocker

    26054 posts

    I wasn’t aware it was there either. Just searched for that text string and found it. 😊 Going to make a howto entry so I’ll remember it for next time. 😊

    Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases