1

I'm currently able to import nested categories from a Google Sheets when they already exist.

But when a child category does not exist, the category is created at the first level. It's quite logic because we don't know which level has that new category.

So I was wondering if there's a way to specify the level/parent of the category in the csv ? Or if the easiest solution is to import the categories before the entries ?

Thanks !

2 Answers 2

3

This is how I did it: https://craftquest.io/lessons/populating-nested-categories-from-a-google-sheet (free video)

I structured the spreadsheet so it has a flat list of all of the categories in the first column and their parent (if there is one) in the second column.

On the import, you want are importing the first column (all categories) and then set the parent at the same time with the data in the right column. Because the parent category is listed first, it already is there.

1
  • Thanks a lot ! I'll try that this afternoon, but it's looks perfect for my situation. Commented Mar 1, 2022 at 9:58
0

You would need to either create the categories and their structure first, or import them and arrange them into their structure later.

1
  • Yes, import the categories first was the good call in my case. Thanks for your answer. Commented Mar 2, 2022 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.