views:

351

answers:

2

I trying to write a drupal module. I'm following book "Learning Drupal 6 Module Development ". I have created a new content type (mybio)in module. I'm able create new node and edit node for new content type , it works fine but I'm not able to see new fields for mybio content type when viewing node. I have placed mybio_info.tpl.php file in module folder and theme folder but nothing works.

+1  A: 

Have you implemented the load hook and view hook?

Whenever you create new content types, you need to provide all hooks for changing / loading nodes, such as hook_delete(), hook_insert(), hook_load(), hook_update(), hook_validate() and hook_view().

If that doesn't work, are you sure your template is being used? If not sure, replace all its contents by something simple like '1' and see if that's being shown. If you don't see that, then it's not being used at all; try renaming to node-mybio.tpl.php.

For template naming, take a look at the Core templates and suggestions handbook page.

Seb
yes, I have implemented these hooks.
Sharique
Ok, I've updated my answer with a change in template filename change suggestion. Please let me know if that works.
Seb
I'm able to fix the problem, it was coding error which is not identified by interpreter.
Sharique
+1  A: 

It looks like you did not implement hook_theme, so the system has no idea you are providing it with a template for this content type.

You can check whether this is the problem by displaying the theme registry using devel.module, or go further and use theme_developer module to check which template is used for everything on-screen.

FGM