Hello

On any menu item edit page, the Menu link attributes settings appears twice (in french and english)
I have unabled modules :
i18n_node
i18n_menu

Screenshot attached

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

creatile created an issue. See original summary.

joelpittet’s picture

One is for the menu element (li tag) and one for the menu link (a tag). There is no duplication but the help text is duplicated. We should make the help text more generic.

Enter additional classes to be added to the link.

should be something like:

Enter additional CSS class names to be added to the element.

The field group they are in is what they can be applied to.

Would you mind making a patch for this? And does that make sense as a way to improve this?

jalpesh’s picture

Assigned: creatile » jalpesh
FileSize
11.03 KB

I think if we change description of Class then it is require to change description of ID and Style as well. The description of three attribute(ID, Class and Style)is same because they are share by menu link and item. We need to write some code to handle description of attribute.

attribute

Let me know your thought. Thanks.

joelpittet’s picture

Version: 7.x-1.0 » 7.x-1.x-dev

Yes that sounds good. Anywhere it ends with 'to the link' or 'for the link' needs to be rewritten to make it generic applying to the element that is noted by the fieldset.

jalpesh’s picture

Status: Active » Needs review
FileSize
1.72 KB

I have add a patch to change description of attribute. It may possible that the solution will not look good to you, so let me know your thoughts, will work on it.

Also let me know any change in new description message. Thanks.

joelpittet’s picture

+++ b/menu_attributes.module
@@ -120,7 +123,7 @@ function menu_attributes_get_menu_attribute_info() {
-      '#description' => isset($info['description']) ? $info['description'] : '',
+      '#description' => in_array('item_attributes', $info['scope']) ? (isset($info['item_description']) ? $info['item_description'] : '') : (isset($info['description']) ? $info['description'] : ''),

Clever idea but you probably want to use isset() here and check $group. Also we probably want to update the hook_menu_attribute_info() in /menu_attributes.api.php to indicate this is a thing.

jalpesh’s picture

Here is the new path with changes mention in your above comment.

Let me know if i misunderstand something in your above suggestion. Thanks.

jalpesh’s picture

Please ignore above path.

jalpesh’s picture

I think none of the patch will not solve the problem. I am working on other solution. Thanks.

jalpesh’s picture

Status: Needs review » Needs work
jalpesh’s picture

Status: Needs work » Needs review
FileSize
3.56 KB

Here we go with new solution.

Let me know you thoughts so we can work accordingly. Thanks.

joelpittet’s picture

That looks good, fixed some typos and think we can get away without inventing a form api property to pass along the value because that may cause issues and we have the value later anyway. Does that work for you?

EDIT: probably a better comment above the condition would be

// If the item description is set, override the form description.
jalpesh’s picture

Thanks for review.

Yes, you are right. we can easily get away with following unnecessary condition.

'#item_description' => isset($info['item_description']) ? $info['item_description'] : '',

I have just change comment as per your suggestion. Thanks.

  • jalpesh authored f9612d1 on 7.x-1.x
    Issue #2752153 by jalpesh, joelpittet, creatile: Menu attributes appears...

  • jalpesh authored 8817099 on 8.x-1.x
    Issue #2752153 by jalpesh, joelpittet, creatile: Menu attributes appears...
joelpittet’s picture

Status: Needs review » Fixed

Thanks I've committed the changes to the 7.x and 8.x branches

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.