Expand Sub-Menu Items By Default

0
Hi all,   We have any application in 10.12.10. I would like to know whether it is possible when expanding your navigation menu, if you can have your sub-menu items expanded by default (i.e. that it looks like the image below). Note: I do not want to have my navigation menu expanded by default, I want my sub-menu items expanded when I expand my menu   Thanks in advance!  
asked
2 answers
0

To achieve sub-menu items expanded by default, you'll need to modify the Navigation layout in Studio Pro.

 

Steps:

  • Open the Navigation layout (Atlas_Default) used in your pages.
  • Click on the layout container and go to its properties.
  • Change the Layout Mode to Headline.
  • Save the updated layout and apply it to your pages.

By doing this, your sub-menu items will be expanded by default when you expand the navigation menu.

 

answered
0

I managed to show the items using the following JavaScript:

export async function JS_ExpandAllMenuItems(menuWidgetName, visible) {
	// BEGIN USER CODE
    // Select all menu items with the class 'mx-navigationtree-has-items' (these have sub-items)
	const menuWidget = document.querySelector(`.mx-name-${menuWidgetName}`);
	
	if(menuWidget) {
		if(!visible) {
			menuWidget.style.display = 'none';
		}
	}
	else {
		console.debug('Menu widget not found');
	}
    // Log to the console for debugging purposes
    console.log('Default menu items opened (if applicable).');
	// END USER CODE
}

 

answered