We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10881
    • 4 Posts
    Hi There!

    I’ve got a question regarding RSS Feeds in ModX. I’ve followed the tutorial on http://wiki.modxcms.com/index.php/Basic_RSS_feed to create a RSS feed for our website.

    The feed: http://www.formlab.nl/blog/rss

    Now, I would like to add the corresponding images of the blog to the basic RSS feed, but i can’t get it to work.

    I tried altering the code of my rss-item to:
    <item>
    <title>[+rss_pagetitle+]</title>
    <link>[(site_url)][~[+id+]~]</link>
    <image>
        <url>[+blog-image+]</url>
        <title>[+pagetitle+]</title>
        <link>[(site_url)][~[+id+]~]</link>
      </image>
    <description><![CDATA[ [+summary+] ]]></description>
    <pubDate>[+rss_date+]</pubDate>
    <guid isPermaLink="false">[(site_url)][~[+id+]~]</guid>
    </item>
    


    And the ditto call:
    [[Ditto? &parents=`249` &format=`rss` &truncOffset=`350` &tpl=`blog-artikel` &extenders=`summary` &tpl=`rss_item_simple`]]


    But it doesn’t seems to work. Is it possible to add images with ditto rss format at all?
      • 5915
      • 21 Posts
      I am wondering if this is even possible also. I see that ditto rss places a blank image tag in its xml page, but how do you access it and add your own image.
        • 1122
        • 209 Posts
        Yes, it is possible to add an image to the rss article, but first of all it requires careful learning of the rss specification. What is wrong in your item’s template, GJ, that is an <image> tag. <image> is a subelement of <channel> tag and therefore it does not work within <item> tag. In order to add your picture to the rss item, you need to re-arrange your item’s template like this:
        <item>
        <title>[+rss_pagetitle+]</title>
        <link>[(site_url)][~[+id+]~]</link>
        <description><![CDATA[ <img src="[(site_url)]assets/images/[+blog-image+]" alt="" title="" /> [+summary+] ]]></description>
        <pubDate>[+rss_date+]</pubDate>
        <guid isPermaLink="false">[(site_url)][~[+id+]~]</guid>
        </item>
        

        Please take care of building full and proper path to your picture ("src" attribute) within CDATA section (!) Good luck.