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.

Multiple categories, one RSS Feed

January 15, 2010 12:40pm

Subscribe [4]
  • #1 / Jan 15, 2010 12:40pm

    SarahW

    17 posts

    Howdy folks. Is there a way to include multiple EE categories in one RSS feed using the RSS code itself, and not a URL?

    I’m trying to merge six categories into one RSS feed for an iPhone app, and I cannot get the feed to validate when I use external methods of feed merging.

    RSS is something I always struggle with, so if the answer is, “nope, sorry” I totally understand.

  • #2 / Jan 15, 2010 12:43pm

    Ingmar

    29245 posts

    Can you show us what you’ve got? Some code, a link to the feed, perhaps? Basically, a feed is not really all that different from a regular weblog tag: if you can get multiple categories to display in a template, you should be able to do the same thing with a feed.

  • #3 / Jan 15, 2010 1:28pm

    Bjørn Børresen

    629 posts

    It can most likely be done in EE, but if it can’t Yahoo! Pipes ftw. It’s an awesome tool for stuff like that ..

  • #4 / Jan 15, 2010 1:33pm

    SarahW

    17 posts

    Hey bjornbjorn - thank you! I’ve been playing with Yahoo Pipes but the feeds that emerge are not quite working for me in terms of complete and total merry validation.

    Hi Ingmar

    This is what I have so far - which is basically nothing different from the basic! I want to have categories 23, 24, 25, 26, 27, and 30 display in one RSS feed, but I’m not sure where in the RSS code I should define which categories, if that makes sense.

    {assign_variable:master_weblog_name="weblog1"}
    {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: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/"
    xmlns:media="http://search.yahoo.com/mrss/" 
    xmlns:atom="http://www.w3.org/2005/Atom">
    
        <channel>
    
    <atom:link href="http://www.smartbitchestrashybooks.com/index.php/weblog/rss_2.0" rel="self" type="application/rss+xml" >
        
        <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}" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks"}
        <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}{body}{extended}{/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}
  • #5 / Jan 16, 2010 4:20pm

    Greg Salt

    3988 posts

    Hi Sarah,

    Can you give us a little more information about what is not validating (and which tool you are using to do so)? The RSS template should work like this.

    Cheers

    Greg

  • #6 / Jan 16, 2010 5:28pm

    SarahW

    17 posts

    I figured it out - I just created a parent category, added all the categories I wanted as children to that parent, then made sure the parent was selected as well - presto! Feed works.

    Thanks, folks!

  • #7 / Jan 16, 2010 5:31pm

    Greg Salt

    3988 posts

    Hi Sarah,

    Glad that you got it working.

    Cheers

    Greg

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

ExpressionEngine News!

#eecms, #events, #releases