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.

Include images in RSS feed.

December 17, 2010 11:54am

Subscribe [7]
  • #1 / Dec 17, 2010 11:54am

    OwensDDB

    42 posts

    Hey, i’m having some trouble adding images to the RSS feed and can’t find any documentation explaining it clearly.

    {preload_replace:master_channel_name="blog"}
    {exp:rss:feed channel="{master_channel_name}" status="not closed"}
    <?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}{site_name}{/exp:xml_encode}</title>
        <link>{site_url}</link>
        <description>{channel_description}</description>
        <dc:language>{channel_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:channel:entries channel="{master_channel_name}" limit="10" dynamic_start="yes" disable="member_data|pagination" status="not closed"}
        <item>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <image>{blog_image}</image>
          <link>{title_permalink='blog/view'}</link>
          <guid>{title_permalink='blog/view'}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
          <description><![CDATA[{blog_body}]]></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:channel:entries}
        
        </channel>
    </rss>
    {/exp:rss:feed}

    What am I doing wrong?

  • #2 / Dec 18, 2010 2:52pm

    Greg Salt

    3988 posts

    Hi JamieFirstAd,

    I found this reference on the image tag for RSS feeds. Please try using that format to define an image for your feed.

    Cheers

    Greg

  • #3 / Dec 20, 2010 5:56am

    OwensDDB

    42 posts

    Hi

    This seems to offer an image for the feed, not the item? That seems to be what the rss readers are interpreting it as.

    Do I need to enable HTML or something?

    J

  • #4 / Dec 20, 2010 6:22pm

    Barry Cogan

    291 posts

    Hi JamieFirstAid

    The link greg provided above indicates you can do both the image and the item. They both need to be on the same level (see example below).

    <channel>
      <title></title>
      <link></link>
      <description></description>
      <image>
           // Image info goes here
      </image>
      <item>
           // Item info goes here
      </item>
    </channel>

    There should be nothing else needed for the image and content to display. 
    Could you please provide a link to your actual RSS feed?

    Thank you!

    Sincerely,

    Barry Cogan

  • #5 / Jan 26, 2011 9:32am

    geisterwerker

    24 posts

    I am having the same issue. Please advise:

    {preload_replace:master_channel_name="portfolio"}
    {exp:rss:feed channel="{master_channel_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}{site_name}{/exp:xml_encode}</title>
        <link>{site_url}</link>
        <description>{channel_description}</description>    
        <dc:language>{channel_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:channel:entries channel="{master_channel_name}" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks"}
    
    <item>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <link>{site_url}</link>
          <image>{thumb}</image>    
         <guid>{title_permalink=site/index}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
          <description>{exp:xml_encode}{excerpt}{/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:channel:entries}
        
        </channel>
    </rss>
    
    {/exp:rss:feed}
  • #6 / Jan 26, 2011 10:40am

    steph_rose

    17 posts

    Try this and let me know what hapens:

    <item>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <link>{site_url}</link>
          <link rel="enclosure" type="image/jpeg" href="{thumb}" /> 
         <guid>{title_permalink=site/index}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
          <description>{exp:xml_encode}{excerpt}{/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>
  • #7 / Jan 26, 2011 5:59pm

    Ingmar

    29245 posts

    Thanks for the assist, step_rose. Does that work for you?

  • #8 / Jan 26, 2011 8:29pm

    geisterwerker

    24 posts

    Thanks for the quick reply.
    Strage. When I made the updates, images do appear in Safari, but do not show up in Google reader or my Flavors.me feed.  Thoughts?

  • #9 / Jan 26, 2011 8:39pm

    geisterwerker

    24 posts

    Correction. It is actually just displaying the path to the image as opposed to the image itself.

  • #10 / Jan 27, 2011 11:24am

    Sue Crocker

    26054 posts

    Hi, geisterwerker.

    What is {thumb}?

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

ExpressionEngine News!

#eecms, #events, #releases