hook_theme_suggestions_page() provide default template file inside module folder I am using hook_theme_suggestions_HOOK() to implement a custom template file in my drupal 8 website like below. 

/**
 * Implements hook_theme_suggestions_HOOK().
 */
function mymodule_theme_suggestions_page(array $variables) {
  $template_suggestions = array();
  // This is used to display only $content.
  if (isset($_GET['ajax']) &amp;&amp; $_GET['ajax'] == 1) {
    $template_suggestions[] = 'page__ajax';
  }
  return $template_suggestions;
}


Above code is working fine and I can add template page--ajax.html.twig inside my current active theme and changes in template is reflecting in page.

But when I put that file inside my module itself file is not detecting and changes not reflecting in page and taking default page.html.twg template file.

How can I provide default template file within my module itself?
This issue got resolved by adding hook_theme(). Normally theme suggestion templates are only picked up when they are in themes. So We need explicitly define theme suggestions using hook_theme() inside a module. Then only it takes templeate from your modules templates folder.

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return array(
    'page__ajax' =&gt; array(
      'render element' =&gt; 'elements',
      'base hook' =&gt; 'page',
    ),
  );
}