Drupal 8: FAPI and AJAX Executing and Creating AJAX Commands

In my previous article for this series I talked about the basics of applying and executing ajax commands on just about anything on drupal.

Drupal 8 Links.menu.yml

In Drupal 8 we have the new Links.menu.yml file along with the Links.action.yml and Links.task.yml these files are how you tell drupal where you want your links to be displayed for paths you define in the Routing.yml file.  You need to define your menu item here as well as in the Routing.yml file in order for Drupal to know how to render your page.

The parameters for this and the task yml file are pretty much the same except for a few deferences:


Module links.action.yml

In Drupal 7 we would define all of our menu links in a single hook_menu, or maybe alter them with hook_menu_alter.  In Drupal 8 though this has morphed into three different files for our menu items depending on the type you are trying to create.  For creating local actions (the buttons), you will need to add your page definition into a links.action.yml file for your module.


Drupal 8 Module Info.YML

The first  file needed for any project Module or Theme in Drupal 8 is the info.yml file.  In this article I will break down each of the properties you can include in the file in order to tell drupal 8 about it.