Relative Content

Tag Archive for javascripthtmlcssreactjssanity

hi everyone as im new to sanity as i defined field for a specific group is this possible inside of array to hidden a object depends upon documenttitle

defineField({
name: ‘modules’,
title: ‘Modules’,
type: ‘array’,
// hidden: ({document}) => document?.title !== ‘Hot Offers’,
of: [
{type: ‘module.deals’},
{type: ‘module.quicklinks’},
{type: ‘module.accordion’},
{type: ‘module.callout’},
{type: ‘module.grid’},
{type: ‘module.images’},
{type: ‘module.image’},
{type: ‘module.instagram’},
{type: ‘module.products’, hidden: ({document}) => document?.title !== “Brands”},
],
group: ‘editorial’,
}), is there any way to show grid only when document.title === “Grid” as shown above i try {type: ‘module.products’, hidden: ({document}) => document?.title !== “Brands”}, but instead of this is this on every document .