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

Neo Permissions for Block Visibility #778

Open
deeekay opened this issue Aug 24, 2023 · 5 comments
Open

Neo Permissions for Block Visibility #778

deeekay opened this issue Aug 24, 2023 · 5 comments

Comments

@deeekay
Copy link

deeekay commented Aug 24, 2023

What question would you like to ask?

Dear Neo-Team

In a current project, we are facing the challenge that we should allow some Neo Blocks to be selected if a pre-condition is met using a specific field. For example:
We have a Lightswitch field “allowWidget”
We have a NeoField with a NeoBlock “widget”
In a specific entry type, we use both fields and “widget” should only be allowed to use is “allowWidget” is set to true

Unfortunately, I haven’t found a way to access “allowWidget” from the Advanced Conditions in the NeoBlock itself. Do you have any input (or maybe alternative way to go for that) for me?

Thanks in advance and best regards,
Daniel

@ttempleton
Copy link
Contributor

This isn't currently possible, but would be good to have, and would likely be added at the same time as #775.

@deeekay
Copy link
Author

deeekay commented Aug 24, 2023

That would be awesome to have. Do you currently see a workaround to handle such a requirement?

@deeekay deeekay closed this as completed Aug 24, 2023
@deeekay deeekay reopened this Aug 24, 2023
@ttempleton
Copy link
Contributor

No workaround that I can think of, unfortunately.

@deeekay
Copy link
Author

deeekay commented Aug 28, 2023

Found an "under-the-hood" approach to tackle this here: https://github.com/spicywebau/craft-neo/blob/main/docs/events.md#example-1

Checking for e specific field on the element and filter the neo blocks accordingly (if the field is present). Hope this helps anyone else facing similar issues.

@ttempleton
Copy link
Contributor

Reopening per #779 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants