This extension lets you display a nested tree of categories with checkboxes to display and edit which categories are selected.
- A
categorycontent type with a bare minimum of anameshort text/symbol field and asubcategoriesmulti-reference field; you certainly can have any other fields you want. - One
categoryentry with the nameRootwhich serves as the entry point into your category tree. You probably also want to make other categories which will be the actual categories shown. - One or more other content types with a multi-reference field called
categories(that name is not strictly necessary, but makes the most sense to me :-P ). - The
contentful-clitool. If you don't have it, install it by runningyarn global add contentful-cliornpm -g install contentful-cli. After installation runcontentful loginto authorize thecontentful-clitool to use your Contentful account.
- Open your terminal, clone this repo (
git clone https://github.com/cachrisman/nested-category-browser), and change into the directory created (cd nested-category-browser) - Fill in the space ID and delivery token of the space you are using on lines 31 and 32 of
nested-category-browser.html. - run
contentful extension create --space-id SPACE_IDreplacingSPACE_IDwith the ID of the space in which you want to install this extension - In the Contentful webapp, edit your content model and change the appearance of a
categoriesmulti-reference field to theNested Category Browser Extensionwhich you have just uploaded.
