there are a few things missing in the new_menu array, needed to :
- specify the name of the parent menu ( otherwise the new item is always created for the 'navigation' menu )
- set the langcode, when the node is translatable.
$new_menu = array(
'link_path' => 'node/' . $node->nid,
'link_title' => $node->title,
'menu_name' => $parent_menu[0],
'plid' => $parent_menu[1],
'options' => array()
//'customized' => true, // ?
);
if ( $node->language )
$options = array('langcode' => $node->language);
Comments
Comment #1
j0nathan commentedsubscribing
Comment #2
corneverbruggen commentedThanks. That info should indeed be included. Added these changes to the module after some adjustments.