Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control Next site filtering from Drupal #64

Open
claudiu-cristea opened this issue Dec 19, 2021 · 2 comments
Open

Control Next site filtering from Drupal #64

claudiu-cristea opened this issue Dec 19, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@claudiu-cristea
Copy link

claudiu-cristea commented Dec 19, 2021

I've created a Drupal instance to feed 2 next.js sites and configured the entity node > article to be resolved by entity reference. Don't know if this is a bug or could be a new feature request. Visiting each site, I see all nodes, regardless of their configured site. Probably I'm missing some tweaks on node.js side. But isn't possible to resolve this transparently, only from Drupal side + site resolver?

EDIT: OK, just found out this https://next-drupal.org/docs/data-fetching/filter-by-site. However, it would be nice to be able to avoid that.

@shadcn
Copy link
Collaborator

shadcn commented Dec 19, 2021

You can filter the nodes on the Next.js site by site id. We have some documentation here: https://next-drupal.org/docs/data-fetching/filter-by-site

It’s handled on the Next end right now for flexibility. The data is available to all sites and they get to pick and filter what to display.

However I do see what you mean. Limiting the resources available at the JSON:API might be useful in some cases.

I’ll look into this and see how we can implement this.

@claudiu-cristea
Copy link
Author

@shadcn thank you.

Limiting the resources available at the JSON:API might be useful in some cases.

I think in all cases. Because we don't want to risk that a site shows, by mistake, content leaked from a different site. Limiting on JSON:API level would be more secure and would also allow to control site filtering from a single point. Somehow, the JSON:API response should be SiteResolverInterface::getSitesForEntity() aware.

@shadcn shadcn added the enhancement New feature or request label Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants