Closed PetroPavlenko closed 4 years ago
You would have to setup two collections and use the filter option like so for both:
label: "Page meta data",
name: "pageMetaData",
widget: "object",
filter: { field: "isExcludedFromSitemap", value: false or true },
Or you can use the view_filters options, no need to setup another collection in this case.
label: "Page meta data",
name: "pageMetaData",
widget: "object",
view_filters:
- label: ExcludedFromSitemap
field: isExcludedFromSitemap
pattern: true
@barthc I use js to declarate configs. I tried
export const pageMetaData = {
label: "Page meta data",
name: "pageMetaData",
widget: "object",
filter: { field: "isExcludedFromSitemap", value: true },
fields: [
But this doesn't work Maybe you know way to declarate collections in JS ?
Whoops sorry my bad, thought I added the filter: { field: "isExcludedFromSitemap", value: true },
as a collection level config ..
Add the filter option as a collection level option. For example:
export const termsCollection = {
name: "terms",
label: "Terms",
folder: "src/pages/terms",
create: true,
identifier_field: "slug",
filter: { field: "isExcludedFromSitemap", value: true },
Describe the bug In my team we tried to use filter feature with
CMS.init
but this doesn't work. I know that filter should work with folder collection. But I haven't found way to add them using CMS.init. Maybe I'm doing something wrong?Applicable Versions:
CMS configuration
/cms.tsx
:/terms.tsx
:/meta-data.tsx
: