Skip to content

Automatically filtering collections by site (multisite setup) #1833

Answered by jmikrut
falko100 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @falko100 — that type of "filter" would be referred to as a query constraint, and that is generally accomplished via some backend logic in either a field hook or an access control operation.

There are lots of ways to do this - but I think how I'd do it is persist something to the user when you switch the selected site - like... a select field on the user or similar.

And then write all your access control to look at which site the user has selected, and return your query constraint based on that. Does that make sense?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@falko100
Comment options

Answer selected by falko100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants