Activate menu item with preprocess_page function Hi my international friends!

I work in Drupal 7.38.

If the current page belongs to a specific content type, I want to activate a specific menu item.
By to activate a specific menu item I mean that this menu item has the class active.

I try to do this with preprocess_page() function within template.php. It does not work :(.

Here is the code.

function MY_THEME_preprocess_page(&amp;$vars) {
  if( !empty($vars['node']) ) {
    switch ( $vars['node']-&gt;type ) {
      case 'machine_name_my_content_type':
        menu_tree_set_path('machine_name_menu','path_menu_item');
        break;
      default:
        menu_tree_set_path('machine_name_menu','path_menu_item');
    }
  }
}


I have also tried a variation. Instead of putting:

menu_tree_set_path ('machine_name_menu' 'path_menu_item')


I put menu_set_active_item ('path_menu_item')

Nothing works!

Can you help me. Thanks in advance.
I would suggest looking at the Menu position module