Menu Settings
A MenuSettings object holds a menu’s configuration from project config, such as its limits, propagation, permissions and field layouts, rather than the field values saved on the menu. Templates rarely need this object. Use the Menu element for custom field values.
Access
$menuSettings = \verbb\navigation\Navigation::$plugin->getMenus()->getMenuByHandle('mainMenu');MenuSettings is a PHP-only API. In Twig, use craft.navigation.menu('handle').one() for menu field values.
Properties
The ID of the menu.
The menu’s name, as shown in the control panel.
The menu’s handle, such as mainMenu. This is the name you use for the menu in Twig, PHP and GraphQL.
The instructions shown to editors for this menu in the control panel. It’s null when the menu has none.
The deepest level editors can nest nodes to, where top-level nodes are at level 1. It’s null when nesting isn’t limited, and 1 keeps the menu flat.
The most nodes editors can add to the menu on each site. It’s null when there’s no limit.
The way new nodes are copied to the menu’s other sites, which is none, siteGroup, language or all.
The way node titles are translated across sites, which is none, site, siteGroup, language or custom. With none, a title edited on one site changes on every site.
The Twig template that builds the translation key for node titles when titleTranslationMethod is custom. It’s null for the other methods.
Whether new nodes are enabled on the menu’s other sites when they’re copied there. Editors see this as the default for Enabled On Other Sites By Default, and it only applies when propagationMethod isn’t none.
The ID of the Craft structure that holds the menu’s node tree.
The ID of the field layout used for the menu’s nodes, which sets the custom fields editors fill in on each node.
For menu-level field values, use craft.navigation.menu('handle').one().