This extension lets you display a nested tree of categories with checkboxes to display and edit which categories are selected.
- A
category
content type with a bare minimum of aname
short text/symbol field and asubcategories
multi-reference field; you certainly can have any other fields you want. - One
category
entry with the nameRoot
which 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-cli
tool. If you don't have it, install it by runningyarn global add contentful-cli
ornpm -g install contentful-cli
. After installation runcontentful login
to authorize thecontentful-cli
tool 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_ID
replacingSPACE_ID
with 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
categories
multi-reference field to theNested Category Browser Extension
which you have just uploaded.