I have override page.tpl.php with my new custom menu created in my custom module. my menu look like below

$items['node/edit/restaurant/%/barcodes'] = array(
    'menu_name' => 'barcodes',
    'page callback'      => 'drupal_get_form',
    'page arguments' => array('leo_MSTag_barcode', 5),
    'access callback'=>TRUE,
    'type' => MENU_CALLBACK,

I already try with page--barcodes.tpl.php, page--node--edit--restaurant--barcodes.tpl.php but not work for me. any new template suggestion for override mu menu page?

2 Answers 2


I guess you could do something like this:

function MYMODULE_preprocess_page(&$vars) {
  $patterns = 'node/edit/restaurant/*/barcodes';
  if (drupal_match_path($_GET['q'], $patterns)) {
    $vars['theme_hook_suggestions'][] = 'page__node__edit__restaurant__barcodes';

That would let you use page--node--edit--restaurant--barcodes.tpl.php after a cache clear.

As an aside, your page arguments are wrong in the router item, should be:

'page arguments' => array('leo_MSTag_barcode', 3), // <-- Index of arg is 3, not 5
  • thanks for quick replay but its not worked for me. Apr 10, 2013 at 9:54
  • sorry my silly mistake i have put tpl file in my template folder instead of root theme folder. now its working thanks. Apr 10, 2013 at 10:35

You can use themeName_preprocess_page in your template.php.

Check the below url.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.