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.

Creating category-specific RSS feeds

September 14, 2009 11:44pm

Subscribe [2]
  • #1 / Sep 14, 2009 11:44pm

    Doy

    38 posts

    I have a client who is working with a mobi site company, who is asking me to give them separate rss feeds for dining, activities, shopping and the like for a visitors bureau site.

    All of these items are under one weblog, called “Businesses,” and are separated out by category.

    I’d ready a brief boyink article saying I could just link to the category by rsslink/C/ID, but it’s still pulling in all the entries from the businesses section.

    I need to create feeds that will week out all but the specific category I’m looking for, and I haven’t found a tutorial or some sort of guidance on how to do that.

    Any help?

  • #2 / Sep 15, 2009 1:19am

    John Henry Donovan

    12339 posts

    Doy,

    You would create your feed template then just add a category parameter to the weblog entries tag within the templates. Gonna move this one to the ‘How to’ forum for you.

    {assign_variable:master_weblog_name="default_site"}
    {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}{weblog_name}{/exp:xml_encode}</title>
        <link>{weblog_url}</link>
        <description>{weblog_description}</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_start="on" disable="member_data|trackbacks" category="2"}
        <item>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <link>{title_permalink=site/index}</link>
          <guid>{title_permalink=site/index}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
          <description>{exp:xml_encode}{summary}{body}{/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}
  • #3 / Sep 15, 2009 7:29am

    Doy

    38 posts

    You know…I’d done that, and in Google Reader it kept grabbing everything, but I just looked at it in the Safari RSS reader and it worked fine.

    Thanks for the help!

  • #4 / Sep 15, 2009 7:53am

    Doy

    38 posts

    One last thing, and this is frustrating…I can’t get my calendar rss to show any entries…

    Here’s the code:

    {assign_variable:master_weblog_name="calendar"}
    {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}{weblog_name}{/exp:xml_encode}</title>
        <link>{site_url}</link>
        <description>{weblog_description}</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}" rdf="off" dynamic_start="on" disable="member_data|trackbacks" show_future_entries="yes"}
        <item>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <link>{title_permalink=calendar/detail}</link>
          <guid>{title_permalink=calendar/detail}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
          <description>{exp:xml_encode}{event-date}{event-info}{/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}

    I’ve checked this every way I know how and the feed just won’t show any entries…always says it’s empty.

    Is there a setting I’m missing?

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

ExpressionEngine News!

#eecms, #events, #releases