Skip to content

Instantly share code, notes, and snippets.

@awasson
Created February 1, 2016 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awasson/fcc44fc6cba6f4b90ff5 to your computer and use it in GitHub Desktop.
Save awasson/fcc44fc6cba6f4b90ff5 to your computer and use it in GitHub Desktop.
Updates to menu_attributes_form_node_form_alter in Menu Attributes for D8 to render Menu Attributes in the Node Editing Form.
@awasson
Copy link
Author

awasson commented Feb 2, 2016

In the second snip of code, on lines 9 - 11, we acquire the menu link defaults and determine whether a menu item exists for the node via the node editing form.

In the second snip of code, on line 12 we try to acquire the form menu in order to isolate the Menu Settings portion but that's not the way the new menu api works so we'll have to acquire it using a different method.

For testing we call _menu_attributes_form_alter($form, $form, $form). Our final goal will be to attach it to the Menu Settings portion of the node editing form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment