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

Management of a new hide/show field in frontend #8752

Open
gdessimoneinvalle opened this issue Jan 26, 2024 · 4 comments · May be fixed by #8807
Open

Management of a new hide/show field in frontend #8752

gdessimoneinvalle opened this issue Jan 26, 2024 · 4 comments · May be fixed by #8807

Comments

@gdessimoneinvalle
Copy link

<input type="hidden" name="@Html.NameOf(m => m.MenuItemEntries[i].MenuItemId)" value="@menuPartEntry.MenuItemId" />

A customer asked us to be able to manage displaying contents in the menus via a new button visible directly from the navigation list, in order to have an immediate visual impact of what will be visible to the public in frontend
this is a proposal for a new feature

@giannik
Copy link
Contributor

giannik commented Feb 5, 2024

Why have a hard coded value to show or hide only ?
You may want to show or hide menus based on various rules, example if the user is a member of a specific role, based on the language, based on the current date, whatever .
A more flexible approach would be to do what the layers module does to show or hide widgets with a rules defined approach. Example for each menu item you could have a text area input where user defines his rules that evaluate to true or false and this could control the menu rendering or not.

@gdessimoneinvalle
Copy link
Author

I know but the solution was implemented at the client's request according to the design made by another team and created with a limited budget, so there was no margin for too generic solutions. Another request from the technical team was specifically to do a PR, which I did.

@sebastienros
Copy link
Member

You may want to show or hide menus based on various rules, example if the user is a member of a specific role, based on the language, based on the current date, whatever .

This is accomplished by customizing the MenuPart and changing the view to filter items based on these custom fields.

Theorically this is how this should be done for hide/show too, with a Boolean field named Visible for instance. I had forgotten about it. It would be nice if this could be the option that is chosen, which would require an extra click.

This state could be exposed in the list of menu items by customizing the shapes that render it. All this would then be in the customer's solution.

@gdessimoneinvalle
Copy link
Author

Curiously, this was the solution that was initially implemented, and it worked, but the technical team that designed the site then decided to let us proceed in this way, I will point out your criticisms

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

Successfully merging a pull request may close this issue.

3 participants