Implement hook_theme in custom module

by lcunning   Last Updated January 07, 2018 00:07 AM

I am developing a custom module and I need to implement a theme. The result of my code below is that the code inside the block does not print because Drupal can't find the theme. I'm using hook_theme() and I'm not sure what I am missing.

Directory structure

directory structure for my module

jsblock.module code

 * Implements hook_theme().

function jsblock_theme($existing, $type, $theme, $path){
  return array(
      'jsblock_custom_theme' => array(
          'variables' => array('content' => NULL),
          'template' => 'panels_pane__block__jsblock_jsblock',
          'path' => drupal_get_path('module', 'jsblock') .'panels_pane__block__jsblock_jsblock',

I've been able to print the block by dropping the the file in the theme templates folder, but not when it is inside the module directory. Can someone please tell me what is wrong with my code?

Related Questions

Drupal 7 Custom Module with custom theme/template

Updated September 01, 2017 16:07 PM