4

I am trying to import some categories from a CSV into Craft entries (a categories field). Everything else imports ok apart from the categories

I have created the categories in admin with the same name as the CSV categories but when I import nothing gets selected.

I have the categories formatted in one column in the CSV seperated with a comma .e.g "Branding,Marketing,Design," (I read somewhere this is how it can be done).

Any ideas anyone?

Thanks Malcolm

Malcolm Maclean
  • 377
  • 1
  • 8
  • 1
    Does it work if you just import one category? As far as I remember, you'll have to use a different delimiter if you're importing multiple relations per cell, see "dataDelimiter" here: https://docs.craftcms.com/feed-me/v4/get-started/configuration.html – Udo Nov 01 '19 at 13:34

1 Answers1

4

As per the docs...if you add config/feed-me.php to your project containing

<?php

return [ '*' => [ 'dataDelimiter' => '-|-', ] ];

and format your CSV like

id,title,categories,city
17746,Imported title,Category 1-|-Category 2-|-Category 3,Bradford

should get you where you want to be.

Steven
  • 56
  • 4