Non-RSS XML values

FeedOtter can also read additional, custom XML values in your RSS feed. Clients have used this to supply custom images and descriptions along with the standard RSS data fields.

This can be especially useful when building data-driven emails from job boards, news sites, and eCommerce applications.

A helpful starting point is to use the token [[ post.asArray | json_encode ]] in your loop. This will display the raw object that you can then use to access various elements using standard object / array notation as shown below.

Example 1

<item>
<title>Beautiful Painting of saharanpur</title>
<link>
https://uat.rauantiques.com/catalog/product/view/id/102845/
</link>
...
<custom_image>
<![CDATA[
https://cdn-uat.rauantiques.com/media/catalog/product/cache/1/image/265x/9df78eab33525d08d6e5fb8d27136e95/1/_/1_30-6635_1_3.png
]]>
</custom_image>
<price cost="$179,000" age="2,000 years" condition="perfect"></price>
...

Here is how to access the custom_image property in the FeedOtter post loop:

Note: replace custom_image with custom field name.

You can also access attributes of custom elements such as the cost=”$179,000″. The post.asArray.price.attr contains all of the attributes on that node.

Example 2.

Here's another feed example with slightly different xml notation.

Here the custom values are accessed slightly differently.

Last updated