2 * Implements hook_menu_local_tasks_alter().
4 function {{ machine_name }}_menu_local_tasks_alter(&$data, $router_item, $root_path) {
5 // Add an action linking to node/add to all pages.
6 $data['actions']['output'][] = array(
7 '#theme' => 'menu_local_task',
9 'title' => t('Add new content'),
11 'localized_options' => array(
12 'attributes' => array(
13 'title' => t('Add new content'),
19 // Add a tab linking to node/add to all pages.
20 $data['tabs'][0]['output'][] = array(
21 '#theme' => 'menu_local_task',
23 'title' => t('Example tab'),
25 'localized_options' => array(
26 'attributes' => array(
27 'title' => t('Add new content'),
31 // Define whether this link is active. This can be omitted for
32 // implementations that add links to pages outside of the current page
34 '#active' => ($router_item['path'] == $root_path),