github.com/rpdict/ponzu@v0.10.1-0.20190226054626-477f29d6bf5e/docs/src/Interfaces/Format.md (about) 1 title: Format Package Interfaces 2 3 Ponzu provides a set of interfaces from the `management/format` package which 4 determine how content data should be converted and formatted for exporting via 5 the Admin interface. 6 7 --- 8 9 ## Interfaces 10 11 ### [format.CSVFormattable](https://godoc.org/github.com/rpdict/ponzu/management/format#CSVFormattable) 12 13 CSVFormattable controls if an "Export" button is added to the contents view for 14 a Content type in the CMS to export the data to CSV. If it is implemented, a 15 button will be present beneath the "New" button per Content type. 16 17 ##### Method Set 18 19 ```go 20 type CSVFormattable interface { 21 FormatCSV() []string 22 } 23 ``` 24 25 ##### Implementation 26 27 ```go 28 func (p *Post) FormatCSV() []string { 29 // []string contains the JSON struct tags generated for your Content type 30 // implementing the interface 31 return []string{ 32 "id", 33 "timestamp", 34 "slug", 35 "title", 36 "photos", 37 "body", 38 "written_by", 39 } 40 } 41 ``` 42 43 !!! note "FormatCSV() []string" 44 Just like other Ponzu content extension interfaces, like `Push()`, you will 45 return the JSON struct tags for the fields you want exported to the CSV file. 46 These will also be the "header" row in the CSV file to give titles to the file 47 columns. Keep in mind that all of item.Item's fields are available here as well. 48