0

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(
    'title'=>'Barcodes',
    'menu_name' => 'barcodes',
    'description'=>'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

0

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
2
  • 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
-1

You can use themeName_preprocess_page in your template.php.

Check the below url.

http://drupal.org/node/1089656.

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.