Because the attributes fields are so numerous and take up a lot of vertical space, I was wondering if the attributes fields could be in their own fieldset inside the Menu settings area.

Ideally, this fieldset would be collapsed by default.

In all of my cases of using menu attributes, adding attributes is not the norm, hence having the fields available for all cases is confusing for some users who think they must all be filled out.

Files: 
CommentFileSizeAuthor
#2 Move_Attributes_into_its_own_fieldset-1627806-2.patch786 bytesd.clarke
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es).
[ View ]
#2 Move_Attributes_into_its_own_fieldset_with_menu_items_patch-1627806-2.patch6.93 KBd.clarke
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es).
[ View ]

Comments

Bump.
It would also be nice to either control where they appear on the node add/edit screen so they could be moved down the page, put in a collapsed field set, or even better to completely disable them for certain content types.

These extra field can be confusing for some users. And when I disable them from the settings then I don't have the opportunity to use them when editing the menu items under menu.

Any solution on hiding these fields in certain content types?

......
oops, I think I found my issue, why it still appears when all menus are disabled.
Menu attributes displayed even if all menus are disabled for a content type

StatusFileSize
new6.93 KB
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es).
[ View ]
new786 bytes
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es).
[ View ]

Per the original issue request, it turns out this a fieldset by default in the code, but then it is changed from a fieldset to a container. This logic to change it to a container was completed in commit:

76c69d71 - Moved the description element handling back into menu_attributes_form_menu_edit_item_alter() and improved display of attribute form elements.

Since the maintainers changed it from a fieldset to a container I'm not sure this will be committed, but attached are two patches: one that chages it back to a fieldset and makes it default to collapsed, and a second patch that does the same thing if you are using the patch from issue #1488960: Attributes for LI element.

Regardless, this isn't too bad to switch back to a fieldset and make it collapsed by default in your own module via a hook_form_alter. Just add the following code to a custom module and make sure your module's form alter runs after the menu_attributes' alter either by using the module name, module weight, or hook_module_implements_alter.

<?php
function YOUR-MODULE-NAME_form_node_form_alter(&$form, $form_state) {
  if (isset(
$form['menu']['link']['options']['attributes']['#type'])) {
   
$form['menu']['link']['options']['attributes']['#type'] = 'fieldset';
   
$form['menu']['link']['options']['attributes']['#collapsed'] = TRUE;
  }
}
?>

Issue summary:View changes
Status:Active» Reviewed & tested by the community

Both patches work like a charm, thanks you for this small but huge UI improvement.