Sharique
Sharique

Reputation: 4219

problem with new content type created via module

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.

Upvotes: 2

Views: 587

Answers (2)

FGM
FGM

Reputation: 2860

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.

Upvotes: 1

Seb
Seb

Reputation: 25147

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.

Upvotes: 1

Related Questions