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

How to pass a custom header when using drupal.getMenu that is not globally applied ? #798

Open
jean-pasqualini opened this issue Sep 13, 2024 · 1 comment
Labels
question Question asked by a user triage A new issue that needs triage

Comments

@jean-pasqualini
Copy link

jean-pasqualini commented Sep 13, 2024

Package

next-drupal (NPM package)

Ask the question

Basically, I'm using SSR render on next.js and I want to use drupal.getMenu passing the header cf-ipcountry that i receive on each request depending on the user's country. this isn't related to translation of the menu.

for regulatory reason, i have a case where depending on the country the menu tree change slightly. on drupal side i have only menu and some items are not render in the json of the menu tree if they are not allowed to be displayed in this country.

i saw that it is possible to pass some custom header globally when initializing the drupal client but i didn't found any solution to pass a custom header dynamically when we use the fonction drupal.getMenu.

Maybe i'm wrong so i'm asking to you if that exists, or if we could have a such feature at the call level for getMenu and the others functions line getResourceCollection and so on as well.

@jean-pasqualini jean-pasqualini added question Question asked by a user triage A new issue that needs triage labels Sep 13, 2024
@jean-pasqualini
Copy link
Author

for now my alternative is to create one drupal client instance by country

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question asked by a user triage A new issue that needs triage
Projects
None yet
Development

No branches or pull requests

1 participant