How do I call a custom theme file (stored in the theme folder) that displays on a specific page that is created by a module.
It's a module for viewing mortgages in a full-page view. The template file is called page--single_view.tpl.php
The module is named single_view and has these functions:
<?php
/**
* @file
* Single Mortgage Views module file
*/
/**
* hook_menu() add to menu
*/
function mortgage_single_view_menu() {
$items = array();
$items['mortgage/%/view'] = array(
'page callback' => 'single_view_theme', //This isn't correct but just set this way for now
'page argument' => array(3), //pass 3rd argument of url -- 1. drupal 2. mortgage 3. %
'access callback' => TRUE,
);
return $items;
}
/*
* Implementation of hook_theme().
*/
function single_view_theme($existing, $type, $theme, $path){
return array (
'page__single_view' => array (
'variables' => array(),
'template' => 'page--single_view' ,
'base hook' => 'page',
'path' => drupal_get_path('module', 'single_view'),
),
);
}
I'm guessing my implementation of hook_theme isn't correct. The page that comes up is just blank?
hook_menu
calledmortgage_single_view_menu
? If your module is called single_view, then your implementation of hook_menu should besingle_view_menu
. Also, you're using hook_theme all wrong. It is not meant to be a page callback. Will see if I have time to write up the right way to do it.page argument
value should bearray(1)
if it's your intention to pass the value of the % placeholder to your page callback.return array();