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.

Problems trying to get images displaying within RSS feeds

July 29, 2007 6:11pm

Subscribe [3]
  • #1 / Jul 29, 2007 6:11pm

    sm9

    352 posts

    Hi there,

    I’m trying to create a RSS feed for a gallery weblog but for some reason, I can’t get my images to appear within the feed.

    When I view the XML outputted by the browser when viewing the feed, the description tag only has an end tag - no start, and not image tag.

    Here’s the exact code I’m using:

    {assign_variable:master_weblog_name="gallery"}
    {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-
T;%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}{caption}{/exp:xml_encode}</title>
          <link>{title_permalink=image/index}</link>
          <guid>{title_permalink=image/index}#When:{gmt_entry_date format="%H:%i:&#xsZ;"}</guid>
          <description>{exp:xml_encode}http://www.mywebsite.com/images/gallery/{title}.jpg{/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-
T;%H:%i:%s%Q"}</dc:date>
        </item>
    {/exp:weblog:entries}
        
        </channel>
    </rss>
    
    {/exp:rss:feed}

    Any ideas what’s happening here?

    Thanks,

    Ste

  • #2 / Jul 29, 2007 9:03pm

    Ryan Irelan

    444 posts

    First thing I would try during troubleshooting is to correct the img tag and make it self-closing (as it should be).

    <a href="http://www.mywebsite.com/images/gallery/{title}.jpg">http://www.mywebsite.com/images/gallery/{title}.jpg</a>
  • #3 / Jul 29, 2007 9:23pm

    sm9

    352 posts

    I had the tag closed first, but it didn’t work.  So I changed it to the above after checking the difference between mine and another RSS2.0 photo blog RSS feed.

    I’ve changed it back to make sure, but it still doesn’t work.

    And just for info, the feed validates fine at http://validator.w3.org/feed/

    Ste

  • #4 / Jul 29, 2007 9:25pm

    Sue Crocker

    26054 posts

  • #5 / Jul 29, 2007 9:44pm

    sm9

    352 posts

    See if this helps:

    EEKB:// How can I Use HTML to Format my RSS Feed?

    Perfect, Sue - that was where I was going wrong, thanks.

    For info, here’s how the item section of my RSS feed currently looks:

    <item>
          <title>{exp:xml_encode}{caption}{/exp:xml_encode}</title>
          <link>{title_permalink=image/index}</link>
          <guid>{title_permalink=image/index}#When:{gmt_entry_date format="%H:%i:&#xsZ;"}</guid>
          <description><![CDATA[<a href="http://{title_permalink=image/index}">phpThumb/phpThumb.php?src=/images/gallery/{title}.jpg&h=90 </a>
    
    ]]></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-
T;%H:%i:%s%Q"}</dc:date>
        </item>

    Now I’ve got the images working, I can now add the second weblog.

    Thanks,

    Ste

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

ExpressionEngine News!

#eecms, #events, #releases