Hi. I'd like to select Hero Products from a Products collection to render to a Hero Products page (1 product from each category displayed as a block on the home page).
I've created a Products and Categories collection, how do I go about creating a Hero-Products collection & block that selects 1 product from each category?
Figma: https://www.figma.com/file/dnMTMTXcZRMDXgOLPIXObM/Melex?type=design&node-id=0-1&t=zhDZFIAvEWTIyoQu-0
Repo: https://github.com/taunhealy/Melex_Mono_1
Products collection:
import { slugField } from '../../fields/slug'
export const Products: CollectionConfig = {
slug: 'products',
admin: {
useAsTitle: 'title',
},
fields: [
{
name: 'title',
type: 'text',
required: true,
},
{
name: 'description',
type: 'text',
required: true,
},
{
name: 'priceJSON',
label: 'Price JSON',
type: 'textarea',
},
{
name: 'categories',
type: 'relationship',
relationTo: 'categories',
hasMany: true,
admin: {
position: 'sidebar',
},
},
slugField(),
],
}