Problem/Motivation
In the Views UI menu settings form, the Show as expanded checkbox is visible for every Menu radio option. Title, description, parent, weight and context all hide via #states when they do not apply; expanded is the only one that does not. It is only read for normal menu entries (PathPluginBase::getMenuLinks()).
Steps to reproduce
Add a view with a Page display, open Page settings > Menu, and switch between the radio options: the other settings appear and disappear, Show as expanded never does.
Proposed resolution
Add a #states condition on menu[type] === 'normal' to the expanded element in Views\display\Page.
Remaining tasks
Review.
User interface changes
The checkbox only shows for Normal menu entry.
API changes
None.
Data model changes
None.
Before Patch Apply

After Patch Apply

| Comment | File | Size | Author |
|---|---|---|---|
| #41 | after patch.png | 152.28 KB | saman_malik |
| #41 | Before Patch.png | 154.58 KB | saman_malik |
Issue fork drupal-2703349
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:
- 2703349-show-as-expanded
changes, plain diff MR !16610
Comments
Comment #2
peri22 commentedHere is the patch.
Comment #3
peri22 commentedComment #5
peri22 commentedComment #10
rosinegrean commentedComment #14
larowlanFlagging for needs reroll, as the use of
array()needs to use[]short array syntax instead.I just manually tested this against HEAD and can confirm the bug still exists.
Moving to 9.3 as 8.9 is now end of life.
Tagging for needs tests although that may be difficult because it would require JS test.
Comment #15
larowlanDowngrading to minor as the impact here is low.
Discussed with @darvanen in #bugsmash
Comment #16
yogeshmpawarreroll against 9.3.x branch
Comment #17
yogeshmpawarNeeds work for tests
Comment #20
rakhi soni commentedKindly review patch for branch 9.5x,,
Comment #21
rinku jacob 13 commentedReviewed and tested patch #20 for 9.5x. Adding Screenshots for the reference .
Comment #22
sonam.chaturvedi commentedVerified and tested patch #20. Patch applied successfully.
Test Steps:
1. Goto /admin/structure/views
2. Create a view page
3. Click on menu entry setting
4. Check by default 'No menu entry' option is selected
5. Verify 'Show as expanded' checkbox is not displayed
Test Result: 'Show as expanded' checkbox is not displayed when 'No menu entry' is selected.
Attached screenshot for reference.
Comment #23
kristen polThanks for testing. This still needs test so moving back to needs work. The code itself is straightforward.
Comment #24
smustgrave commentedAdding some tests.
Comment #26
smustgrave commentedMoving back to NR. Looks like the test only patch did fail.
Comment #29
smustgrave commentedSelf review this needs before/after screenshots in the issue summary.
Comment #30
nikhil_110 commentedComment #31
nikhil_110 commentedComment #32
borisson_Latest patch does not pass tests.
Comment #36
peri22 commentedMR !16610 against main. expanded was the only menu setting without #states - title, description, parent, weight and context all hide for "No menu entry". Adds a views_ui FunctionalJavascript test.
Comment #37
smustgrave commentedThank you for picking up.
IS appears to be incomplete.
Comment #38
peri22 commentedComment #39
peri22 commentedComment #40
peri22 commentedComment #41
saman_malik commentedTested the patch from MR !16610 against main.
Test steps:
Applied the diff
Went to /admin/structure/views
Created a view with a Page display
Opened Page settings → Menu (Menu link entry popup)
With "No menu entry" selected, confirmed "Show as expanded" checkbox is no longer displayed
Switched to "Normal menu entry" — confirmed "Show as expanded" checkbox correctly appears
Switched through "Menu tab" and "Default menu tab" — confirmed the checkbox stays hidden for these too, only showing for "Normal menu entry"
Result: Working fine
Comment #42
smustgrave commentedManually tested following the steps (pretty basic)
Change does resolve the issue and is a nice little improvement.
Not thrilled about a dedicated test for this but I really couldn't find one that could be expanded. So maybe this is a good start and future tests can expand it?!
LGTM.
Comment #43
alexpottCommitted and pushed b0128a3aae0 to main and 6884ce47578 to 12.0.x and 55758e4e67e to 11.x and 2cecffc40b1 to 11.5.x. Thanks!