Problem/Motivation
In #3411099: Create an administration UI for managing Navigation Blocks we allow for the user to manage both the content and footer regions of the navigation bar. Allowing management of the footer region can lead to some strange side effects that we don't want to have to account for.
Proposed resolution
Restrict configuration of the toolbar footer items. Users should only be allowed to manage the content region of the navigation through the UI.
Remaining tasks
Code implementation. Lets leave in logic that allows for management of multiple regions, but effectively only allow for management of the content region in the UI.
User interface changes
Remove the ability to manage the footer region. Hide the region selector and the "Content" title, anything to simplify the UI now that there is only one region to manager from the users perspective.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Monosnap Navigation sections | Drush Site-Install 2024-01-04 09-13-59.png | 71.18 KB | m4olivei |
Issue fork navigation-3412119
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
prashant.cRaised MR https://git.drupalcode.org/issue/navigation-3411099/-/merge_requests/1 and created the merge request against the https://git.drupalcode.org/issue/navigation-3411099/-/tree/3411099-creat....
Kindly review.
Comment #4
prashant.cComment #5
m4oliveiThanks @Prashant.c. Couple things.
1. Lets hide the region column on the Navigation section UI, since there is only once choice. Probably change the form element to a
'#type' => 'value'.2. Other note I left as a MR comment wrt the entity form.
Comment #6
prashant.c@m4olivei
As soon as Iam changing the form element from "select" to "value" or something else the tabledrag stops working, not able to drop items and JS error
The navigation section cannot be placed in this region.Any ideas?
Comment #7
m4oliveiNothing immediately comes to mind, I would have to play with it. May get time for that next week. No rush, would like to see #3411099: Create an administration UI for managing Navigation Blocks land first anyway.
Comment #8
prashant.cI'm thinking whether it's okay to use CSS here to hide the label and select list for regions.
Comment #9
m4oliveiI don't think that's a great idea, you still have the form value you need to deal with on the back end.
I've pushed a couple of commits. First to remove the region column from the Navigation Section admin UI. That comes with necessary adjustments to the #tabledrag config and Javascript handling that we no longer need. Second, to change the #type select to #type value on the NavigationSectionForm.
I believe that puts us in a good place here. @Prashant.c, please review.
As we discussed in Slack, we will hold off on merge here until the main issue (#3411099: Create an administration UI for managing Navigation Blocks) is resolved and merged to 1.x.
Comment #11
m4oliveiI needed to rebase the branch against
1.xof thenavigationmodule. I also needed to open a new MR (linked in the ticket description) b/c Gitlab wouldn't let me det the target fork for the MR that @Prashant.c opened. I've closed that one.@Prashant.c if you could review, that would be wonderful!
Comment #17
ckrinaMerged! Thanks for the work!