Overriding a custom content type D8

In your .module file add the following functions

function YOURMODULENAME_theme() {
  $theme['node__YOURCONTENTTYPENAME'] = array(
    'render element' => 'content',
    'base hook' => 'node',
    'template' => 'node--YOURCONTENTTYPENAME',
    'path' => drupal_get_path('module', 'tm_YOURMODULENAME') . '/templates',
  );
  return $theme;
}

put node–YOURCONTENTTYPENAME.html.twig in your modules /templates/ directory

function YOURMODULENAME_preprocess_node(&$variables) {
  $variables['test'] = "TEST SAVE";
}

clear cache & check your content type’s page TEST SAVE Should appear

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/22/feed