How to export content items from Orchard CMS to CSV?

856 views Asked by At

I have a requirement to export every record from a content type in Orchard CMS to a CSV file that can be opened in Microsoft Excel.

I was surprised to see that this feature is not available out of the box or available as a module from the gallery. The built in export functionality in Orchard provides a custom xml format, great for moving content between Orchard sites but doesn't help me get the content in front of users that want to see it in excel.

A very simple link in the back end of Orchard that allows me to download a CSV file for a particular content type would suffice.

Does anyone know how easiest to achieve this in Orchard?

1

There are 1 answers

0
jmgomez On

As far as I know there is nothing like that in Orchard. But it's easy to do, you could do it and share it as a module. The "only" thing that you have to do is serialize the ContentItems and its ContentParts/Fields to that format. If you look at the source, you will see a lot of examples for serializing content items (e.g. json/xml)

With a quick search I found this CSV serializer: http://simplecsv.codeplex.com