Possible Duplicate:
How a module can override theme suggestion?

I am making a new custom module. and i have 1 content type called city management(city-management). I want to override theme node.tpl.php file with node--city-management.tpl.php in my custom module.

Is it possible?

marked as duplicate by Clive, kiamlaluno Jul 6 '12 at 9:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Yes of course. Do you have a specific question? – BetaRide Jul 3 '12 at 14:07
  • Just to be sure I understood the question: Do you want to use a template file contained in your module directory, or in the theme directory? – espero Jul 3 '12 at 14:48
  • template file content in the module directory. – Pranav Gandhi Jul 4 '12 at 5:35
  • In this case, the question is a duplicate. – kiamlaluno Jul 6 '12 at 9:17

This can be done by providing Drupal with a content type template suggestion through hook_theme. It uses the same 'node--contentname' formalism you are used to in theme templates. This method is IMHO preferred if your module also creates the content type you're theming.

  • hook_theme() doesn't override the existing theme functions, such as the theme function used to render nodes. – kiamlaluno Jul 6 '12 at 9:19

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