drupal - hook_preprocess_page() does not seem to use the suggested template file -


i suggesting template file in hook_preprocess_page() implementation done module, suggested template file doesn't seem used.

the template file page--terminal-template.tpl.php, in directory containing module, , implementation of hook_preprocess_page().

function terminal_preprocess_page(&$variables) {   if (arg(0) == "terminal") {     $variables['theme_hook_suggestions'][] = "page__terminal_template";   } } 

could please me?

preprocess , process functions can implemented modules. in fact, documentation theme() lists them when shows in order functions called.

the fact drupal looks suggested template files in theme directory. have these alternatives:

  1. put template files module suggesting in directory containing theme used
  2. follow reported in load view template on module activation load template files module directory
  3. suggest template files want use in preprocess function implemented theme

following reported in other question, able use template file found in module directory. problem using generic template different default page template used enabled theme.

if adding template files enabled theme, should call drupal_theme_rebuild() make drupal rescan directory containing template files, after added new template file theme.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -