hi all!
i.e. set localization to ['gb', 'us', 'au']
there is a "Page" collection with locale (select) field with same options as localization
is it possible to filter list based on locale?
i want to render (or apply filter automatically) the list only with certain locale that chosen
is there a way to do this in payload?
thank you
just found that we can retrieve current locale from req, so the solution is something like this in collection access control
access: {
// @ts-ignore
read: ({req: {locale}}) => {
return {
locale: {
equals: locale
}
}
}
},
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.